Skip to content

Commit

Permalink
deploy OP, Zora, eth mainnet, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsoncusack committed May 3, 2024
1 parent 68ad7c5 commit a69feac
Show file tree
Hide file tree
Showing 11 changed files with 647 additions and 9 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deploy :; source .env && export FOUNDRY_PROFILE=deploy && forge script script/DeployFactory.s.sol --rpc-url $${RPC_URL} --account fd89 --broadcast --verify
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ forge test
## Deploying
To deploy on a new chain, in your `.env` set
```bash
FOUNDRY_PROFILE=deploy
#`cast wallet` name
ACCOUNT=
# Node RPC URL
RPC_URL=
# Optional Etherscan API key for contract verification
ETHERSCAN_API_KEY=
```
See [here](https://book.getfoundry.sh/reference/cast/cast-wallet-import) for more details on `cast wallet`.

Then run
```
forge script script/DeployFactory.s.sol --rpc-url https://...
make deploy
```

As written, the script uses a private key that is loaded from env (`PRIVATE_KEY`). However the deployer can configure the deploy key as they wish, see [here](https://book.getfoundry.sh/reference/forge/forge-script?highlight=script#wallet-options---keystore).

## Influences
Much of the code in this repository started from Solady's [ERC4337](https://github.com/Vectorized/solady/blob/main/src/accounts/ERC4337.sol) implementation. We were also influenced by [DaimoAccount](https://github.com/daimo-eth/daimo/blob/master/packages/contract/src/DaimoAccount.sol), which pioneered using passkey signers on ERC-4337 accounts, and [LightAccount](https://github.com/alchemyplatform/light-account).
61 changes: 61 additions & 0 deletions broadcast/DeployFactory.s.sol/1/run-1714757847.json

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions broadcast/DeployFactory.s.sol/1/run-latest.json

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions broadcast/DeployFactory.s.sol/10/run-1714743977.json

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions broadcast/DeployFactory.s.sol/10/run-1714744077.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions broadcast/DeployFactory.s.sol/10/run-latest.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions broadcast/DeployFactory.s.sol/7777777/run-1714757746.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions broadcast/DeployFactory.s.sol/7777777/run-latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/safe-singleton-deployer-sol
4 changes: 0 additions & 4 deletions script/DeployFactory.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ contract DeployFactoryScript is Script {

function run() public {
console2.log("Deploying on chain ID", block.chainid);
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address implementation = SafeSingletonDeployer.broadcastDeploy({
deployerPrivateKey: deployerPrivateKey,
creationCode: type(CoinbaseSmartWallet).creationCode,
args: "",
salt: 0x3438ae5ce1ff7750c1e09c4b28e2a04525da412f91561eb5b57729977f591fbb
});
console2.log("implementation", implementation);
assert(implementation == EXPECTED_IMPLEMENTATION);
address factory = SafeSingletonDeployer.broadcastDeploy({
deployerPrivateKey: deployerPrivateKey,
creationCode: type(CoinbaseSmartWalletFactory).creationCode,
args: abi.encode(implementation),
salt: 0x278d06dab87f67bb2d83470a70c8975a2c99872f290058fb43bcc47da5f0390c
Expand Down

0 comments on commit a69feac

Please sign in to comment.