Deploy Your ArrakisV2 Vault
Last updated
Last updated
Now we run a command to initialize a private ArrakisV2 Vault on the DAI/WETH token pair and deposit an initial 1 DAI into the vault:
Congrats! You instantiated a private ArrakisV2 vault. At the end of the script you should see the address of your newly created DAI/WETH vault:
Copy and keep this vault address and you are ready to move on.
Notice that 4 transactions were done to initialize a vault in the "private" setting:
deployVault
: called on the ArrakisV2Factory
this deploys a fresh vault instance (sets initial vault params, for instance your EOA as the vault's owner
and manager
).
setRestrictedMint
: called on the ArrakisV2
vault contract by the vault owner
this restricts who can call the vault's mint
function to a single address (your EOA), rendering the vault "private" (without this, anyone can add liquidity into your vault and mint vault shares).
approve
: called on the DAI token contract this approves 1 DAI to be transferred to the vault in the subsequent step.
mint
: called on the ArrakisV2
vault, this mints the initial ArrakisV2 shares and deposits 1 DAI (because of #2, this only works from your address).