Giter Club home page Giter Club logo

unichain-core's Introduction

uniworld

UINICHAIN CORE

UniChain is a high secure and scalable blockchain platform for Smart Society 5.0. This repos implements the core components of UniChain blockchain including unichain-core node, database and key management tools. For more information, please check out UniChain website and UniWolrd ecosystem.

Build application

Prepare dependencies

  • JDK 1.8 (JDK 1.9+ are not supported yet)
  • On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has Oracle JDK 8, instead of having Open JDK 8 in the system. If you are building the source code by using Open JDK 8, you may get fails

Build application from source code

git clone https://github.com/uniworld-io/unichain-core.git
# checkout to stable version 
cd unichain-core
./gradlew build 

Binary files located in build/libs folder.

Run application

cd build/libs
java -jar unichain-core.jar
     _   _ _ __ (_) ___| |__   __ _(_)_ __  
    | | | | '_ \| |/ __| '_ \ / _` | | '_ \ 
    | |_| | | | | | (__| | | | (_| | | | | |
     \__,_|_| |_|_|\___|_| |_|\__,_|_|_| |_|

Run unichain node with customized config

cd build/libs
java -jar unichain-core.jar -c ./your_localtion/of_config_file.conf

If you are witness, run unichain node with --witness and -p options (-p: witness private key)

java -jar unichain-core --witness -p your_witness_private_key
java -jar unichain-core --witness -p d06f6fbea126162c1bfac04869cf94331ca2a98610737e4b05b56527b0b8bf45

Contributing

unichain-core is an open source project. It is the work of contributors. We appreciate your help! Thank you for all of our contributors. This project wouldn’t be what it is without you!

If you'd like to contribute to unichain-core, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base.

Pull requests

First of all, unichain-core follows gitflow workflow. Please open pull requests to the develop branch. Once approved, we will close the pull request and merge into master branch.

We are always happy to receive pull requests, and do our best to review them as fast as possible. Not sure if that typo is worth a pull request? Do it! We would appreciate it.

If your pull request is not accepted on the first try, don't be discouraged as it can be a possible oversight. Please explain your code as detailed as possible to make it easier for us to understand.

Create issues

Any significant improvement should be documented as a GitHub issue before anyone starts working on it.

When filing an issue, make sure to answer these three questions:

  • What did you do?
  • What did you expect to see?
  • What did you see instead?

License

unichain-core's People

Contributors

abrahamnguyen26 avatar chen-yueying avatar elonkusk avatar henry-ngv avatar ligki avatar optimusng avatar realelonmusk102 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

viethagit

unichain-core's Issues

Create contract: RemoveNftMinterContract

Remove minter from NFT template suggestion:

  • setup contract workflow
    • define new contract type: RemoveNftMinterContract
    • define new contract input model:
      message RemoveNftMinterContract{
      bytes owner = 1;
      string symbol = 2;
      }
    • more model look at : see #37
    • define & declare in actuator factory new actuator for RemoveNftMinterContract
    • setup contract workflow: parse to json, unpack json to transaction...
    • define gRPC api, implement gRPC api
    • create HTTP api: servlet, binding path. for fullnode api only
    • limit this contract on block version >= 5 only
    • create capsule wrapper for contract
    • create contract store
    • fee = bandwith fee + 2 UNW
    • also remove minter from account-template indexing store

Bizz:

  • owner of nft template remove minter to template
  • because only maximum one minter added to template, don't need to add minter address, just remove if exist
  • should reject if minter not exist
  • nftTemplate must exist
  • bandwith fee + 2 UNW. Reject contract if not enough fee
  • list nft template will see minter removed
  • mint new NFT token with old minter should be rejected

Broadcast signed TokenExchangeContract failed on testnet

Describe the bug
Broadcast signed TokenExchangeContract failed on testnet
{ "visible": false, "txID": "41cfd910dbdaceae42e15cd655dfddcd0daf73747918e48ce8a4e7a5774c7839", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1, "token_name": "AGG4", "owner_address": "44730c18b309a7127efdc523bd3486be3e83a3db86" }, "type_url": "type.googleapis.com/protocol.TokenExchangeContract" }, "type": "ExchangeTokenContract" } ], "ref_block_bytes": "4349", "ref_block_hash": "4daa2cb260e04295", "expiration": 1640280060000, "timestamp": 1640280003821 }, "raw_data_hex": "0a02434922084daa2cb260e0429540e0e0bdc2de2f5a59083e12550a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e546f6b656e45786368616e6765436f6e7472616374121f0a1544730c18b309a7127efdc523bd3486be3e83a3db86120441474734180170eda9bac2de2f", "signature": [ "c1fbdad9e5677ab5156135836ffe9d0915725e66ba884e28117c68ccc6282802a545157f9f12ed11c31c5f274b501aed258496e3571f4c556536506bfdd94afb01" ] }

Error log
17:20:03.967 ERROR qtp1371953731-755] [o.u.c.Wallet Broadcast transaction d0788ee6b9fa5e3888b39c9b2c7fde03fd09412b64d83f05e0bef1d1199024aa failed, miss sig or contract.

Expected behavior
Broadcast tx must be successfull.

Create contract: MintNftTokenContract

  • Mint NFT contract workflow suggestion:

    • define new contract type: MintNftTokenContract
    • define new contract input model: MintNftTokenContract
    • more model look at : see #37
    • define & declare in actuator factory new actuator for MintNftTokenContract
    • setup contract workflow: parse to json, unpack json to transaction...
    • define gRPC api, implement gRPC api
    • create HTTP api: servlet, binding path. for fullnode api only
    • limit this contract on block version >= 5 only
    • create capsule wrapper for contract
    • create contract store
  • Bizz:

    • contract message:
      message MintNftTokenContract{
      bytes owner_address = 1; //owner or minter, required
      bytes to_address = 2; //target address, required. if missing: create new account & charge more fee
      int64 token_id = 3; id of nft token.. Optional, if not exist, auto generate one & return.
      string uri = 4; //uri of external resource
      string metadata = 5;//json data to describe resource, optional
      int64 available_time = 6;//if missing: available now. if exist: the timestamp to be unlocked
      }
    • owner or minter should do this contract
    • the approval will mint new NFT token based on template state
    • if reach limit of supply: reject
    • if to_address not exist: charge more fee & create new account
    • charge fee: tx should charge the owner 2 unw + max(bandwith fee, createAccFee) + create account fee in system contract
    • more modell : #37
    • update indexing info for account-nft store
    • always implement safe mint from ERC721 suggestion

Update new fee policy for URC30 token

Update new fee policy for URC30 token:

  • TokenCreate: ASSET_ISSUE_FEE, 500 unw default, support updated by proposal: YES
  • TokenMine: ASSET_UPDATE_FEE, 2 unw default, support updated by proposal: YES
  • TokenContributeTokenPoolFee: ASSET_UPDATE_FEE, 2 unw default, support updated by proposal: YES
  • TokenBurn: ASSET_UPDATE_FEE, 2 unw default, support updated by proposal: YES
  • TokenTransfer: TOKEN_TRANSFER_FEE = 0, support updated by proposal: NO
  • TokenUpdateParams: ASSET_UPDATE_FEE, 2 unw default, support updated by proposal: YES
  • TokenWithdrawFuture: TOKEN_TRANSFER_FEE , 0 unw, support updated by proposal: NO

Messy source code actuators

Actuators source code is messy, violate coding convention:

  • should use Lombok & Assert instead for clear validation

Create contract: BurnNftTokenContract

Burn NFT suggestion:

  • message:

    message BurnNftTokenContract{
    bytes owner = 1;
    string symbol = 2;
    int64 token_id =3;
    }

  • Bizz:

    • limited on role: owner or approval, or approval_all
    • destroy NFT item: should completely destroy item from system
    • this id never allocated again

Create contract: CreateNftTemplateContract

Create NFT template workflow suggestion:

  • define new contract type: CreateNftTemplateContract
  • define new contract input model: CreateNftTemplateContract
  • more model look at : see #37
  • define new actuator for CreateNftTemplateContract:
    • validate params
    • exec: save contract info
    • indexing account-template info
  • setup contract workflow: parse to json, unpack json to transaction
  • define gRPC api, implement gRPC api
  • create HTTP api: servlet, binding path. for fullnode api only
  • limit this contract on block version >= 4 only
  • create capsule wrapper for contract
  • create contract store

Bizz:

  • symbol is the key for template, unique, required
  • name is the short description, should limited in size, required
  • owner account create that template, so the owner is owner address, required
  • minter is the address that approved to be minter. optional
  • total_supply: total nft token supply should be int64, positive
  • charge fee: tx should charge the owner 500 unw + bandwith fee
  • the address should not be smart contract or genesis account, must exist

Create contract: AddNftMinterContract

Add minter to NFT template suggestion:

  • setup contract workflow
    • define new contract type: addNftMinter

    • define contract msg:

           message AddNftMinterContract{
             bytes minter = 1;//minter to add, must exist
             bytes owner = 2; //owner account, owner of template
             string symbol = 3; //nft template 
           }
      
    • more model look at : see #37

    • define & declare in actuator factory new actuator for AddNftMinterContract

    • setup contract workflow: parse to json, unpack json to transaction...

    • define gRPC api, implement gRPC api

    • create HTTP api: servlet, binding path. for fullnode api only

    • limit this contract on block version >= 5 only

    • create capsule wrapper for contract

    • create contract store

    • fee = bandwith fee + 2 UNW

    • also indexing the minter to account-template contract with flag is_minter = true

Bizz:

  • owner of nft template add minter to template
  • owner, minter must exist
  • override minter if minter exist in NftTemplate
  • nftTemplate must exist
  • bandwith fee + 2 UNW. Reject contract if not enough fee
  • list nft template will see minter updated
  • mint new NFT token with old minter should be rejected
  • mint new NFT token with new minter should be accepted

Gradle build file pointing to snapshot repo

PROBLEMS:

  • Gradle build file ~/build.gradle pointing to snapshot repo
  • Including window depends softmotions-public but not check env
    repositories { mavenLocal() mavenCentral() // maven { url 'https://repo.spring.io/plugins-release' } maven { url 'https://repo.softmotions.com/repository/softmotions-public'} maven { url 'https://repo.spring.io/snapshot' } }

SOLUTIONS:

  • Point to release repo
  • Detect windows env to include package repo

Test the features of Nft

NftCreateTemplate
NftMintToken
NftRemoveMinter
NftAddMinter
NftRenounceMinter
NftBurnToken
NftApprove
NftApproveForAll
NftTransfer
ListNftTemplate
ListNftToken
ListNftTokenApproveAll
ListNftTokenApprove
GetNftTemplate
GetNftToken
GetNftBalance
GetNftApprovedForAll

Add NFT query api: ListNftApproveAll

Support ListNftApproveAll:

  • Because some account don't know that it's delegated to approve all token of other account

  • Input:

          message NftTokenApproveAllQuery{
            bytes owner_address = 1;
          }
    
  • Ouput:

          message NftTokenApproveAllResult{
            bytes owner_address = 1;
            repeated NftAccountTokenRelation approve_list= 2;
          }
    
         //use NftAccountTokenRelation but should keep this fields
          message NftAccountTokenRelation{
            bytes owner = 1; //owner account
            int64 total = 4; //total token delegated
          }
    

Create contract: ApproveNftContract

Approve/disapprove NFT suggestion:

  • message contract:

    message ApproveNftTokenContract{
      bytes owner = 1;
      bytes to_address = 2;
      bool approve = 3;
      string nft_template = 4;
      int64 token_id =5;
    }
    
  • Bizz:

    • limited on role: owner
    • approve: true if approve, false if disapprove
    • assign/unassign one account as operator on that NFT item

Create contract: RenounceNftMinterContract

Renounce(remove itselft) minter from NFT template suggestion:

  • setup contract workflow
    • define new contract type: RenounceNftMinterContract

    • define new contract input model: RenounceNftMinterContract

      message RenounceNftMinterContract{
         bytes owner = 2; //owner account, owner of template
         string nft_template = 3; //nft template
       }
      
    • more model look at : see #37

    • define & declare in actuator factory new actuator for RenounceNftMinterContract

    • setup contract workflow: parse to json, unpack json to transaction...

    • define gRPC api, implement gRPC api

    • create HTTP api: servlet, binding path. for fullnode api ONLY

    • limit this contract on block version >= 5 only

    • create capsule wrapper for contract

    • create contract store

    • fee = bandwith fee + 0 UNW

    • also remove minter from account-template indexing store

Bizz:

  • one account remove itseft from minter role
  • nft template must exist
  • this account must be the minter, other wise rejected
  • bandwith fee + 0 UNW. Reject contract if not enough fee
  • list nft template will see minter updated
  • mint new NFT token with old minter should be rejected

Add NFT query api: ListNftApprove

Support ListNftApprove:

  • Because some account don't know that it's delegated to approve some of NFT token, so we should support this listing api

  • Input:

          message NftTokenApproveQuery{
            bytes owner_address = 1;
            int32 page_size = 2;
            int32 page_index = 3;
          }
    
  • Output:

          message NftTokenApproveResult{
            bytes owner_address = 1;
            int32 page_size = 2;
            int32 page_index = 3;
            int64 total = 4;
            repeated NftToken tokens= 5;
          }
    
  • How to implement ?

    • In account-token relation, add indexing field for token approve list:

          message NftAccountTokenRelation{
                          bytes approve_head = 7; //point to head of tokenapprove
                          bytes approve_tail = 8;//point to tail of tokenapprove
                          int64 approve_total = 9; //total token
                      }
      
    • Add new account-tokenapprove indexing store with this structure that link to real nft token:

            message NftTokenApproveRelation{
                bytes owner_address = 1;
                bytes token_id = 3;
                bytes next = 8;
                bytes prev = 9;
          }
      
    • when approve/disapprove: modify these structure

    • when listing: load, paging data

Add NFT query api: getNftTemplate

Suggestion:

  • input:

    message NftTemplateQuery{
      bytes owner_address = 1;
      int64 page_size = 2;
      int64 page_index = 3;
    

    }

  • output: NFT template info use structure Create NFT google protobuf message format #37

    message NftTemplateQueryResult{
        bytes owner_address = 1;
        int64 page_size = 2;
        int64 page_index = 3;
        int64 total = 4;
        repeated NftTemplate templates = 5;
      }
    

Guard account able to receive future fund but unable to withdraw

Describe the bug
Guard account able to receive future send but unable to withdraw
To Reproduce
Steps to reproduce the behavior:

  1. Go to testnet
  2. From genesis account UinLtqgPm9waBdUSVAAzRR6pfBzfQNC4c2 send future fund to the guard account Uk28n4A28nfXhgYWnRr6mXDbTbAeCkEtJ7
  3. Wait for deal to expired
    "future_supply": { "total_deal": 2, "lower_time": 1640044800000, "upper_time": 1640131200000, "total_balance": 200000000, "lower_tick": "44efbfbd4b36efbfbdefbfbd2aefbfbdefbfbd596aefbfbdefbfbdefbfbdefbfbd29efbfbdefbfbdefbfbd455f31363430303434383030303030", "upper_tick": "44efbfbd4b36efbfbdefbfbd2aefbfbdefbfbd596aefbfbdefbfbdefbfbdefbfbd29efbfbdefbfbdefbfbd455f31363430313331323030303030" }
  4. Withdraw deals
  5. See error:
    13:49:04.816 ERROR [pool-48-thread-1] [actuator](WithdrawFutureActuator.java:77) Account[44f1b94b36daea2ad0ca596af689d0fd29bccfd845] is a guard representative and is not allowed to withdraw Balance java.lang.IllegalArgumentException: Account[44f1b94b36daea2ad0ca596af689d0fd29bccfd845] is a guard representative and is not allowed to withdraw Balance at org.springframework.util.Assert.isTrue(Assert.java:68) at org.unichain.core.actuator.WithdrawFutureActuator.validate(WithdrawFutureActuator.java:72) at org.unichain.core.Wallet.createTransactionCapsule(Wallet.java:330) at org.unichain.core.services.RpcApiService.createTransactionCapsule(RpcApiService.java:173) at org.unichain.core.services.RpcApiService.access$700(RpcApiService.java:59) at org.unichain.core.services.RpcApiService$WalletApi.withdrawFutureTransaction(RpcApiService.java:1315) at org.unichain.api.WalletGrpc$MethodHandlers.invoke(WalletGrpc.java:8638) at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:171) at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:283) at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:707) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Expected behavior
Dont allowed to send future fund to guard account.

List all available NFT template

List all available NFT template suggestion:

  • input:

    message NftTemplateQuery{
      bytes owner_address = 1;
      int64 page_size = 2;
      int64 page_index = 3;
    

    }

  • output: NFT template info use structure Create NFT google protobuf message format #37

    message NftTemplateQueryResult{
        bytes owner_address = 1;
        int64 page_size = 2;
        int64 page_index = 3;
        int64 total = 4;
        repeated NftTemplate templates = 5;
      }
    
  • public HTTP, gRPC api on both FullNodeAPI & solidApi

Bizz:

  • list with filter model

ListNftTemplate missing owner, paging info

  • Template created: MOK, MOK1, MOK3 on testnet

  • List template got result:

          wallet> ListNftTemplate UinLtqgPm9waBdUSVAAzRR6pfBzfQNC4c2  -1 -1
              {
                  "page_size": 20,
                  "total": 3,
                  "templates": [
                      {
      	                "symbol": "MOK",
      	                "name": "monkey",
      	                "total_supply": 100000000000,
      	                "owner": "44e4257594e51b856d87428771a1a9ccdcab8bf5cb",
      	                "last_operation": 1646219814000,
      	                "next": "4d4f4b32"
                      },
                      {
      	                "symbol": "MOK2",
      	                "name": "monkey",
      	                "total_supply": 100000000000,
      	                "owner": "44e4257594e51b856d87428771a1a9ccdcab8bf5cb",
      	                "last_operation": 1646219868000,
      	                "next": "4d4f4b33",
      	                "prev": "4d4f4b"
                      },
                      {
      	                "symbol": "MOK3",
      	                "name": "monkey",
      	                "total_supply": 100000000000,
      	                "owner": "44e4257594e51b856d87428771a1a9ccdcab8bf5cb",
      	                "last_operation": 1646220390000,
      	                "prev": "4d4f4b32"
                      }
                  ]
              }
    
  • load template with empty resault got :

         wallet> ListNftTemplate UcTApoAcUFsVkL1xNUdqfqugQugxXEkw2H  -1 -1
         {
             "page_size": 20
         }
    

Force checking zero division by token exchange factors in TokenExchangeActuator

Is your feature request related to a problem? Please describe.

  • token exchange code applied but actually running on block v2
  • token exchange contract model applied, new urc30 created with factor equals ZERO
  • upgrade to block v3
  • some one try to exchange unw --> urc30 token with basic div: token_exchanged = unw_amount * token_factor/unw_factor, it might cause:
    • zero div error
    • overflow number

Describe the solution you'd like

  • validate exchange factors before exchange

Create NFT google protobuf message format

Create protobuf message format for native NFT:

  • NFT template, CreateNftTemplateContract
  • NFT item, MintNftTokenContract
  • Account-NFT relation index
  • Account-NFT template index
  • Query nft template
  • Query nft template result
  • Query nft token of account
  • Query nft token of account result

Criteria:

  • quick search for each of:
    • NFT template using key
    • NFT token using key
    • NFTs of one account
    • NFT templates of one account
    • all NFT of accounts with paging info
    • all NFT templates with paging info
  • should self-maintainable without garbage collection, ex: when delete NFT items
  • storage should be scalable when the number of NFT items increase too much

Wrong mapping actuator again block version

Describe the bug
Wrong mapping actuator again block version
To Reproduce
Steps to reproduce the behavior:

  1. Running testnet at master commit 1a60139
  2. Upgrade to block ver 2
  3. Make tx withdraw token urc30
  4. Got actuator activated is TokenWithdrawFutureActuatorV3
  5. Try to represent the bug on block v2 but withdraw success, it should be an error as described at [https://github.com//issues/11]

Expected behavior

  • the actuator activated should be TokenWithdrawFutureActuator
  • withdraw will get error

Log
17:24:10.593 INFO [pool-42-thread-1] [DB](SnapshotManager.java:283) flush cost:2, create checkpoint cost:1, refresh cost:1 17:24:10.614 INFO [pool-42-thread-1] [actuator](TokenWithdrawFutureActuatorV3.java:48) TokenWithdrawFutureActuatorV3 owner_address: "D\361\271K6\332\352*\320\312Yj\366\211\320\375)\274\317\330E" token_name: "ssi"

Withdraw future transfer failed

Withdraw future transfer failed:

  • create multiple future deals
  • all deals expired
  • create withdraw tx
  • got error:
    3:20:13.781 ERROR [pool-48-thread-3] actuator exec withdraw future error -->
    java.lang.NullPointerException: null
    at org.unichain.core.actuator.WithdrawFutureActuator.withdraw(WithdrawFutureActuator.java:118)
    at org.unichain.core.actuator.WithdrawFutureActuator.execute(WithdrawFutureActuator.java:40)
    at org.unichain.common.runtime.RuntimeImpl.setupPrecompiled(RuntimeImpl.java:159)
    at org.unichain.common.runtime.RuntimeImpl.setup(RuntimeImpl.java:167)
    at org.unichain.core.db.TransactionTrace.exec(TransactionTrace.java:136)
    at org.unichain.core.db.Manager.processTransaction(Manager.java:1294)
    at org.unichain.core.db.Manager.pushTransaction(Manager.java:752)
    at org.unichain.core.Wallet.broadcastTransaction(Wallet.java:408)
    at org.unichain.core.services.RpcApiService$WalletApi.broadcastTransaction(RpcApiService.java:907)
    at org.unichain.api.WalletGrpc$MethodHandlers.invoke(WalletGrpc.java:8506)
    at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:171)
    at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:283)
    at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:707)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    23:20:13.781 ERROR [pool-48-thread-3] o.u.c.Wallet Broadcast transaction 34e401c09440a1f2492cbfea629e158141d904a0695601b54a0ea5188fe530de failed, null.
    23:20:15.192 INFO [UnichainJClientWorker-7] net Receive from /13.250.187.196:5525, type: INVENTORY

Support self-locking UNW

Support self-locking UNW proposal:

  • Already have future transfer as locked UNW but to another address
  • Now we need self-locking UNW, just like send future to itself
  • Proposal:
    • when sending future to another address, if this address is owner address or missing: self locked
    • don't create new transaction type, just upgrade futureTransfer to block v4
    • extend futureTransfer/futureWithdraw block v4 to support transfer to itself
    • keep listing future deals unaffected

Contribute URC30 pool fee cost too much: 500 unw

  • Contribute pool URC30 fee contract:
    message ContributeTokenPoolFeeContract {
    bytes owner_address = 1;
    string token_name = 2;
    int64 amount = 3;
    }
  • cost 500UNW is too much, should change to 2UNW
  • should be updated by proposal

Create contract: TransferNftContract

Transfer NFT suggestion:

  • message:

    message TransferNftContract{
      bytes owner = 1;
      bytes to_address = 2;
      string symbol = 3;
      int64 token_id = 4;
    }
    
  • Bizz:

  • transfer nft token to another address

  • if address not exist: create new address, charge more fee: create new account

  • limited on role: owner, approval

  • owner must exist

  • owner must enough fee: fee = bw fee + 0Unw if account exist or create_new_acc fee + 0 unw + in_system_create_acc_fee

Create contract: ApproveForAllNftContract

Approve for all NFT suggestion:

  • messag:

    message ApproveForAllNftTokenContract{
      bytes owner = 1;
      bytes to_address = 2;
      bool approve = 3; //true if approve, false if disapprove
    }
    

-Bizz:

  • limited on role: owner
  • purpose: approve operation on all NFTs to this address
  • should update this info to indexing info
  • reject if no NFT asset found

Build new explorer node app frame

Build new explorer node app frame:

  • new app like relay node, but work as explorer node
  • Gradle: new artifact buildUniExplorerJar with new archives explorer-node.jar
  • new main file ExplorerNode
  • features:
    • use rocksdb as DB engine
    • sync state like fullnode
    • expose HTTP API only for both snapshot state and solidity state
    • don't serve grpc API

Set fee policy for NFT transactions

Set fee policy for NFT transactions suggestion:

  • all transactions should charged on owner account, using UNW gas, don't charge approval, minter
  • support send to non-exist account, with more fee charged to create new account
  • fee includes:
    • bandwith: as normal, using real bytes used
    • network: ZERO because not smart contract
    • actuator/bizz fee: depends on transaction types
  • Fee params:
    • default params
    • support proposal to update this params
    • limited on block ver >= 4
  • actuator/bizz fee:
    • create NFT template: 500 unw default
    • mint NFT: 2 unw default
    • add minter: 2 unw default
    • remove minter: 2 unw default
    • renounce minter: 0 unw default
    • addApprovalForAll: 2 unw default
    • approve: 2 unw default
    • transfer NFT: 0 unw default
    • burn NFT: 2 unw default

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.