Overview of Everscale to EVM Transfer Mechanics
Locking or Burning the Target Tokens Based on Their Type:
- If the target token is a Native token, it will be locked on Everscale.
- If it is an Alien token, it will be burned.
Event Contract Deployment and Confirmation:
- The event contract is deployed on Everscale through a previous transaction.
- After a few seconds, relayers confirm the event contract by voting on it.
Releasing or Minting Tokens on the EVM Network:
3.1 Paying Gas Fees for an EVM Network with EVER:
In this case, the process of token release or minting on the EVM network is automated.
- The Credit Modules will call the relevant function on the MultiVault contract. After that the MultiVault contract handles the minting or releasing the token based on its type.
3.2 Paying Gas Fees for an EVM Network with an EVM Gas Token:
In this case, the process of token release or minting on the EVM network is done manually.
- For Native tokens, call the
saveWithdrawNative
function to mint tokens. - For Alien tokens, call the
saveWithdrawAlien
function to release tokens. “Locking or Burning Target Tokens Based on Their Type:
TIP
Note that these functions must be called on the
MultiVault
contract.At this point, the desired amount of target tokens must be deposited to the recipient EVM address.
Step-by-Step Guide: Everscale to EVM Transfer
Native Coin transfer
- 1 - Call the
wrap
function on theWEVERVault
contract and mint WEVER tokens :
Function
function wrap(
uint128 tokens,
address owner_address,
address gas_back_address,
TvmCell payload
) external;
Details
Parameters
Param | Description |
---|---|
tokens | Amount of the token |
owner_address | Compounder address |
gas_back_address | Address to send the change back |
payload | Operational payload, see wrap payload. |
NOTE : gas_back_address will be the user's address if the EVM network fees are paid with its gas token and will be EventCloser if it is paid with EVER.
Example Transactions
WARNING
The next step is only necessary if EVM network fees are paid with its gas token.
- 2 - Mint
WEVER
tokens in the EVM network by calling thesaveWithdrawNative
function on theMultiVault
contract :
Function
function saveWithdrawNative(
bytes memory payload,
bytes[] memory signatures
) external;
Details
Parameters
Param | Description |
---|---|
payload | Operational payload, see payload. |
signatures | Relayers signatures see signatures. |
Example Transactions
Native Token Transfer
1 - Transfer the tokens to the ProxyMultiVaultNativeV-4
's TokenWallet
contract by calling the transfer
function on your TokenWallet
contract :
Function
function transfer(
uint128 amount,
address recipient,
uint128 deployWalletValue,
address remainingGasTo,
bool notify,
TvmCell payload
) external;
Details
Parameters
Param | Description |
---|---|
amount | Amount of the token |
recipient | Recipient address which is proxyMultivaultNativeV_4 address |
deployWalletValue | Token Wallet deploy value if not deployed before |
remainingGasTo | Address to send the change back |
notify | Notify receiver on incoming transfer |
payload | Operational payload, see transfer payload. |
NOTE : remainingGasTo will be the user's address if the EVM network fees are paid with its gas token and will be EventCloser if it is paid with EVER.
Example Transactions
WARNING
The next step is only necessary if EVM network fees are paid with its gas token.
- 2 - Mint the tokens in the EVM network by calling the
saveWithdrawNative
function on theMultiVault
contract:
Function
function saveWithdrawNative(
bytes memory payload,
bytes[] memory signatures
) external;
Details
Parameters
Param | Description |
---|---|
payload | Operational payload, see payload. |
signatures | Relayers signatures see signatures. |
Example Transactions
Alien Token Transfer
1 - Burn the tokens on Everscale network by calling the `burn` function on your `tokenWallet` contract :
Function
function burn(
uint128 amount,
address remainingGasTo,
address callbackTo,
TvmCell payload
) external;
Details
Parameters
Param | Description |
---|---|
amount | Amount of the target token token |
callBackTo | Callback Receiver contract which is MergePoolV_4 in this case |
remainingGasTo | Address to send the change back |
payload | Operational payload, see burn payload. |
NOTE : remainingGasTo will be the user's address if the EVM network fees are paid with its gas token and will be EventCloser if it is paid with EVER.
Example Transactions
WARNING
The next step is only necessary if EVM network fees are paid with its gas token.
- 2 - Release the tokens in the EVM network by calling the
saveWithdrawAlien
function on theMultiVault
contract:
Function
function saveWithdrawAlien(
bytes memory payload,
bytes[] memory signatures
) external;
Details
Parameters
Param | Description |
---|---|
payload | Operational payload, see payload. |
signatures | Relayers signatures see signatures. |
Example Transactions
EVM Gas Token Transfer
1 - Burn the tokens on Everscale network by calling the burn
function on your tokenWallet
contract :
Function
function burn(
uint128 amount,
address remainingGasTo,
address callbackTo,
TvmCell payload
) external;
Details
Parameters
Param | Description |
---|---|
amount | Amount of the token |
callBackTo | Callback Receiver contract.ProxyMultiVaultAlienV_7 in this case |
remainingGasTo | Address to send the change back |
payload | Operational payload, see burn payload. |
NOTE : remainingGasTo will be the user's address if the EVM network fees are paid with its gas token and will be EventCloser if it is paid with EVER.
Example Transactions
WARNING
The next step is only necessary if EVM network fees are paid with its gas token.
- 2 - Release the tokens in EVM network by calling the
saveWithdrawAlien
function on theMultiVault
contract:
Function
function saveWithdrawAlien(
bytes memory payload,
bytes[] memory signatures
) external;
Details
Parameters
Param | Description |
---|---|
payload | Operational payload, see payload. |
signatures | Relayers signatures see signatures. |
Example Transactions
Interactive code samples related to examples above can be found here
The addresses of all the referenced contracts and tokens can be found at Links.