Copy .env.sample to .env and fill it with your Etherscan API key and Ethereum private keys (can be copied from Metamask, for example). Optionally, switch from Publicnode nodes to something else, at your preference.
Then, run source .env.
After that, run forge soldeer install to obtain dependencies. And finally, run forge build to confirm that everything is ready.
This contract will store vault source code and act behind a proxy, hence it is easy to deploy it. Simply run forge script script/DeployKYCOneWayVaultImplementation.script.sol --rpc-url "$ETHEREUM_RPC_URL" --private-key "$ETHEREUM_PRIVATE_KEY" --broadcast --verify -vvvv and write down the final contract address, you will need it in the next steps.
Run OWNER="" forge script script/DeployBaseAccount.script.sol --rpc-url "$ETHEREUM_RPC_URL" --private-key "$ETHEREUM_PRIVATE_KEY" --broadcast --verify -vvvv, where:
OWNERmust be set to the address, which will become aBaseAccountadmin.
Run OWNER="" IMPLEMENTATION="" UNDERLYING_TOKEN="" DEPOSIT_ACCOUNT="" STRATEGIST="" PLATFORM="" VAULT_TOKEN_NAME="" VAULT_TOKEN_SYMBOL="" forge script script/DeployKYCOneWayVault.script.sol --rpc-url "$ETHEREUM_RPC_URL" --private-key "$ETHEREUM_PRIVATE_KEY" --broadcast --verify -vvvv, where:
OWNERmust be set to account address, which will become aKYCOneWayVaultadmin;IMPLEMENTATIONmust be set to the contract address, obtained in step 2;UNDERLYING_TOKENis token contract address used by the vault;DEPOSIT_ACCOUNTmust be set toBaseAccountaddress deployed in step 3;STRATEGISTis an account address of the strategist;PLATFORMis an account address of the platform fees recipient;VAULT_TOKEN_NAMEis an ERC20 token name for the vault token;VAULT_TOKEN_SYMBOLis an ERC20 token symbol for the vault token.
Optionally, you might specify the following environment variables, too:
STRATEGIST_RATIO_BPSis the share of strategist's fees measured in BPS (default: 0);DEPOSIT_FEE_BPSis a fee charged on deposit (default: 0);WITHDRAW_FEE_BPSis a fee charged on withdraw (default: 0);MAX_RATE_INCREMENT_BPSis a maximum allowed relative increase of the redemption rate per update (default: 10000 or 100%);MAX_RATE_DECREMENT_BPSis a maximum allowed relative decrease of the redemption rate per update (default: 5000 or 50%);MIN_RATE_UPDATE_DELAYis a minimum wait interval between updating the redemption rate (default: 0 seconds);MAX_RATE_UPDATE_DELAYis a threshold, which is triggered when redemption rate wasn't updated for too long, and automatically pauses the vault (default: 86400 seconds or 1 day);DEPOSIT_CAPis a limit of assets to be deposited (default: 0 or unlimited);STARTING_RATEis a starting exchange rate (default is calculated on underlying token's decimals and is equal 1.0).
Run cast send "VAULT" "updateZkMeConfig(address,address)" "ZK_ME" "COOPERATOR" --rpc-url "$ETHEREUM_RPC_URL" --private-key "$ETHEREUM_PRIVATE_KEY" -vvvv, where:
VAULTmust be set to contract address, obtained in step 4;ZK_MEis an address of ZkMe contract;COOPERATORis a cooperator address provided by ZkMe.