Add EVM Asset Compliance Example#63
Conversation
5904332 to
5be6dba
Compare
Reference tokens that enforce compliance on-chain and that Predicate can drive automatically by freezing flagged addresses: - FreezableStablecoin: upgradeable ERC-20 on the Freezable base (implements IFreezable), with EIP-2612 permit, pause, role-gated mint/burn, and a forced-transfer seize. Freeze is enforced in _update. Includes deploy and grant-role scripts and a test suite. - FreezableToken: trimmed to a minimal IFreezable example. - docs/asset-compliance.md: overview, role model, and a compatibility matrix. The freeze role granted to Predicate is scoped to freeze/unfreeze only; seize, mint, burn, pause, and upgrade stay with the issuer (enforced by tests).
5be6dba to
7fd1cfa
Compare
The defined roles and their holders are ultimately the issuer's choice. Present least-privilege RBAC with separation of duties as the recommended industry-standard pattern, add a dedicated freeze-manager-role section scoping FREEZE_MANAGER_ROLE, and make the role table a recommendation.
Remove third-party token name-drops, tighten to a technical tone, and apply the onchain spelling across the docs and contract/script NatSpec.
Add EVM asset-compliance examples
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
There was a problem hiding this comment.
Pull request overview
Adds an EVM “asset compliance” example suite centered on on-chain account freezing (Predicate-driven) with issuer-controlled administrative actions (seize/mint/burn/pause/upgrade).
Changes:
- Introduces
FreezableStablecoin(UUPS upgradeable ERC-20) with freeze enforcement, pause, permit, role-gated mint/burn, and forced-transfer seizure. - Adds deployment and role-management Foundry scripts plus a Foundry test suite for freeze/seize and role separation.
- Adds an examples README and updates
FreezableTokendocumentation to align with the asset-compliance framing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/examples/asset-compliance/FreezableStablecoin.sol |
New upgradeable ERC-20 example implementing freeze/role separation + seize. |
test/asset-compliance/FreezableStablecoin.t.sol |
New tests covering freeze enforcement, seize behavior, and role boundaries. |
script/asset-compliance/DeployFreezableStablecoin.s.sol |
New deployment script for proxy + initial role assignment. |
script/asset-compliance/GrantFreezeManager.s.sol |
New script to grant/revoke/check Predicate’s freeze manager role. |
src/examples/asset-compliance/README.md |
New documentation for role model, integration steps, and included artifacts. |
src/examples/asset-compliance/FreezableToken.sol |
Updated contract header docs to match the new examples/readme. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- _update: exempt address(0) from the freeze check so freezing it can no longer brick mint (from==0) or burn (to==0). - _forceTransfer: reject a zero-address source (a seizure can never mint) and a frozen recipient (honors "frozen accounts cannot receive"). - Add regression tests for both fixes.
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
The soroban-build job re-resolved dependencies on every run because no lockfile was tracked (root .gitignore excludes *.lock). The newly published ed25519-dalek 3.0.0 is incompatible with soroban-env-host 23.0.1's testutils, breaking `cargo test`. Add a .gitignore exception for soroban/Cargo.lock and commit the lockfile (ed25519-dalek pinned to 2.2.0) so the Soroban build is reproducible.
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
- initialize: validate every role holder (pauser/seize/mint/burn), not just admin — a role granted to address(0) is unrecoverable. - Deploy script: require ADMIN explicitly (fail-closed) so the upgrade authority is never defaulted to an implicit sender. - Tests: freeze manager cannot burn; batch seize happy-path and LengthMismatch; initialize rejects a zero role holder.
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
EVM Asset Compliance example
FreezableStablecoin: upgradeable ERC-20 on theFreezablebase (implementsIFreezable), with EIP-2612 permit, pause, role-gated mint/burn, and a forced-transfer seize. Includes deploy + grant-role scripts and tests.FreezableToken: the minimal token implementingIFreezable.src/examples/asset-compliance/README.md: overview and recommended role model.