VaultZapper

VaultZapper

Git Source

Inherits: Ownable2Step, Pausable

State Variables

authorizedVaults

The authorizedVaults mapping is used to check if a vault is authorized to interact with the VaultZapper contract.

The SafeERC20 lib is only used for safeTransfer, safeTransferFrom and forceApprove operations.

The Address lib is only used for sendValue operations.

mapping(IERC4626 vault => bool isAuthorized) public authorizedVaults;

authorizedRouters

The authorizedRouters mapping is used to check if a router is authorized to interact with the VaultZapper contract.

mapping(address routerAddress => bool isAuthorized) public authorizedRouters;

Functions

onlyAllowedRouter

The onlyAllowedRouter modifier is used to check if a router is authorized to interact with the VaultZapper contract.

onlyAllowedVault

The onlyAllowedVault modifier is used to check if a vault is authorized to interact with the VaultZapper contract.

constructor

withdrawToken

The withdrawToken function is used to withdraw tokens from the VaultZapper contract.

withdrawNativeToken

The withdrawNativeToken function is used to withdraw native tokens from the VaultZapper contract.

pause

The pause function is used to pause the VaultZapper contract.

unpause

The unpause function is used to unpause the VaultZapper contract.

approveTokenForRouter

The approveTokenForRouter function is used to approve a token for a router.

toggleRouterAuthorization

The toggleRouterAuthorization function is used to toggle the authorization of a router.

toggleVaultAuthorization

The toggleVaultAuthorization function is used to toggle the authorization of a vault.

_zapIn

The _zapIn function is used to zap in assets into a vault.

_transferTokenInAndApprove

The _transferTokenInAndApprove function is used to transfer tokens into the VaultZapper contract and approve them for a router.

zapAndDeposit

The zapAndDeposit function is used to zap in and deposit assets into a vault.

zapAndRequestDeposit

The zapAndRequestDeposit function is used to zap in and request a deposit of assets into a vault.

zapAndClaimAndRequestDeposit

The zapAndClaimAndRequestDeposit function is used to zap in, claim and request a deposit of assets into a vault.

zapAndDepositWithPermit

The zapAndDepositWithPermit function is used to zap in and deposit assets into a vault with a permit.

zapAndRequestDepositWithPermit

The zapAndRequestDepositWithPermit function is used to zap in and request a deposit of assets into a vault with a permit.

zapAndClaimAndRequestDepositWithPermit

The zapAndClaimAndRequestDepositWithPermit function is used to zap in, claim and request a deposit of assets into a vault with a permit.

_executeZap

The _executeZap function is used to execute a zap.

_executePermit

The _executePermit function is used to execute a permit.

Events

ZapAndRequestDeposit

The ZapAndDeposit event is emitted when a user zaps in and deposits assets into a vault.

ZapAndDeposit

The ZapAndDeposit event is emitted when a user zaps in and deposits assets into a vault.

ClaimRedeemAndZap

The ClaimRedeemAndZap event is emitted when a user claims, redeems and zaps assets into a vault.

RouterApproved

The RouterApproved event is emitted when a router is approved to interact with a token.

RouterAuthorized

The RouterAuthorized event is emitted when a router is authorized to interact with the VaultZapper contract.

VaultAuthorized

The VaultAuthorized event is emitted when a vault is authorized to interact with the VaultZapper contract.

Errors

NotRouter

The NotRouter error is emitted when a router is not authorized to interact with the VaultZapper contract.

NotVault

The NotVault error is emitted when a vault is not authorized to interact with the VaultZapper contract.

SwapFailed

The SwapFailed error is emitted when a swap fails.

InconsistantSwapData

The InconsistantSwapData error is emitted when the swap data is inconsistant.

NotEnoughSharesMinted

The NotEnoughSharesMinted error is emitted when the amount of shares minted is not enough.

NotEnoughUnderlying

The NotEnoughUnderlying error is emitted when the amount of underlying assets is not enough.

NullMinShares

The NullMinShares error is emitted when the minimum amount of shares to mint is null.

Last updated