-
Notifications
You must be signed in to change notification settings - Fork 47
Deployments
The contracts can be deployed with the deployment scripts available in the script
directory. To run the scripts, you need to have your environment variables correctly set up, as explained in the
CONTRIBUTING guide.
The examples below deploy to the Goerli testnet, but you can pick any other chain defined under the [rpc_endpoints]
section in foundry.toml
.
To deploy to a local development chain, you can spin up an instance of Anvil.
The contracts are deployed to production with
--via-ir
enabled.
Using the Via IR compilation pipeline enables a host of powerful optimizations, albeit at the expense of significantly slower compilation times, which can hinder local development efficiency. However, it is crucial to test our contracts against this optimized version, as this is what end users will ultimately interact with.
In order to strike a balance, we have come up with a setup that allows for efficient development and testing on local machines, while still ensuring compatibility with the IR-enabled version. Our approach involves building and testing the contracts normally on local machines, while leveraging the CI environment to build and test the IR-enabled contracts. This ensures rapid development and testing while providing confidence that the contracts function as intended when deployed (with tests passing both with and without IR enabled).
FOUNDRY_PROFILE=optimized \
forge script script/DeployComptroller.s.sol \
--broadcast \
--rpc-url goerli \
--sig "run(address)" \
--verify \
ADMIN_ADDRESS
You should replace the placeholders with the actual arguments you want to pass.
FOUNDRY_PROFILE=optimized \
forge script script/DeployLockupDynamic.s.sol \
--broadcast \
--rpc-url goerli \
--sig "run(address,address,address,uint256)" \
--verify \
ADMIN_ADDRESS \
COMPTROLLER_ADDRESS \
NFT_DESCRIPTOR_ADDRESS \
MAX_SEGMENT_COUNT
You should replace the placeholders with the actual arguments you want to pass.
FOUNDRY_PROFILE=optimized \
forge script script/DeployLockupLinear.s.sol \
--broadcast \
--rpc-url goerli \
--sig "run(address,address,address)" \
--verify \
ADMIN_ADDRESS \
COMPTROLLER_ADDRESS \
NFT_DESCRIPTOR_ADDRESS
FOUNDRY_PROFILE=optimized \
forge script script/DeployCore.s.sol \
--broadcast \
--rpc-url goerli \
--sig "run(address,address,uint256)" \
--verify \
ADMIN_ADDRESS \
NFT_DESCRIPTOR_ADDRESS \
MAX_SEGMENT_COUNT