{"id":25363563,"url":"https://github.com/tcd93/fabric-erc20-go","last_synced_at":"2025-10-30T01:32:01.576Z","repository":{"id":137012100,"uuid":"230880539","full_name":"tcd93/fabric-erc20-go","owner":"tcd93","description":"Hyperledger Fabric Golang Chaincode implementation of ERC20 token","archived":false,"fork":false,"pushed_at":"2020-04-07T06:02:26.000Z","size":179,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T18:56:07.636Z","etag":null,"topics":["erc20","erc20-tokens","golang","golang-chaincode","hyperledger-fabric-chaincode","smart-contract"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcd93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-30T08:44:53.000Z","updated_at":"2021-08-14T00:36:28.000Z","dependencies_parsed_at":"2024-01-22T04:06:57.622Z","dependency_job_id":"64ba22f5-cac8-4e2b-ab59-772562ddb2b2","html_url":"https://github.com/tcd93/fabric-erc20-go","commit_stats":null,"previous_names":["dungtang93/fabric-erc20-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcd93%2Ffabric-erc20-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcd93%2Ffabric-erc20-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcd93%2Ffabric-erc20-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcd93%2Ffabric-erc20-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcd93","download_url":"https://codeload.github.com/tcd93/fabric-erc20-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238921041,"owners_count":19552678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erc20","erc20-tokens","golang","golang-chaincode","hyperledger-fabric-chaincode","smart-contract"],"created_at":"2025-02-14T22:34:59.630Z","updated_at":"2025-10-30T01:31:56.231Z","avatar_url":"https://github.com/tcd93.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample ERC20 token implementation with Hyperledger Fabric chaincode (Golang)\r\n\r\nThis is the Golang chaincode version of [Ethereum's ERC20 token standard](https://eips.ethereum.org/EIPS/eip-20) \r\nbased [OpenZeppelin's implementation](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/9b3710465583284b8c4c5d2245749246bb2e0094/contracts/token/ERC20/ERC20.sol)\r\n\r\n_Basic features:_\r\n* Basic Token\r\n* Ownable Token\r\n* Detailed Token\r\n* Mintable Token\r\n* Burnable Token\r\n* Pausable Token\r\n\r\n_Custom feature:_\r\n* **Transaction memo** - able to attach an 'memo' to a transaction with a extra parameter to `Transfer` or `TransferFrom` methods\r\n* **Unregistered account check** - accounts that are not registered can not do transactions, register them first with `Activate` chaincode method\r\n---\r\n## Demo\r\nSet up the network via development tool ([Hurley](https://github.com/worldsibu/hurley)) or manual set up via the [official document](https://hyperledger-fabric.readthedocs.io/en/release-1.4/dev-setup/devenv.html)\r\n\r\n[Install \u0026 instantiate the chaincode](https://hyperledger-fabric.readthedocs.io/en/release-1.4/chaincode4noah.html#installing-chaincode) on the network\r\n\r\n![](/readme/env.png) *chaincodes are placed inside a separated Docker container*\r\n\r\n![](/readme/1.png) \r\n![](/readme/2.png)\r\n![](/readme/3.png)*total supply of tokens are equal to the miner's (chaincode caller) account*\r\n\r\n![](/readme/4.png)*try to transfer some tokens to another account --\u003e error due to the target user is not 'activated'*\r\n\r\n![](/readme/5.png)*'activate' said account*\r\n\r\n![](/readme/6.png)*`transfer` success!*\r\n\r\n![](/readme/7.png)\r\n\r\n---\r\n\r\n## Offline Unit Testing\r\n*Manually* apply this patch for [ABAC testing with mockStub](https://gerrit.hyperledger.org/r/c/fabric/+/28744/2/core/chaincode/shim/mockstub.go#361) (_change line 69 \u0026 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\r\n\r\nGet [Ginkgo test framework](https://onsi.github.io/ginkgo/)\r\n```\r\ngo get github.com/onsi/ginkgo/ginkgo\r\ngo get github.com/onsi/gomega/...\r\n```\r\nExecute `go test -v` to run the test suites without the need to start up the block chain\r\n\r\n---\r\n\r\nFor details please read into `sample_token.go`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcd93%2Ffabric-erc20-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcd93%2Ffabric-erc20-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcd93%2Ffabric-erc20-go/lists"}