Feature: Add ERC1155 multi-token standard properties#84
Open
omarinuwa wants to merge 1 commit intocrytic:mainfrom
Open
Feature: Add ERC1155 multi-token standard properties#84omarinuwa wants to merge 1 commit intocrytic:mainfrom
omarinuwa wants to merge 1 commit intocrytic:mainfrom
Conversation
Implements comprehensive property tests for ERC1155 multi-token contracts following EIP-1155. Addresses GitHub issue crytic#57. Adds 30 properties across 6 files: - ERC1155BasicProperties (14 properties): Balance tracking, single/batch transfers, operator approvals, and safe transfer receiver checks - ERC1155BurnableProperties (6 properties): Single and batch burn operations with proper authorization checks - ERC1155MintableProperties (8 properties): Single and batch mint operations with safe receiver validation Each property includes: - Full NatSpec documentation with title, notice, dev notes, and invariants - Unique property IDs (ERC1155-BALANCE-001, ERC1155-TRANSFER-001, etc.) - Testing mode indicators (INTERNAL/EXTERNAL) - Organized sections with descriptive headers Property Categories: - Balance Properties: Zero address balance, batch consistency - Transfer Properties: Zero address protection, balance updates, self-transfers, batch operations, array validation - Approval Properties: Operator approval management, authorization checks - Safety Properties: Receiver interface validation for safe transfers - Burn Properties: Balance reduction, approval requirements, batch operations - Mint Properties: Balance increases, zero address protection, receiver checks Both INTERNAL and EXTERNAL testing approaches supported: - Internal (3 files): Test harness inherits from token implementation - External (3 files): Tests interact through public interface only Base contracts and utilities: - ERC1155TestBase: Base for internal testing with MockReceiver1155 - ERC1155ExternalTestBase: Base for external testing - MockReceiver1155: Test contract for safe transfer callbacks - IERC1155Internal: Interface for external testing Directory structure follows existing patterns: contracts/ERC1155/ ├── internal/ │ ├── properties/ (BasicProperties, BurnableProperties, MintableProperties) │ └── util/ (ERC1155TestBase, MockReceiver1155) ├── external/ │ ├── properties/ (External variants of above) │ └── util/ (ERC1155ExternalTestBase) └── util/ (IERC1155Internal interface) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Omar Inuwa seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements comprehensive property tests for ERC1155 multi-token contracts following EIP-1155. Addresses GitHub issue #57.
Adds 30 properties across 6 files:
Each property includes:
Property Categories:
Both INTERNAL and EXTERNAL testing approaches supported:
Base contracts and utilities: