Skip to content

ERC-1155 multi-token support (erc1155.zig) #64

Description

@koko1123

Motivation

ERC-20 and ERC-721 wrappers exist (erc20.zig, erc721.zig); ERC-1155 is the remaining mainstream token standard. Gaming/NFT integrators check for it on day one.

Scope

New src/erc1155.zig mirroring the erc721.zig pattern:

  • Reads: balanceOf(account, id), balanceOfBatch, uri(id), isApprovedForAll
  • Writes: setApprovalForAll, safeTransferFrom, safeBatchTransferFrom
  • Event topics: TransferSingle, TransferBatch, ApprovalForAll, URI

Pointers

src/erc721.zig is the template (selector computation via keccak.zig, calls via contract.zig). Batch methods need dynamic-array ABI encoding — see abi_encode.zig tuple/array support. Add a refAllDeclsRecursive test (see src/mev_share.zig).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions