MultiVault

deposit

Transfer 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) onlyEmergencyDisabled

Parameters:

Events emitted:

  • Deposit

saveWithdrawNative

Saves 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) onlyEmergencyDisabled

Parameters:

Events emitted:

  • Withdraw

saveWithdrawAlien

Saves withdrawal for alien token (does the necessary checks regarding token and chain, calculates fees and mints).

function saveWithdrawAlien(
        bytes memory payload,
        bytes[] memory signatures
    )
        external
        override
        nonReentrant
        withdrawalNotSeenBefore(payload)
        onlyEmergencyDisabled

Parameters:

Events emitted:

  • Withdraw

skim

Skim (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.

function skim(
        address token,
        bool skim_to_everscale
    ) external override nonReentrant onlyGovernanceOrManagement

Parameters:

Events emitted:

  • SkimFee

migrateAlienTokenToVault

Transfers specified token to specified vault.

function migrateAlienTokenToVault(
        address token,
        address vault
    ) external override onlyGovernance

Parameters:

Events emitted:

  • TokenMigrated

calculateMovementFee

Calculates fee for deposit or withdrawal.

function calculateMovementFee(
        uint256 amount,
        address _token,
        Fee fee
    ) public view returns (uint256)

Parameters:

Return value:

_activateToken

Activates specified token with all the information about it.

function _activateToken(
        address token,
        bool isNative
    ) internal

Parameters:

Events emitted:

  • TokenActivated

_transferToEverscaleNative

Emits NativeTransfer event to signify native token transfer to Everscale network.

function _transferToEverscaleNative(
        address _token,
        EverscaleAddress memory recipient,
        uint amount
    ) internal

Parameters:

Events emitted:

  • NativeTransfer

_transferToEverscaleAlien

Emits AlienTransfer event to signify alien token transfer to Everscale network.

function _transferToEverscaleAlien(
        address _token,
        EverscaleAddress memory recipient,
        uint amount
    ) internal

Parameters:

Events emitted:

  • AlienTransfer

_getNativeWithdrawalToken

Gets the native token based on provided parameters, deploys and activates it if it isn't already active.

function _getNativeWithdrawalToken(
        NativeWithdrawalParams memory withdrawal
    ) internal returns (address token)

Parameters:

_deployTokenForNative

Deploys token as native.

function _deployTokenForNative(
        EverscaleAddress memory native,
        TokenMeta memory meta
    ) internal returns (address token)

Parameters:

Return value:

Events emitted:

  • TokenCreated

_processWithdrawEvent

Process' withdraw event by verifying signatures and decoding the event and checking the event configuration.

function _processWithdrawEvent(
        bytes memory payload,
        bytes[] memory signatures,
        EverscaleAddress memory configuration
    ) internal view returns (EverscaleEvent memory)

Parameters:

Return value:

Last updated