Deploy Your ArrakisV2 Vault
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.
What Does This Script Do?
Notice that 4 transactions were done to initialize a vault in the "private" setting:
deployVault
: called on theArrakisV2Factory
this deploys a fresh vault instance (sets initial vault params, for instance your EOA as the vault'sowner
andmanager
).setRestrictedMint
: called on theArrakisV2
vault contract by the vaultowner
this restricts who can call the vault'smint
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 theArrakisV2
vault, this mints the initial ArrakisV2 shares and deposits 1 DAI (because of #2, this only works from your address).
Last updated