Giter Site home page Giter Site logo

dcep-contract's Introduction

部署

测试

#指定钞票的冠字号,<CB = center bank, 数额, 序号>  
tw-eth-cli utils -m fromAscii -p "CB_100_0001"
> "0x43425f3130305f30303031"
tw-eth-cli utils -m fromAscii -p "CB_100_0002"
> "0x43425f3130305f30303032"

# 发币,注意在node1上已经发布过了,所以你需要换一个冠字号
tw-eth-cli callContract -m mint -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,0x43425f3130305f30303033
tw-eth-cli callContract -m mint -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,0x43425f3130305f30303032

#命令行暂时不支持批量发币和转移
#tw-eth-cli callContract -m mintBatch -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,[0x43425f3130305f30303033,0x43425f3130305f30303032]

# 由于每个冠字号只能发一张,所以余额永远是1,可以理解为非同质化代币
tw-eth-cli callContractReturnValue -m balanceOf -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,0x43425f3130305f30303032

# 转移币
tw-eth-cli callContract -m safeTransferFrom -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,0x79F05947C104351D2e819c1e021EFD622D8F40b9,0x43425f3130305f30303032

# 查看转移后的余额
tw-eth-cli callContractReturnValue -m balanceOf -p 0x79F05947C104351D2e819c1e021EFD622D8F40b9,0x43425f3130305f30303032
tw-eth-cli callContractReturnValue -m balanceOf -p 0xed9d02e382b34818e88B88a309c7fe71E65f419d,0x43425f3130305f30303032

tw-eth-cli 配置

请更新到最新版本的 tw-eth-cli

npm upgrade tw-eth-cli -g

在家目录下增加tw-eth-cli-config.js

增加以下内容

module.exports = {
    // my local node
    fromAddress: "0xed9d02e382b34818e88B88a309c7fe71E65f419d",
    fromAddressPK: "0xe6181caaffff94a09d7e332fc8da9884d99902c7874eb74354bdcadf411929f1",
    contractAddress: "0x6B5AE192E2162E4C92CB306a2Fb6c0c6CC05FA7a",
    url: "http://node1.quorum.cn.blockchain.thoughtworks.cn:80",
    money: "8.8",
    gasPrice:0,
    gasLimit:327288,
    "abi": "truffle build"
}; 

dcep-contract's People

Contributors

benhaben avatar

Watchers

James Cloos avatar Shangqi Liu avatar Edison.Hsu avatar  avatar Yan Qian avatar Edward NoaLand avatar Arthas Zeng 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.