Deploy the ERC-6551 Registry
The ERC-6551 Registry contract has already been deployed across several EVM networks. A list of deployed addresses can be found here.
Install Foundry
$ curl -L https://foundry.paradigm.xyz | bash
$ foundryup
Clone the Reference repository
$ git clone https://github.com/erc6551/reference.git
$ git checkout tags/v0.3.1
Run the tests and build the contracts
$ forge test
$ forge build
Compute the Registry address
This is to make sure it matches with 0x000000006551c19487814612e58FE06813775758
$ forge script script/ComputeRegistryAddress.s.sol:ComputeRegistryAddress
The output should be:
[⠒] Compiling... No files changed, compilation skipped Script ran successfully. Gas
used: 24925
== Logs ==
0x000000006551c19487814612e58FE06813775758
Deploy the Registry
Before we can deploy we need to provide MAINNET_PRIVATE_KEY
env variable - set this to your test account’s private key
$ forge script --fork-url <RPC_URL> script/DeployRegistry.s.sol --broadcast
Replace <RPC_URL>
with your chain's RPC endpoint