• Stars
    star
    1,472
  • Rank 31,753 (Top 0.7 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created over 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

中文

ERC-1808

Full spec: ethereum/EIPs#2246
develop document: 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.

More Repositories

1

cocos-bcx-node-bin

Shell
2,409
star
2

cocos-mainnet

Cocos-BCX: The platform for the next generation of digital game economy
C++
1,297
star
3

JSSDK-Demo

JSSDK Demo
HTML
1,183
star
4

JSSDK

JavaScript
763
star
5

1808

Lua
625
star
6

AndroidWallet

Java
125
star
7

CocosPayDesktop

A Desktop Application for Cocos-BCX
JavaScript
97
star
8

Python-Middleware

Cocos-BCX python middleware
Python
94
star
9

CocosPay

A browser extension for Cocos-BCX.
Vue
92
star
10

vscode-cocos-bcx

Cocos-BCX for VS Code
TypeScript
86
star
11

explorer

Cocos-BCX Block Explorer
Vue
66
star
12

VoteCocosBCX

Vue
62
star
13

Cocos-BCX-website

Official website
CSS
62
star
14

bcx-sdk-creator

JavaScript
60
star
15

AndroidSdk

Java
53
star
16

explorer-backend

Cocos-BCX Block Explorer Backend
JavaScript
53
star
17

iOSSDK

Objective-C
52
star
18

Document

Cocos-BCX document.
52
star
19

Cocos-BCXContract

Solidity
50
star
20

cocosjs-core

Cocos-BCX core sdk for dapp
JavaScript
43
star
21

CocosPay-360

JavaScript
42
star
22

cocos-dice-sample

Dice game, Classic dice with fast random.
Vue
42
star
23

UnitySDK

C#
37
star
24

Contracts-Sample

Cocos-BCX contract sample
Lua
36
star
25

scripts

Cocos-BCX scripts.
Python
33
star
26

EOS-1808

C++
30
star
27

GasMortgage

Vue
30
star
28

cocos-shooting-game

game
JavaScript
30
star
29

wetank

tank game
JavaScript
27
star
30

CocosFactory

Python-based cocos smart-contract development & testing framework
Python
25
star
31

smart-contract-practice

cocos-bcx smart contract practice
Lua
21
star
32

Docker

Cocos-BCX Docker
21
star
33

NH1808-Website

Vue
20
star
34

bcxLibrary-Cpp

Cocos-BCX CPP Library
C++
19
star
35

faucet

faucet
Python
19
star
36

wallet_Invoker

DApp SDK
Java
16
star
37

CocosToken

ERC20 token for Cocos-BCX
JavaScript
15
star
38

data_analysis

block chain data analysis
Python
14
star
39

Python-Middleware-sample

Python Middleware example
Python
13
star
40

NodeJSSDK

JavaScript
12
star
41

CocosGoSDKTool

Go
12
star
42

star-project

JavaScript
11
star
43

Go-SDK

Go
8
star
44

CocosPay-firefox

JavaScript
7
star
45

web3service-Example

TypeScript
1
star