This is the Golang chaincode version of Ethereum's ERC20 token standard based OpenZeppelin's implementation
Basic features:
- Basic Token
- Ownable Token
- Detailed Token
- Mintable Token
- Burnable Token
- Pausable Token
Custom feature:
- Transaction memo - able to attach an 'memo' to a transaction with a extra parameter to
Transfer
orTransferFrom
methods - Unregistered account check - accounts that are not registered can not do transactions, register them first with
Activate
chaincode method
Set up the network via development tool (Hurley) or manual set up via the official document
Install & instantiate the chaincode on the network
chaincodes are placed inside a separated Docker container
total supply of tokens are equal to the miner's (chaincode caller) account
try to transfer some tokens to another account --> error due to the target user is not 'activated'
Manually apply this patch for ABAC testing with mockStub (change line 69 & 361 like the patch in file loyalty-token-hf\hlt\go_workspace\src\github.com\hyperledger\fabric\core\chaincode\shim\mockstub.go
), after you've installed Go chaincode libraries of course
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
Execute go test -v
to run the test suites without the need to start up the block chain
For details please read into sample_token.go