FM_DepositVault_v1

Git Source

Inherits: IFundingManager_v1, IFM_DepositVault_v1, Module_v1

Author: Inverter Network

This contract allows users to deposit tokens to fund the workflow.

Implements {IFundingManager_v1} interface.

State Variables

BPS

Base Points used for percentage calculation. This value represents 100%.

uint internal constant BPS = 10_000;

_token

The token that is deposited.

IERC20 private _token;

__gap

Storage gap for future upgrades.

uint[50] private __gap;

Public Functions

supportsInterface

See {IERC165-supportsInterface}.

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(Module_v1)
    returns (bool);

init

function init(
    IOrchestrator_v1 orchestrator_,
    Metadata memory metadata,
    bytes memory configData
) external override initializer;

token

Returns the token.

function token() public view returns (IERC20);

Returns

Name
Type
Description

<none>

IERC20

The token.

deposit

Deposits a specified amount of tokens into the contract from the sender's account.

When using the {TransactionForwarder_v1}, validate transaction success to prevent nonce exploitation and ensure transaction integrity.

function deposit(uint amount) external;

Parameters

Name
Type
Description

amount

uint256

The number of tokens to deposit.

transferOrchestratorToken

Transfer a specified amount of Tokens to a designated receiver address.

This function MUST be restricted to be called only by the {Orchestrator_v1}.

function transferOrchestratorToken(address to, uint amount)
    external
    onlyPaymentClient
    validAddress(to);

Parameters

Name
Type
Description

to

address

The address that will receive the tokens.

amount

uint256

The amount of tokens to be transfered.

Internal Functions

_processProtocolFeeViaTransfer

Transfer protocol fees to the treasury.

function _processProtocolFeeViaTransfer(
    address treasury_,
    IERC20 token_,
    uint feeAmount_
) internal;

Parameters

Name
Type
Description

treasury_

address

The address of the protocol treasury.

token_

IERC20

The token to transfer the fees from.

feeAmount_

uint256

The amount of fees to transfer.

_validateRecipient

Validates the recipient address.

function _validateRecipient(address _receiver) internal view;

Last updated