-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of other.github.com:waves-exchange/contracts into…
… neo-vesting
- Loading branch information
Showing
61 changed files
with
5,172 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# L2MP Leasing | ||
|
||
## Keys | ||
| key | type | value | description | | ||
| :------------------------------------- | --------: | :--------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `%s__{nodeAddress}` | `String` | `'%d%d%d%d__{currentPeriodHeight}__{currentLeasingAmount}__{nextPeriodHeight}__{nextLeasingAmount}'` | `nodeAddress` total leasing data | | ||
| `%s%s__{nodeAddress}__{userAddress}` | `String` | `'%d%d%d%d__{currentPeriodHeight}__{currentLeasingAmount}__{nextPeriodHeight}__{nextLeasingAmount}'` | `userAddress` leasing data for `nodeAddress` | | ||
| `%s%s__toClaim__{userAddress}` | `String` | `'%d%d%d%d__{currentPeriodHeight}__{unlockedAmount}__{nextPeriodHeight}__{lockedAmount}'` | `userAddress` claim and unlock balances. `lockedAmount` is locked until `nextPeriodHeight`. `unlockedAmount` currently available for claim | | ||
| `%s%s__userTotalLocked__{userAddress}` | `Integer` | `1012345678` | `userAddress` total leased | | ||
| `%s__assetId` | `String` | `'ABCD...'` | Leasing `AssetId` | | ||
| `%s__periodLength` | `Integer` | `10000` | Period length in blocks (Default: 10000) | | ||
| `%s__offsetHeight` | `Integer` | `1234567` | First period height | | ||
| `%s__adminAddressList` | `String` | `'{address1}__{address2}__...'` | List of Admin Addresses | | ||
| `%s__forceStop` | `Boolean` | `false` | Force stop contract flag | | ||
|
||
# Functions | ||
|
||
## User Claim Data READONLY | ||
``` | ||
# User data | ||
# Return tuple: | ||
# _1 = current period start height | ||
# _2 = current period available to claim | ||
# _3 = next period start height | ||
# _4 = next period available to claim | ||
# _5 = total leased amount | ||
# _6 = current height | ||
@Callable(i) | ||
func getUserDataREADONLY(userAddress: String) | ||
``` | ||
|
||
|
||
## Node Leasing Data READONLY | ||
``` | ||
# Node leasing data | ||
# Return tuple: | ||
# _1 = current period start height | ||
# _2 = current period leased amount | ||
# _3 = next period start height | ||
# _4 = next period leased amount | ||
# _5 = current height | ||
@Callable(i) | ||
func getNodeDataREADONLY(nodeAddress: String) | ||
``` | ||
|
||
## User Leasing to Node Data READONLY | ||
``` | ||
# Node leasing data | ||
# Return tuple: | ||
# _1 = current period start height | ||
# _2 = current period leased amount | ||
# _3 = next period start height | ||
# _4 = next period leased amount | ||
# _5 = current height | ||
@Callable(i) | ||
func getUserLeasingDataREADONLY(nodeAddress: String, userAddress: String) | ||
``` | ||
|
||
## Lease | ||
- Require 1 payment in `assetId` | ||
``` | ||
@Callable(i) | ||
func lease(nodeAddress: String) | ||
``` | ||
|
||
|
||
## Lease by Address | ||
- Require 1 payment in `assetId` | ||
``` | ||
@Callable(i) | ||
func leaseByAddress(nodeAddress: String, userAddress: String) | ||
``` | ||
|
||
|
||
## Lease from locked | ||
- `amount` should be less or equal (`unlockedAmount` + `lockedAmount` + `paymentAmount`) | ||
``` | ||
@Callable(i) | ||
func leaseFromLocked(nodeAddress: String, amount: Int) | ||
``` | ||
|
||
|
||
## Cancel lease | ||
``` | ||
@Callable(i) | ||
func cancelLease(nodeAddress: String, amount: Int) | ||
``` | ||
|
||
|
||
## Claim unlocked | ||
``` | ||
@Callable(i) | ||
func claimAll() | ||
``` | ||
|
||
|
||
## Claim from unlocked amount | ||
``` | ||
@Callable(i) | ||
func claim(amount: Int) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# L2MP Swap | ||
|
||
## Keys | ||
| key | type | value | | ||
| :----------------------------------- | --------: | :-------------------------------------------------------------- | | ||
| `%s__stakingAddress` | `String` | `'3PAbc...'` | | ||
| `%s__assetInId` | `String` | `'ABC...'` | | ||
| `%s__assetOutId` | `String` | `'ABC...'` | | ||
| `%s__assetOutPrice` | `Integer` | `1000000` | | ||
| `%s%s__stats__totalIn` | `Integer` | `123456` | | ||
| `%s%s__stats__totalOut` | `Integer` | `12345678` | | ||
| `%s%s%s__stats__totalIn__{address}` | `Integer` | `12345` | | ||
| `%s%s%s__stats__totalOut__{address}` | `Integer` | `1234567` | | ||
| `%s%s%s__history__{address}__{txId}` | `String` | `'%d%d%b%s__{AmountIn}__{amountOut}__{isStake}__{nodeAddress}'` | | ||
|
||
# Functions | ||
|
||
## Swap | ||
- Should be with 1 payment in XTN | ||
``` | ||
@Callable(i) | ||
func swap() | ||
``` | ||
|
||
## Swap and Stake | ||
- Should be with 1 payment in XTN | ||
|
||
Arguments: | ||
- `stakingNode` - base58 string of staking node address | ||
|
||
_Note: If `stakingNode` is equal to empty string (`""`) it swaps without staking_ | ||
``` | ||
@Callable(i) | ||
func swapAndStake(stakingNode: String) | ||
``` |
38 changes: 38 additions & 0 deletions
38
migrations/2024_02_05_l2mp_new_swap/01_l2mp_new_swap_data_tx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"version": 2, | ||
"senderPublicKey": "EfRKQWb1FWaWmo9fkorRwMA4BrSzUWNAVhXqB9vLmv7g", | ||
"data": [ | ||
{ | ||
"key": "%s__assetInId", | ||
"type": "string", | ||
"value": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" | ||
}, | ||
{ | ||
"key": "%s__assetOutId", | ||
"type": "string", | ||
"value": "7scqyYoVsNrpWbTAc78eRqNVcYLxMPzZs8EQfX7ruJAg" | ||
}, | ||
{ | ||
"key": "%s__assetOutPrice", | ||
"type": "integer", | ||
"value": 1000000 | ||
}, | ||
{ | ||
"key": "%s__stakingAddress", | ||
"type": "string", | ||
"value": "3PF1QWiN4A3CCJoKh1kGtqYqMNaBnRZbC6t" | ||
}, | ||
{ | ||
"key": "%s__allowedAddress", | ||
"type": "string", | ||
"value": "3P87zrU6UmJq7wEZz84Fm9PJXr9tLGfEwPB" | ||
}, | ||
{ | ||
"key": "%s__adminAddressList", | ||
"type": "string", | ||
"value": "3PBUguU83ccjXz7NBbR3vn67fVHawbxwaTH__3PLU2bd4CDhHC35bf5qsQxYLpkEkpgkrcvc__3PF3AgB3cEE8F9ZUxuA9aLyM2PBjKrrszZQ__3PHdaP2BLUXFacnqZm6WoFjidvzqZZMbb8j__3P33RBZUXcdx5JW918DqFfrscEuEZpAPUPz" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"feeAssetId": null, | ||
"version": 2, | ||
"senderPublicKey": "8Y62huyQ3xnFnUw2FnZPHuWMsUy1c8t343UdWrHMgsq4", | ||
"chainId": 87, | ||
"data": [ | ||
{ | ||
"key": "%s__assets", | ||
"type": "string", | ||
"value": "Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" | ||
}, | ||
{ | ||
"key": "%s%d__startHeight__1", | ||
"type": "integer", | ||
"value": 4029955 | ||
}, | ||
{ | ||
"key": "%s%d__treasuryValue__1", | ||
"type": "integer", | ||
"value": 161759000000 | ||
}, | ||
{ | ||
"key": "%s__currentPeriod", | ||
"type": "integer", | ||
"value": 1 | ||
}, | ||
{ | ||
"key": "%s__calculatorAddress", | ||
"type": "string", | ||
"value": "3PEWpQi3QptntrersmgAgDEgrTSRf4pyXMz" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"senderPublicKey": "5WG53hB4ZK2TWX7UnLeTU4ieDp8Fy4VtaYx6gKFYxGHu", | ||
"fee": 500000, | ||
"type": 6, | ||
"version": 2, | ||
"feeAssetId": null, | ||
"chainId": 87, | ||
"assetId": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS", | ||
"amount": 197652859 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"senderPublicKey": "5WG53hB4ZK2TWX7UnLeTU4ieDp8Fy4VtaYx6gKFYxGHu", | ||
"fee": 500000, | ||
"type": 6, | ||
"version": 2, | ||
"feeAssetId": null, | ||
"chainId": 87, | ||
"assetId": "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu", | ||
"amount": 1782553903 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"senderPublicKey": "5WG53hB4ZK2TWX7UnLeTU4ieDp8Fy4VtaYx6gKFYxGHu", | ||
"fee": 500000, | ||
"type": 6, | ||
"version": 2, | ||
"feeAssetId": null, | ||
"chainId": 87, | ||
"assetId": "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk", | ||
"amount": 19794837528 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"senderPublicKey": "5WG53hB4ZK2TWX7UnLeTU4ieDp8Fy4VtaYx6gKFYxGHu", | ||
"fee": 500000, | ||
"type": 6, | ||
"version": 2, | ||
"feeAssetId": null, | ||
"chainId": 87, | ||
"assetId": "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ", | ||
"amount": 86005770817 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"senderPublicKey": "5WG53hB4ZK2TWX7UnLeTU4ieDp8Fy4VtaYx6gKFYxGHu", | ||
"fee": 500000, | ||
"type": 6, | ||
"version": 2, | ||
"feeAssetId": null, | ||
"chainId": 87, | ||
"assetId": "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ", | ||
"amount": 85696397594 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"feeAssetId": null, | ||
"version": 2, | ||
"senderPublicKey": "", | ||
"chainId": 87, | ||
"data": [ | ||
{ | ||
"key": "%s__factoryAddress", | ||
"type": "string", | ||
"value": "3PEhMFF2mfSWVxWqbW8guXVYcNeoW77ga7T" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"feeAssetId": null, | ||
"version": 2, | ||
"senderPublicKey": "8Y62huyQ3xnFnUw2FnZPHuWMsUy1c8t343UdWrHMgsq4", | ||
"chainId": 87, | ||
"data": [ | ||
{ | ||
"key": "%s__calculatorAddress", | ||
"type": "string", | ||
"value": "3PQtGwmFsbKygGi8wPfUxz4bTUNgYodK3je" | ||
}, | ||
{ | ||
"key": "%s__lockAddress", | ||
"type": "string", | ||
"value": "3PAqCJQC1rmfWsNvqepBG4bhiFAzSHGSQkm" | ||
}, | ||
{ | ||
"key": "%s__lockDuration", | ||
"type": "integer", | ||
"value": 131487 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"feeAssetId": null, | ||
"version": 2, | ||
"senderPublicKey": "", | ||
"chainId": 87, | ||
"data": [ | ||
{ | ||
"key": "%s__factoryAddress", | ||
"type": "string", | ||
"value": "3PEhMFF2mfSWVxWqbW8guXVYcNeoW77ga7T" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": 12, | ||
"fee": 500000, | ||
"feeAssetId": null, | ||
"version": 2, | ||
"senderPublicKey": "7CCBtvKD4K6UAqDwpQKssA3WsvR2sdh1rq7CEZ5Gp5aL", | ||
"chainId": 87, | ||
"data": [ | ||
{ | ||
"key": "%s__resumptionFee", | ||
"type": "integer", | ||
"value": 500000000000 | ||
} | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.