FlatQube
▶️ App🔩 Sources💬 Community🔒 Audit
  • Welcome to FlatQube
  • 👨‍💻Use
    • Getting started
      • How it works
      • Roles
      • How to connect a wallet
      • Glossary
      • Everscale
      • How to get EVER
    • Swap
      • Interface
        • Basic swap
      • How to
        • Make a basic swap
        • Use limit trading
        • Configure slippage tolerance
        • Use cross-exchange
      • Concepts
        • Limit orders
        • Slippage tolerance
        • Fees
        • Price impact
        • Cross-exchange
    • Tokens
      • Interface
        • All tokens
        • Token page
          • Price
          • TVL
          • Trading volume
          • Pairs
          • Transactions
          • Open in explorer
      • How to
        • Upgrade token(s)
        • Add custom token
      • Concepts
        • Tokens we use
        • EVER and wEVER
        • Token lists
    • Pools
      • Interface
        • All pools
        • Pool page
      • How to
        • Connect DEX account
        • Add liquidity (Get LP tokens) / Withdraw liquidity
        • Create a new pool
        • Calculate the amount of LP tokens
      • Pool economics
    • Farming
      • New farming
        • Interface
          • Farming pools
          • Farming page (user)
            • Farming performance and deposits
            • Statistics
            • Farming speed and vesting
            • Transactions
          • Farm page (administrator)
        • How to
          • Claim reward
          • Deposit/Withdraw farm tokens
          • Get a boost
          • Create and manage your farming pool
      • Old farming
        • Interface
          • Farming pools
          • Farm page (user)
            • Farming perfomance and balances
            • Statistics
            • Farming speed
            • Farm information
            • Transactions
          • Farm page (administrator)
        • How to
          • Claim reward
          • Deposit farm tokens
          • Withdraw farm tokens
          • See farming performance
          • Find my transactions
      • Concepts
        • Yield farming
        • Reward distribution
        • Vesting
        • Farming token
        • Boosted farming
        • Pool share
    • DAO
      • Interface
        • DAO page
        • DAO balance
        • Epoch
      • How to
        • Lock tokens
        • Vote in Epoch
        • Get a boost
        • Become a candidate
      • Concept
        • DAO
        • veQUBE
        • Epoch
        • Boosted farming
        • FAQ
    • Token builder
      • Interface
        • Explorer
        • Token page
      • How to
        • Create new token
        • Mint tokens
        • Burn tokens
        • Transfer ownership
  • ⚒️Integrate
    • Open API
      • FlatQube DEX Indexer
        • CMC API
        • Currencies API
        • Pairs API
        • Transactions API
      • FlatQube Farming Indexer
        • Farming pools API
        • Transactions API
        • Graphics API
    • Smart contracts
      • DexAccount
      • DexPair
      • DexPlatform
      • DexRoot
      • DexVault
      • DexVaultLpTokenPending
      • EverToTip3
      • EverWeverToTip3
      • Tip3ToEver
      • TokenFactory
  • ↗️See also
    • EVER Wallet
    • Octus Bridge
    • Platform products
    • Broxus Github
Powered by GitBook
On this page
  • constructor
  • buildExchangePayload
  • Callbacks
  • onWeverWallet
  • onAcceptTokensTransfer
  • onAcceptTokensBurn
  • Key Events
  • SwapEverWeverToTip3Unwrap

Was this helpful?

  1. Integrate
  2. Smart contracts

EverWeverToTip3

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.

constructor

constructor() public

Deploy EverToTip3Gas empty wallet.

buildExchangePayload

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.

Parameters:

Name
Type
Description

id

uint64

Operation id

amount

uint128

Amount of tokens to exchange

pair

address

Address of the exchange pair

expectedAmount

uint128

Expected amount of tokens after exchange

deployWalletValue

uint128

Deploy value

Return Value:

Type
Description

TvmCell

Exchange payload in cell format

Callbacks

onWeverWallet

function onWeverWallet(address _weverWallet) external

Deploys Wever wallet for the contract using _weverWallet address from the function params.

Parameters:

Name
Type
Description

_weverWallet

address

Address used to initialize wever wallet

onAcceptTokensTransfer

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 onSwapEverToTip3Success callback to the user, SwapEverToTip3SuccessTransfer event 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.

Parameters:

Name
Type
Description

tokenRoot

address

Address of token root (optional)

amount

uint128

Amount of tokens to transfer

sender

address

Address of tokens sender (optional)

senderWallet

address

Tokens sender’s wallet address (optional)

user

address

User’s address for receiving tip3 tokens

payload

TvmCell

Transfer payload data

onAcceptTokensBurn

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 SwapEverToTip3CancelTransfer event and calls onSwapEversToTip3Cancel callback.

Parameters:

Name
Type
Description

amount

uint128

Amount of tokens to burn (optional)

walletOwner

address

Address of wallet owner (optional)

wallet

address

Wallet address (optional)

user

address

User’s address that canceled exchange

payload

TvmCell

Burn tokens payload data

Key Events

SwapEverWeverToTip3Unwrap

SwapEverWeverToTip3Unwrap(address user, uint64 id);
PreviousEverToTip3NextTip3ToEver

Last updated 2 years ago

Was this helpful?

⚒️