Skip to content

feat: Major overhaul with support for ERC-1155 and ERC-6909 token standards - #27

Merged
sscovil merged 94 commits into
mainfrom
erc1155-and-erc6909
Sep 11, 2025
Merged

sscovil merged 94 commits into
mainfrom
erc1155-and-erc6909

Conversation

@sscovil

@sscovil sscovil commented Sep 10, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR introduces some major changes for the v0.3.0 release.

Major Architecture Redesign

This release introduces a complete rewrite of EVMAuth with modular architecture, dual token standard support, and enterprise-ready features for authorization state management.

Key Features

Dual Token Standard Support

  • EVMAuth1155: Full ERC-1155 compliance with batch operations, URI-based metadata, and receiver hooks
  • EVMAuth6909: ERC-6909 compliance offering simpler transfers, granular approvals, and on-chain metadata

Core Improvements

Token Management

  • Sequential token IDs starting at 1, assigned automatically via createToken(EVMAuthTokenConfig config)
  • Unified configuration with updateToken(uint256 id, EVMAuthTokenConfig config)
  • Non-transferable tokens option for things like licenses and identity tokens
  • Time-to-live (TTL) for automatic token expiration

Payment System

  • Multiple payment methods per token:
    • Native currency (ETH, POL, etc.)
    • Multiple ERC-20 tokens with independent pricing
    • Set price to 0 to disable specific payment methods
  • Treasury management for collecting purchase revenue
  • Reentrancy protection on all purchase functions

Contract Infrastructure

  • Upgradeable by default using OpenZeppelin's UUPSUpgradeable pattern
  • ERC-7201 namespaced storage for upgrade safety
  • Modular base contracts for clean separation of concerns
  • Pausable operations for emergency situations

Token Expiration & Cleanup

  • Improved expired token cleanup with efficient time-bucket system
  • Public pruneBalanceRecords(address account, uint256 id) for manual cleanup
  • Automatic pruning during transfers and balance checks
  • Bounded balance records to prevent gas issues

Updated Roles

  • TOKEN_MANAGER_ROLE: Configure tokens and metadata
  • ACCESS_MANAGER_ROLE: Pause/unpause and freeze/unfreeze accounts
  • TREASURER_ROLE: Update treasury address
  • MINTER_ROLE: Issue tokens programmatically
  • BURNER_ROLE: Burn tokens from accounts
  • UPGRADE_MANAGER_ROLE: Authorize contract upgrades

Documentation & Testing

  • Comprehensive architectural diagrams
  • Detailed deployment guides
  • Cast command cheat sheet
  • Significantly improved test coverage
  • Auto-generated documentation

Migration Notes

Breaking Changes

  • Complete contract redeployment required (not upgradeable from v0.2.x)
  • New initialization pattern replaces constructor
  • Role names and permissions restructured
  • Blacklist functionality replaced with account freezing

sscovil added 30 commits August 14, 2025 09:40
@codecov

codecov Bot commented Sep 10, 2025

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@sscovil
sscovil merged commit 31cfdba into main Sep 11, 2025
6 checks passed
@sscovil
sscovil deleted the erc1155-and-erc6909 branch September 11, 2025 15:52
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