Coder Social home page Coder Social logo

erc-1808's Introduction

中文

ERC-1808

1808 Standard & Multiverse System

ERC-1808

ERC (Ethereum Request for Comments) is a proposal submitted by the Ethereum developer, and the number after it is the proposal number.

ERC-1808 is a proposal of Cocos-BCX 1808 on Ethereum. It a Demo implementation proposed based on the design concept of COCOS 1808, which falls into the following four parts:

  • Blockchain
  • ERC-1808 Interface
  • NFT Nested Assets
  • Demo games

The contract interfaces that developers can call are as follows:

  • Blockchain

    • transferSystemAdmin(address _newSystemAdmin) Authority: System Administrator
    • setBusinessAdmin(address _businessAdmin, bool _changeType) Authority: System Administrator
    • isBusinessAdmin(address _businessAdmin)
    • addChain(string memory _chainName) Add a blockchain (contract) supporting the contract Authority: Business Administrator
    • setChainState(uint256 _chainId, bool _state) Change the state of blockhcain (contract) supporting the contract Authority: Business Administrator
    • getChains() Change the state of blockhcain (contract) supporting the contract Authority: Business Administrator
    • getChainsCount() Get the total number of supporting blockchains
    • getChain(uint256 _chainId) Get the information of the blockchain based on its ID
    • isEnableChain(uint256 _chainId) Whether the blockchain is enabled
  • ERC-1808 Interface

    • ownerOf(uint256 _tokenId) Find the owner of an NFT
      Transfer the ownership of the NFT from one address to another, allowing additional data to be attached; Need to verify whether it is a nested NFT. If it is, it cannot be traded

    • safeTransferFromWithExtData(address _from, address _to, uint256 _tokenId, string calldata data)

    • safeTransferFrom(address _from, address _to, uint256 _tokenId)
      Transfer the ownership of the NFT from one address to another without any additional data; need to verify whether it is a nested NFT. If it is, it cannot be traded.

    • transferFrom(address _from, address _to, uint256 _tokenId)
      Transfer the ownership of the NFT: The caller is responsible for confirming that the “recipient” can receive the NFT or other assets that may be permanently lost otherwise, so it is necessary to implement call permission judgment to prevent abuse. It is necessary to verify whether it is a nested NFT. If it is, it cannot be traded

    • balanceOf(address _owner) Return the number of NFTs owned by the specified address account. _account cannot be zero address or empty. The return value may be 0

    • authorize(address _authorized, uint256 _tokenId) Change or reset the NFT's authorized address. Zero address means no authorized address.

    • setAuthorizedForAll(address _operator, bool _authorized) Enable or disable assets authorizing all sources that are managed by third-party ("Operation Authorization")

    • getAuthorized(uint256 _tokenId) Get an authorized address for a single NFT

    • isAuthorizedForAll(address _owner, address _operator) Query whether the address is an authorized operation of another address

Unit Tests

Run npm install -g truffle to install Truffle framework

Run truffle test to run the unit tests.

erc-1808's People

Contributors

ypenghui6 avatar chandlerette avatar reed-hong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.