Tip3ToEver
The Tip3ToEver smart contract defines the logic for swapping Tip3 To Ever.
Last updated
The Tip3ToEver smart contract defines the logic for swapping Tip3 To Ever.
Last updated
Smart contract responsible for swapping Tip3 token to Ever.
Derives following classes and interfaces: IAcceptTokensTransferCallback, IAcceptTokensBurnCallback, IEverTip3SwapEvents.
constructor
Deploy empty wallet.
buildExchangePayload
Build payload constructor for exchanging TIP 3 to EVER, store values from function params to TVMBuilder
instance.
Parameters:
Name | Type | Description |
---|---|---|
onWeverWallet
Callback deploy for weverWallet
.
Parameters:
onAcceptTokensTransfer
Callback for swap. If operationStatus is SWAP and value is greater than SWAP_TIP3_TO_EVER_MIN_VALUE
, build success, cancel and resultPayload
and transfer from Tip3ToEver
wallet to the pair’s wallet.
If operationStatus is CANCEL emit SwapTip3EverCancelTransfer
event and call OnSwapTip3ToEverCancel
callback and transfer the amount back to the user, if SUCCESS and msg sender is weverWallet
, transfer the amount to weverVault wallet.
Else if needCancel var is true transfer value back to the sender
Parameters:
onAcceptTokensBurn
Callback for burn if the swap succeeded, emits SwapTip3EverSuccessTransfer
event and call callback onSwapTip3ToEverSuccess
.
Parameters:
SwapTip3EverSuccessTransfer
Emitted inside onAcceptTokensTransfer
callback when Tip3 tokens are successfully swapped to EVERs.
SwapTip3EverCancelTransfer
Emitted inside onAcceptTokensTransfer
callback when swap is canceled.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
id
uint64
Id of the operation call
pair
address
Address of the exchange pair
expectedAmount
uint128
Expected amount of tokens after exchange
_weverWallet
address
Address of the WEVER wallet
tokenRoot
address
Address of token root
amount
uint128
Amount of tokens to transfer
sender
address
Address of tokens sender
senderWallet
address
Tokens sender’s wallet address
user
address
User’s address for receiving EVER tokens
payload
TvmCell
Transfer payload data
amount
uint128
Amount of tokens to burn (optional)
walletOwner
address
Address of wallet owner
wallet
address
Wallet address
user
address
User’s address that canceled exchange
payload
TvmCell
Burn tokens payload data