Skip to content

Add EVM Asset Compliance Example#63

Merged
Jesse-Sawa merged 8 commits into
mainfrom
asset-compliance-examples
Jul 6, 2026
Merged

Add EVM Asset Compliance Example#63
Jesse-Sawa merged 8 commits into
mainfrom
asset-compliance-examples

Conversation

@Jesse-Sawa

@Jesse-Sawa Jesse-Sawa commented Jun 26, 2026

Copy link
Copy Markdown
Member

EVM Asset Compliance example

  • FreezableStablecoin: upgradeable ERC-20 on the Freezable base (implements IFreezable), 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 implementing IFreezable.
  • src/examples/asset-compliance/README.md: overview and recommended role model.

@Jesse-Sawa Jesse-Sawa changed the title feat(examples): asset-compliance reference tokens (EVM + Soroban) Add asset-compliance example tokens (EVM + Soroban) Jun 26, 2026
@Jesse-Sawa Jesse-Sawa force-pushed the asset-compliance-examples branch 4 times, most recently from 5904332 to 5be6dba Compare June 26, 2026 20:12
@Jesse-Sawa Jesse-Sawa changed the title Add asset-compliance example tokens (EVM + Soroban) Add EVM asset-compliance examples; remove Soroban contracts Jun 26, 2026
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).
@Jesse-Sawa Jesse-Sawa changed the title Add EVM asset-compliance examples; remove Soroban contracts Add EVM asset-compliance examples Jun 28, 2026
@Jesse-Sawa Jesse-Sawa force-pushed the asset-compliance-examples branch from 5be6dba to 7fd1cfa Compare June 28, 2026 13:52
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.
@openzeppelin-code

openzeppelin-code Bot commented Jul 1, 2026

Copy link
Copy Markdown

Add EVM asset-compliance examples

Generated at commit: 8ad13aa07b3487175ec1e6715a05a6bec1d7adbe

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
5
24
30
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@Jesse-Sawa Jesse-Sawa marked this pull request as ready for review July 1, 2026 14:15
Copilot AI review requested due to automatic review settings July 1, 2026 14:15
@Jesse-Sawa Jesse-Sawa changed the title Add EVM asset-compliance examples Add EVM Asset Compliance Example Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FreezableToken documentation 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.

Comment thread src/examples/asset-compliance/FreezableStablecoin.sol
Comment thread src/examples/asset-compliance/FreezableStablecoin.sol Outdated
Comment thread script/asset-compliance/DeployFreezableStablecoin.s.sol
Comment thread test/asset-compliance/FreezableStablecoin.t.sol
Comment thread test/asset-compliance/FreezableStablecoin.t.sol
Comment thread src/examples/asset-compliance/README.md
- _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.
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.
Copilot AI review requested due to automatic review settings July 6, 2026 20:46
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/examples/asset-compliance/FreezableStablecoin.sol Outdated
Comment thread script/asset-compliance/DeployFreezableStablecoin.s.sol Outdated
Comment thread src/examples/asset-compliance/FreezableStablecoin.sol
- 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.
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.

@Jesse-Sawa Jesse-Sawa merged commit a59b7d1 into main Jul 6, 2026
4 checks passed
@Jesse-Sawa Jesse-Sawa deleted the asset-compliance-examples branch July 6, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants