Skip to content

feat: add erc20 multi-minter support#10

Open
kpitapeersyst wants to merge 36 commits intorelease/v0.6.x-xrplevmfrom
feat/erc20-multi-minter
Open

feat: add erc20 multi-minter support#10
kpitapeersyst wants to merge 36 commits intorelease/v0.6.x-xrplevmfrom
feat/erc20-multi-minter

Conversation

@kpitapeersyst
Copy link
Copy Markdown

feat: add erc20 multi-minter support

Replaces the single-owner model for ERC20 token pairs with a multi-minter authorization model. Each TokenPair now stores an owner_addresses list, and mint/burn authorization checks any address in that list instead of a single owner.

Key changes

  • Proto / types: TokenPair.owner_address is deprecated in favor of owner_addresses (repeated string). MsgTransferOwnership is replaced by MsgAddMinter and MsgRemoveMinter. Query OwnerAddress is replaced by OwnerAddresses (now accepting a denom argument). Queries still populate the deprecated owner_address field for backwards compatibility.
  • Keeper: single-owner mint authorization is replaced by IsAuthorizedMinter. MigrateOwnerAddresses migrates existing token pairs from the single-owner field to the list. Dedicated multi_minter.go holds the minter management logic, transfer_ownership.go is removed.
  • Precompiles: Owner() and TransferOwnership() are removed from the ERC20/WERC20 precompiles (IOwnable.sol, ABI, events, interface, types). Burn0 uses the new multi-minter check.
  • Validation: MsgAddMinter / MsgRemoveMinter ValidateBasic accepts the configured bech32 address prefix; owner-addresses list length check is removed from TokenPair.Validate, IBC empty-owner case documented.
  • Tests: new coverage for AddMinter/RemoveMinter (msg server + e2e), multi-minter keeper paths, MintCoins, GetTokenPair(s) owner fields, migration (legacy owner can still mint), query OwnerAddresses by denom, IsAuthorizedMinter, HasDuplicates, and ValidateOwnerAddresses. Removes obsolete precompile ownership/transfer-ownership tests.
  • Misc fixes: regenerate werc20/abi.json, add HasDuplicates helper in utils.

Files most worth reviewing

  • proto/cosmos/evm/erc20/v1/{erc20,tx,query}.proto
  • x/erc20/keeper/multi_minter.go, x/erc20/keeper/msg_server.go, x/erc20/keeper/mint.go
  • x/erc20/types/{msg.go,token_pair.go,errors.go}
  • precompiles/erc20/{erc20.go,tx.go,events.go,types.go,interfaces.go,query.go}
  • precompiles/erc20/IOwnable.sol (removal) and precompiles/{erc20,werc20}/abi.json

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the release/v0.6.x-xrplevm branch

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant