Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointers contracts: support for ERC1155 and CW1155 contracts #1755

Open
wants to merge 90 commits into
base: main
Choose a base branch
from

Conversation

dvli2007
Copy link
Contributor

@dvli2007 dvli2007 commented Jul 4, 2024

Describe your changes and provide context

This pull request is a collaboration by Orbiters/Frensei and Pallet Exchange to bring full support for 1155 contract standards to Sei. We added:

  • an ERC1155 pointer contract for the new CW1155 standard
  • a CW1155 pointer contract for any ERC1155 contracts

The ERC1155 contract is a well known and battle tested contract standard for NFTs and for semi-fungible tokens, allowing efficient creation and handling of very large quantities of tokens. Supporting the 1155 standard on-chain opens up the possibility for gaming (games with onchain assets almost always need to use a 1155 contract), open edition mints, and much more. The Orbiters/Frensei and Pallet Exchange teams see full support for 1155-type contracts/assets on Sei as mission critical to having a feature-complete general-purpose blockchain.

To further note, we have pioneered the first CW1155 standard that we know of. Cosmwasm ecosystem has historically lacked any such standard, with a few known attempts in the past that never received traction. Given Sei is EVM compatible and the ecosystem's momentum, we believe Sei will be the first Cosmwasm chain with a well-adopted CW1155 standard.

Testing performed to validate your change

  • Added Solidity unit tests for the ERC1155 pointer contract. This tests for pointer contract code logic. Also tested for gas efficiency for batch calls/sends. (/contracts/test/CW1155ERC1155PointerTest.t.sol)
  • Added integration test for an ERC1155 pointer pointing to a CW1155 contract. This tests out both queries and executions. (/contracts/test/ERC1155toCW1155PointerTest.js)
  • Added integration test for a CW1155 pointer pointing to an ERC1155 contract . This tests out both queries and executions. (/contracts/test/CW1155toERC1155PointerTest.js)
  • Added to test case to verify that PointerView precompile correctly returns the set ERC1155 pointer (/precompiles/pointerview/pointerview_test.go)
  • Added a test case for every ERC1155-related query bindings (/x/evm/client/wasm/query_test.go)
  • Added new integration test cases for validating ERC/CW2981 behavior on ERC/CW1155 pointers (/x/evm/integration_test.go)
  • Added tests to validate that GRPC queries can return pointer contract address for both ERC1155 and CW1155 pointers (/x/evm/keeper/grpc_query_test.go)
  • Added tests to verify that CW1155 pointer contracts can be registered, and cannot be re-registered if already exists (/x/evm/keeper/msg_server_test.go)
  • Added test cases to verify no unexpected behavior when registering ERC/CW1155 pointers (/x/evm/keeper/pointer_test.go)
  • Manually tested out changes to the CLI, such as seid q evm erc1155-payload, seid tx evm register-cw-pointer, seid tx evm register-evm-pointer

x/evm/client/cli/query.go Fixed Show fixed Hide fixed
x/evm/client/cli/query.go Fixed Show fixed Hide fixed
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.

5 participants