How to deploy to vanity address using zer00s and foundry
1. Write and compile your contract with forge build.
2. Buy a B00Bs vanity address and transfer and/or approve your deployment wallet to spend it.
3. Call the b00bs contract as part of your deployment invoking it with deploy(uint256 id, bytes calldata initcode)
• set id to be the full vanity address token ID
• set initcode to be your creation code, in your foundry script that
requires importing the contract to deploy and getting with type(ContractName).creationCode
• if you have constructor arguments, encode them together into the initcode with: abi.encodePacked(type(ContractName).creationCode, abi.encode(arg1, arg2, arg3, ...))
How to use on L2s
Go to the
Manage section, select the address you want to use on an L2 and click
Claim. You can then deploy your contract the same way as described above.
More L2s coming soon.