farcasterxyz / contracts

Implementation of the Farcaster contracts
https://www.farcaster.xyz/
MIT License
340 stars 122 forks source link

chore: use ImmutableCreate2Deployer #289

Closed horsefacts closed 1 year ago

horsefacts commented 1 year ago

Motivation

We should have a single, reliable Foundry script that deploys our contracts and abstracts over deployment parameters. We should be able to test this deployment in a forked environment exactly like production.

Change Summary

Add an ImmutableCreate2Deployer base script contract that makes use of the cross-chain ImmutableCreate2Factory. Refactor existing deployment scripts to use it. Add a fork test that exercises the deploy script.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review

Additional Context

Foundry uses Arachnid's keyless CREATE2 factory by default, but there are a few advantages to using 0age's ImmutableCreate2Factory:

Close #269


PR-Codex overview

Focus of the PR:

This PR focuses on adding testnet and mainnet RPC URLs, as well as making changes to the CI workflow.

Detailed summary:

The following files were skipped due to too many changes: script/LocalDeploy.s.sol, script/lib/ImmutableCreate2Deployer.sol, script/Deploy.s.sol

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

github-actions[bot] commented 1 year ago

Coverage after merging horsefacts/update-deploy-scripts into main will be

98.69%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Bundler.sol100%100%100%100%
   FnameResolver.sol100%100%100%100%
   IdRegistry.sol100%100%100%100%
   KeyRegistry.sol100%100%100%100%
   StorageRent.sol100%100%100%100%
src/lib
   Signatures.sol100%100%100%100%
   TransferHelper.sol0%0%0%0%15, 15, 15, 25–26, 26, 26
   TrustedCaller.sol100%100%100%100%