farcasterxyz / contracts

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

feat: contracts v3.1 #402

Closed horsefacts closed 1 year ago

horsefacts commented 1 year ago

Motivation

Ensure that fid registration and key registry adds have associated costs and limits to prevent griefing.

Design goals in priority order:

  1. Require a sufficient transaction cost at fid/key "gateways" to deter speculative ID spamming and event griefing.
  2. Enable changes to fee logic in the future.
  3. Minimize changes to existing fid/key trust assumptions.
  4. Minimize overall scope of contract changes.

Change Summary

Changes:

Audit fixes:

Refactors:

Merge Checklist

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


PR-Codex overview

Focus:

This PR focuses on updating various import paths and adding new addresses to the environment variables.

Detailed summary:

The following files were skipped due to too many changes: src/interfaces/IdRegistryLike.sol, src/lib/EIP712.sol, src/lib/Signatures.sol, test/KeyRegistry/utils/KeyRegistryHarness.sol, test/RecoveryProxy/RecoveryProxy.t.sol, src/interfaces/abstract/IGuardians.sol, test/KeyRegistry/KeyRegistryTestSuite.sol, test/KeyGateway/KeyGatewayTestSuite.sol, .github/workflows/ci.yml, src/abstract/Guardians.sol, test/IdRegistry/IdRegistryTestHelpers.sol, test/IdGateway/IdGatewayTestSuite.sol, src/interfaces/IKeyGateway.sol, test/KeyRegistry/KeyRegistry.integration.t.sol, src/RecoveryProxy.sol, test/Bundler/Bundler.gas.t.sol, test/IdRegistry/IdRegistry.gas.t.sol, test/Bundler/BundlerTestSuite.sol, .env.upgrade, src/abstract/Migration.sol, test/abstract/Guardians/Guardians.symbolic.t.sol, src/interfaces/abstract/IMigration.sol, test/IdRegistry/IdRegistryTestSuite.sol, src/KeyGateway.sol, test/abstract/Migration/Migration.symbolic.t.sol, src/libraries/EnumerableKeySet.sol, test/IdGateway/IdGateway.owner.t.sol, src/interfaces/IBundler.sol, test/IdRegistry/IdRegistry.owner.t.sol, test/IdRegistry/IdRegistry.symbolic.t.sol, test/StorageRegistry/StorageRegistry.t.sol, src/interfaces/IIdGateway.sol, src/IdGateway.sol, test/Deploy/DeployL2.t.sol, script/DeployL2.s.sol, src/Bundler.sol, script/UpgradeL2.s.sol, test/KeyRegistry/KeyRegistry.symbolic.t.sol, src/interfaces/IIdRegistry.sol, docs/docs.md, test/Deploy/UpgradeL2.t.sol, test/KeyGateway/KeyGateway.t.sol, src/interfaces/IKeyRegistry.sol, test/KeyRegistry/KeyRegistry.migration.t.sol, test/IdGateway/IdGateway.t.sol, test/IdRegistry/IdRegistry.migration.t.sol, src/IdRegistry.sol, src/KeyRegistry.sol, test/Bundler/Bundler.t.sol, test/KeyRegistry/KeyRegistry.t.sol, test/IdRegistry/IdRegistry.t.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/v3.1.0 into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Bundler.sol100%100%100%100%
   FnameResolver.sol100%100%100%100%
   IdGateway.sol100%100%100%100%
   IdRegistry.sol100%100%100%100%
   KeyGateway.sol100%100%100%100%
   KeyRegistry.sol98.56%94.44%100%100%153, 153
   RecoveryProxy.sol100%100%100%100%
   StorageRegistry.sol100%100%100%100%
src/abstract
   EIP712.sol100%100%100%100%
   Guardians.sol100%100%100%100%
   Migration.sol100%100%100%100%
   Nonces.sol100%100%100%100%
   Signatures.sol100%100%100%100%
src/validators
   SignedKeyRequestValidator.sol100%100%100%100%