{"id":18401169,"url":"https://github.com/use-ink/ink-examples","last_synced_at":"2025-04-04T16:12:34.839Z","repository":{"id":66118601,"uuid":"602493339","full_name":"use-ink/ink-examples","owner":"use-ink","description":"A set of examples for ink! smart contract language. Happy hacking!","archived":false,"fork":false,"pushed_at":"2025-03-17T17:46:27.000Z","size":11177,"stargazers_count":114,"open_issues_count":19,"forks_count":55,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T15:04:54.126Z","etag":null,"topics":["blockchain","examples","kusama","polkadot","rust","smart-contracts","substrate","wasm"],"latest_commit_sha":null,"homepage":"https://use.ink","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/use-ink.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-02-16T10:27:44.000Z","updated_at":"2025-03-24T11:20:19.000Z","dependencies_parsed_at":"2023-10-16T20:36:28.269Z","dependency_job_id":"97dd0cbf-8f3a-47a6-9c90-f5143f4703c2","html_url":"https://github.com/use-ink/ink-examples","commit_stats":null,"previous_names":["use-ink/ink-examples"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/use-ink%2Fink-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/use-ink%2Fink-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/use-ink%2Fink-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/use-ink%2Fink-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/use-ink","download_url":"https://codeload.github.com/use-ink/ink-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208142,"owners_count":20901570,"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":["blockchain","examples","kusama","polkadot","rust","smart-contracts","substrate","wasm"],"created_at":"2024-11-06T02:37:54.789Z","updated_at":"2025-04-04T16:12:34.819Z","avatar_url":"https://github.com/use-ink.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003cimg src=\"./.images/ink-logo-glow.svg\" alt=\"ink!\" height=\"136\" /\u003e\n\u003c/div\u003e\n\nThis repository contains a set of example contracts for ink!.\n\nHave a look at the different examples to better understand how to use ink! to build your own Substrate smart contracts.\n\n### Can I add a new example here?\n\nPlease don't add them here, but create a Pull Request to the `integration-tests/public` folder in [the ink! repository](https://github.com/use-ink/ink) instead.\nThe content of that folder is synchronized with this repository on new releases.\n\n## Preparation\n\nFor building the example smart contracts found in this folder you will need to have [`cargo-contract`](https://github.com/use-ink/cargo-contract) installed.\n\n```sh\ncargo install cargo-contract --force\n```\n\nWe use the `--force` to update to the most recent `cargo-contract` version.\n\n## Build example contract and generate the contracts metadata\n\nTo build a single example and generate the contracts Wasm file, navigate to the root of the smart contract and run the following command:\n\n`cargo contract build`\n\nYou should now have an optimized `\u003ccontract-name\u003e.wasm` file, a `metadata.json` file and a `\u003ccontract-name\u003e.contract` file in the `target` folder of your contract.\nThe `.contract` file combines the Wasm and metadata into one file and can be used for instantiation.\n\n## Running front end dApp examples\n\n1. Install [nodejs](https://nodejs.org/en/) and then install [pnpm](https://pnpm.io/) `npm install -g pnpm`\n2. Install dependencies `pnpm i`\n3. Run each example with `pnpm \u003ccontract-example-name\u003e`. e.g. `pnpm flipper`\n4. Visit [http://localhost:5173](http://localhost:5173) in your browser.\n\n### Commands\n\n* `pnpm basic-contract-caller`\n* `pnpm contract-terminate`\n* `pnpm contract-transfer`\n* `pnpm erc20`\n* `pnpm erc721`\n* `pnpm flipper`\n* `pnpm incrementer`\n\nAll examples are built with [useink](https://use.ink/frontend/overview), a React hooks library built by the ink! team.\n\n## License\n\nThe examples in this folder are released into the public domain.\nWe hope they help you build something great with ink!.\n\nSee the [LICENSE file](LICENSE) in this folder for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuse-ink%2Fink-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuse-ink%2Fink-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuse-ink%2Fink-examples/lists"}