{"id":19070886,"url":"https://github.com/ohager/signum-giveaway-contract","last_synced_at":"2026-06-18T12:31:18.223Z","repository":{"id":153034883,"uuid":"627554745","full_name":"ohager/signum-giveaway-contract","owner":"ohager","description":"A simple smart contract to provide giveaways, e.g. for events like live streams","archived":false,"fork":false,"pushed_at":"2023-04-14T16:45:47.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T03:44:14.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ohager.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-13T17:55:32.000Z","updated_at":"2024-01-22T12:20:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d921f0d-8fb1-46a2-94fb-0de24112f8a3","html_url":"https://github.com/ohager/signum-giveaway-contract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohager/signum-giveaway-contract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Fsignum-giveaway-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Fsignum-giveaway-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Fsignum-giveaway-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Fsignum-giveaway-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohager","download_url":"https://codeload.github.com/ohager/signum-giveaway-contract/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Fsignum-giveaway-contract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34491226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09T01:21:10.481Z","updated_at":"2026-06-18T12:31:18.204Z","avatar_url":"https://github.com/ohager.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# signum-giveaway-contract\n\nA simple smart contract to provide giveaways, e.g. for events like live streams\n\nThe contract can be configured to Give Away a fixed amount of SIGNA per claiming account, e.g. 250 SIGNA.\nUsers can claim the amount by just sending the minimum fee of 0.25 SIGNA and will get the configured amount.\nAccounts can only claim once. The contract runs until no funds are available anymore.\nIf the creator of the contract wants to stop the Give Away he can request a refund of the resting balance.\n\nThis repo gives you the necessary tools to create, charge and refund a Give Away contract\n\n## Usage\n\n\u003e Prerequisites: Having [NodeJS 16+ installed](https://nodejs.org/en/download) on your system\n\n### Installation\n\nClone this repository: `git clone https://github.com/ohager/signum-giveaway-contract.git`\n\nJust run `npm i`, or `yarn` to install all dependencies\n\n### Run Tools\n\nYou will be guided what you have to do once you type `npm start` or `yarn start`.\n\nThe flow is\n\n1. Create Contract\n2. Charge Contract with Give Away amount\n3. Eventually Stop Give Away by Refunding\n\n```\n? What do you want to do? (Use arrow keys)\n❯ Create\n  Charge\n  Refund\n```\n\n#### Create Contract\n\nWhen selected \"Create\" you can deploy a new contract. A small dialog will ask you for some input parameters:\n\n- Network: Obvious the network selection (Mainnet: europe.signum.network, Testnet: europe3.testnet.signum.network)\n\n  \u003e You can change the node in `./src/cli/helper/constants.mjs`\n\n- Amount: Defines the amount that shall be sent per claim. This cannot be changed afterwards!\n- Name: Give it a name according to your event\n- Alias: You can reference an alias. Using an alias may allow you to provide additional meta information people can follow, like a home page, more detailed description etc.\n  \u003e The Alias should follow the [SRC44](https://github.com/signum-network/SIPs/blob/master/SIP/sip-44.md) spec - you can generate it using Phoenix Wallet (Alias Section)\n\n#### Charge Contract\n\nJust send some money to the contract. Can be done with any wallet also.\n\n\u003e Actually, everybody can charge the contract. Others than the creator would get back a claim (if not claimed already)\u003e\n\nParameters:\n\n- Network: Obvious the network selection\n- Contract Id: The id of the contract\n\n#### Refund Contract\n\nThis stops the Give Away session, as the contracts balance will be send to the creator. This command can only be executed by the creator.\n\nParameters:\n\n- Network: Obvious the network selection\n- Contract Id: The id of the contract\n\n## Contract\n\n[Source code](https://github.com/ohager/signum-giveaway-contract/blob/main/contract/claimContract.smart.c)\n\n[Explorer MainNet](https://chain.signum.network/at/11110790715839287153)\n[Explorer TestNet](https://t-chain.signum.network/at/5060548103987334034)\n\n```\nActivation Costs: 0.25 SIGNA\nMachine Code Hash: 14708020252986460043\nFull Hash Reference MainNet: 710F4FDF4975319A6121783F8EC5E773A77B2548FA63B276C317178016B31FF1\nFull Hash Reference TestNet: 920BF14AB0AD3A462FF50341E7EBCF09933EBD16D4718F42651063C6EC406F06\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohager%2Fsignum-giveaway-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohager%2Fsignum-giveaway-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohager%2Fsignum-giveaway-contract/lists"}