The EverWeverToTip3 defines the logic for swapping EVERs in combination with WEVERs to Tip3 tokens.
Smart contract responsible for swapping EVERs in combination with WEVERs to Tip3 tokens.
Derives following classes and interfaces: IAcceptTokensTransferCallback, IAcceptTokensBurnCallback.
Deploy EverToTip3Gas empty wallet.
function buildExchangePayload(uint64 id, uint128 amount, address pair, uint128 expectedAmount, uint128 deployWalletValue) external pure returns (TvmCell)
Builds payload by filling the TVM builder instance with data derived from function params, returns builder converted to cell.
function onWeverWallet(address _weverWallet) external
Deploys Wever wallet for the contract using
_weverWalletaddress from the function params.
function onAcceptTokensTransfer(address /*tokenRoot*/, uint128 amount, address /*sender*/, address /*senderWallet*/, address user, TvmCell payload) override external
Callback if swap between ever and tip 3 is successful. Calls
onSwapEverToTip3Successcallback to the user,
SwapEverToTip3SuccessTransferevent is emitted and tip 3 tokens are sent to a user wallet by calling
TokenWallet’s transfer method. If conditions are not fulfilled swap is canceled and tokens are returned to sender’s wallet.
function onAcceptTokensBurn( uint128 /*amount*/, address /*walletOwner*/, address /*wallet*/, address user, TvmCell payload) override external
If result of swap was canceled call this callback, it emits
SwapEverToTip3CancelTransferevent and calls
SwapEverWeverToTip3Unwrap(address user, uint64 id);