Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ApyUSDDeployer

Git Source

Inherits: AccessManaged, Deployer, ERC1271Delegated, EInsufficientBalance

Title: ApyUSDDeployer

Deploys ApyUSD (implementation + proxy), initializes, deposits deployer's ApxUSD, and sends shares to beneficiary

Deploy is restricted via AccessManager. Requires deployer ApxUSD balance > 10_000e18 before deploying. Implements ERC-1271 via ERC1271Delegated so it can receive minted ApxUSD when MinterV0 supports contract beneficiaries.

State Variables

MIN_APXUSD_BALANCE

Minimum ApxUSD balance (in wei, 18 decimals) required on the deployer to call deploy()

uint256 public constant MIN_APXUSD_BALANCE = 10_000e18

name

Token name for the deployed ApyUSD (e.g. "Apyx Yield USD")

string public name

symbol

Token symbol for the deployed ApyUSD (e.g. "apyUSD")

string public symbol

asset

Underlying asset (ApxUSD) address for the deployed vault

address public asset

denyList

Deny list (AddressList) for the deployed ApyUSD

address public denyList

beneficiary

Recipient of ApyUSD shares after the initial deposit

address public beneficiary

Functions

constructor

Sets the AccessManager authority and ApyUSD init params used by deploy()

constructor(
    address _authority,
    string memory _name,
    string memory _symbol,
    address _asset,
    address _denyList,
    address _beneficiary,
    address _signer
) AccessManaged(_authority) ERC1271Delegated(_signer);

Parameters

NameTypeDescription
_authorityaddressAddress of the AccessManager contract
_namestringToken name for the deployed ApyUSD (e.g. "Apyx Yield USD")
_symbolstringToken symbol for the deployed ApyUSD (e.g. "apyUSD")
_assetaddressAddress of the ApxUSD (underlying asset) contract
_denyListaddressAddress of the AddressList (deny list) contract
_beneficiaryaddressRecipient of ApyUSD shares after the initial deposit
_signeraddress

deploy

Deploys ApyUSD, deposits deployer's ApxUSD, and sends resulting shares to beneficiary

Only callable through AccessManager (restricted). Reverts if deployer ApxUSD balance <= 10_000e18.

function deploy() external restricted returns (address proxy);

Returns

NameTypeDescription
proxyaddressThe address of the deployed ApyUSD proxy