Tenderizer uses CREATE2
to deploy contracts. Forge expects this contract to be deterministically deployed at
0x4e59b44847b379578588920ca78fbf26c0b4956c
.
Anvil by default doesn't have the CREATE2
proxy deployed. Instead, anvil_setCode
can be used as a workaround.
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","id":67,"method":"anvil_setCode","params": ["0x4e59b44847b379578588920ca78fbf26c0b4956c","0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3"]}' 127.0.0.1:8545
As a sanity check you can run cast code "0x4e59b44847b379578588920ca78fbf26c0b4956c" --rpc-url http://127.0.0.1:8545
to see if this was succesful.
The Tenderizer Factory and all associated components need to be deployed only once per network by setting the vars in
.env
and running:
source env
forge script script/Tenderize_Deploy.s.sol --broadcast --rpc-url $GOERLI_RPC_URL --verify
This script will execute following calls:
- Deploy Registry (without initialization)
- Deploy
Registry
implementation - Deploy
ERC1967
UUPS Proxy
- Deploy
- Deploy
Unlocks
- Deploy
Renderer
Implementation - Deploy
Renderer
ERC1967
UUPS Proxy - Deploy
Unlocks
contract
- Deploy
- Deploy
Tenderizer
Implementation - Initialize
Registry
withTenderizer
implementation address andUnlocks
address as arguments - Deploy
Factory
withRegistry
address as argument- Set
FACTORY_ROLE
onRegistry
forFactory
- Set
We can deploy adapters for each supported protocol on a network using:
forge script deploy/2_Adapter.s.sol --broadcast --rpc-url $GOERLI_RPC_URL --verify
- Deploy
Adapter
Implementation - Set
Adapter
address onRegistry