MultiVault
deposit
depositTransfer tokens to the Everscale. Works both for native and alien tokens. Approve is required only for alien tokens deposit.
function deposit(
EverscaleAddress memory recipient,
address token,
uint amount
) external override nonReentrant
tokenNotBlacklisted(token)
initializeToken(token) onlyEmergencyDisabledParameters:
recipient
EverscaleAddress memory
Everscale recipient
token
address
EVM token address
amount
uint
Amount of tokens to transfer
Events emitted:
Deposit
saveWithdrawNative
saveWithdrawNativeSaves withdrawal for native token (does the necessary checks regarding token and chain, calculates fees and mints).
function saveWithdrawNative(
bytes memory payload,
bytes[] memory signatures
) external override nonReentrant
withdrawalNotSeenBefore(payload) onlyEmergencyDisabledParameters:
payload
bytes memory
Withdraw payload
signatures
bytes[] memory
List of signatures
Events emitted:
Withdraw
saveWithdrawAlien
saveWithdrawAlienSaves withdrawal for alien token (does the necessary checks regarding token and chain, calculates fees and mints).
Parameters:
payload
bytes memory
Withdraw payload (later processed to EverscaleEvent)
signatures
bytes[] memory
List of signatures
Events emitted:
Withdraw
skim
skimSkim (removes) multivault fees for specific token. If skim_to_everscale is true, than fees will be sent to Everscale. Otherwise, tokens will be transferred to the governance address.
Parameters:
token
address
Token address, can be both native or alien
skim_to_everscale
bool
Are skim fees applicable on Everscale or not
Events emitted:
SkimFee
migrateAlienTokenToVault
migrateAlienTokenToVaultTransfers specified token to specified vault.
Parameters:
token
address
Address of alien token
vault
address
Vault address where to migrate alien token
Events emitted:
TokenMigrated
calculateMovementFee
calculateMovementFeeCalculates fee for deposit or withdrawal.
Parameters:
amount
uint256
Amount of tokens to deposit/withdraw
_token
address
Token address
fee
Fee
Fee type (Deposit=0, Withdraw=1)
Return value:
uint256
Fee for deposit/withdrawal
_activateToken
_activateTokenActivates specified token with all the information about it.
Parameters:
token
address
Token address
isNative
bool
True if native, false if not
Events emitted:
TokenActivated
_transferToEverscaleNative
_transferToEverscaleNativeEmits NativeTransfer event to signify native token transfer to Everscale network.
Parameters:
_token
address
Native token address
recipient
EverscaleAddress memory
Everscale recipient data
amount
uint
Amount of tokens to transfer
Events emitted:
NativeTransfer
_transferToEverscaleAlien
_transferToEverscaleAlienEmits AlienTransfer event to signify alien token transfer to Everscale network.
Parameters:
_token
address
Alien token address
recipient
EverscaleAddress memory
Everscale recipient data
amount
uint
Amount of tokens to transfer
Events emitted:
AlienTransfer
_getNativeWithdrawalToken
_getNativeWithdrawalTokenGets the native token based on provided parameters, deploys and activates it if it isn't already active.
Parameters:
withdrawal
NativeWithdrawalParams memory
Native withdrawal token data (includes workchain id, addressโฆ)
_deployTokenForNative
_deployTokenForNativeDeploys token as native.
Parameters:
native
EverscaleAddress memory
Everscale address data
meta
TokenMeta memory
Meta data of token to be deployed
Return value:
token
address
Address of deployed token
Events emitted:
TokenCreated
_processWithdrawEvent
_processWithdrawEventProcess' withdraw event by verifying signatures and decoding the event and checking the event configuration.
Parameters:
payload
bytes memory
EverscaleEvent data encoded to bytes
signatures
bytes[] memory
List of signatures
configuration
EverscaleAddress memory
Everscale address data needed for required checks
Return value:
EverscaleEvent
New withdraw EverscaleEvent
Last updated
Was this helpful?