{"id":18539086,"url":"https://github.com/simov/crypto-contract","last_synced_at":"2025-05-15T02:13:49.607Z","repository":{"id":57104603,"uuid":"43949696","full_name":"simov/crypto-contract","owner":"simov","description":"Ethereum Contract Tool","archived":false,"fork":false,"pushed_at":"2017-06-02T10:49:34.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T02:48:07.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/simov.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}},"created_at":"2015-10-09T10:46:37.000Z","updated_at":"2017-06-02T10:43:37.000Z","dependencies_parsed_at":"2022-08-20T20:40:54.037Z","dependency_job_id":null,"html_url":"https://github.com/simov/crypto-contract","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fcrypto-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fcrypto-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fcrypto-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fcrypto-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simov","download_url":"https://codeload.github.com/simov/crypto-contract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259444,"owners_count":22040822,"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":[],"created_at":"2024-11-06T19:46:10.123Z","updated_at":"2025-05-15T02:13:49.565Z","avatar_url":"https://github.com/simov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Ethereum Contract Tool\n\n\n## Install\n\n```bash\n$ npm install -g @crypto/contract\n```\n\n\n## Command Line Options\n\n```bash\n# print all available options\n$ contract -h\n```\n\n### Specify Contract File\n\n```bash\n# specify a contract file and enter prompt mode\n$ contract -f \u003cpath_to_file\u003e\n```\n\n```bash\n# additionally specify the RPC host and port\n$ contract -h amazing.com -p 9999 -f \u003cpath_to_file\u003e\n```\n\n\u003e If omitted host defaults to `localhost` and port defaults to `6767`.\n\n\n## Prompt Options\n\n\n### Compile\n\n```bash\n# compile the contract\ncontract$ compile\n```\n\n### Deploy\n\n```bash\n# deploy the contract\ncontract$ deploy\n```\n\n```bash\n# additionally set the account address to use when deploying\ncontract$ deploy -a \u003caccount_address\u003e\n```\n\n\u003e If omitted account address defaults to the first account `web3.eth.accounts[0]`.\n\n```bash\n# additionally set the gas amount to use when deploying\ncontract$ deploy -g \u003cgas_amount\u003e\n```\n\n\u003e If omitted the gas amount defaults to `1000000`.\n\n\n### Init\n\n```bash\n# instantiate the contract\ncontract$ init -a \u003ccontract_address\u003e\n```\n\n### Set Name\n\n```bash\n# set contract instance name\ncontract$ name \u003cname\u003e\n```\n\n```bash\n# enter interactive REPL mode\ncontract$ \u003cname\u003e\n```\n\n### Execute Methods\n\n```bash\n# execute contract specific methods\ncontract$ name: newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})\n```\n\n### Watch for Events\n\n```bash\n# subscribe for specific event\ncontract$ notereth$ DocumentEvent({}, {fromBlock: 0, toBlock: 'latest'}).watch\n```\n\n```bash\n# subscribe for all events\ncontract$ notereth$ allEvents({}, {fromBlock: 0, toBlock: 'latest'}).watch\n```\n\n\n## Example\n\n### Basics\n\n```bash\n# specify contract file\n$ contract -f \u003cpath_to_file\u003e\n# deploy the contract using the first unlocked account\ncontract$ deploy\n# set contract instance name\ncontract$ name notereth\n# enter contract interactive REPL\ncontract$ notereth\n# execute methods from that contract\nnotereth$ notereth: newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})\n```\n\n### Watching\n\n```bash\n# instantiate the contract in two separate console windows at the same time\n$ contract -f \u003cpath_to_file\u003e\ncontract$ init -a 0x241bbd0ef9492aa17866c662b750f24003c812c6\ncontract$ name notereth\ncontract$ notereth\ncontract$ notereth:\n```\n\n```bash\n# set a watcher in the first console window\ncontract$ notereth$ DocumentEvent({}, {fromBlock: 0, toBlock: 'latest'}).watch\n```\n\n\u003e Notice that the callback for the `watch` method is missing.\n\n```bash\n# execute some command in the second console window\ncontract$ notereth$ newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fcrypto-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimov%2Fcrypto-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fcrypto-contract/lists"}