AmphorSyntheticVaultWithPermit

Solidity version

0.8.21

Inheritance



State Variables

PermitParams

struct PermitParams {
    uint256 value;
    uint256 deadline;
    uint8 v;
    bytes32 r;
    bytes32 s;
}

The 'struct' PermitParams is used to pass the permit signature and data.

NameTypeDescription

value

uint256

The amount of tokens the spender is allowed to spend.

deadline

uint256

The timestamp after which the permit is no longer valid.

v

uint8

The recovery byte of the permit signature.

r

bytes32

Half of the ECDSA signature pair of the permit.

s

bytes32

Half of the ECDSA signature pair of the permit.


Functions

depositWithPermit

function depositWithPermit(
    uint256 assetsAmount,
    address receiver,
    PermitParams calldata permitParams
) external returns (uint256)

The depositWithPermit function is used to deposit underlying assets into the vault with a permit for approval.

NameTypeDescription

assetsAmount

uint256

The amount of underlying assets amount to be converted into shares (LP tokens).

receiver

address

The address of the shares (LP tokens) receiver.

permitParams

PermitParams calldata

The permit struct containing the permit signature and data.

depositWithPermitMinShares

function depositWithPermitMinShares(
    uint256 assets,
    address receiver,
    uint256 minShares,
    PermitParams calldata permitParams
) external returns (uint256)

The depositWithPermitMinShares function is used to deposit underlying assets into the vault using a permit for approval.

NameTypeDescription

assets

uint256

The underlying assets amount to be converted into shares.

receiver

address

The address of the shares receiver.

minShares

uint256

The minimum amount of shares to be received in exchange of the specified underlying assets amount.

permitParams

PermitParams calldata

The v component of the signature.

mintWithPermitMaxAssets

function mintWithPermitMaxAssets(
    uint256 shares,
    address receiver,
    uint256 maxAssets,
    PermitParams calldata permitParams
) external returns (uint256)

The mintWithPermit function is used to mint the specified shares amount in exchange of the corresponding underlying assets amount from _msgSender() using a permit for approval.

NameTypeDescription

shares

uint256

The amount of shares to be converted into underlying assets.

receiver

address

The address of the shares receiver.

maxAssets

uint256

The maximum amount of underlying assets to be deposited in exchange of the specified shares amount.

permitParams

PermitParams calldata

The permit struct containing the permit signature and data.

mintWithPermit

function mintWithPermit(
    uint256 shares,
    address receiver,
    uint256 maxAssets,
    PermitParams calldata permitParams
) external returns (uint256)

The mintWithPermit function is used to mint the specified number of shares (LP tokens) in exchange for the corresponding amount of underlying assets from _msgSender() using a permit for approval.

NameTypeDescription

shares

uint256

The number of shares (LP tokens) to be converted into underlying assets

receiver

address

The address of the shares (LP tokens) receiver.

maxAssets

uint256

The maximum amount of underlying assets to be deposited in exchange for the specified number of shares (LP tokens).

permitParams

PermitParams calldata

The permit struct containing the permit signature and data.

Last updated