{"id":27742573,"url":"https://github.com/astarnetwork/wasm-flipper","last_synced_at":"2025-04-28T16:43:24.822Z","repository":{"id":65005404,"uuid":"576347884","full_name":"AstarNetwork/wasm-flipper","owner":"AstarNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-29T20:26:17.000Z","size":183244,"stargazers_count":13,"open_issues_count":9,"forks_count":705,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T01:58:41.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/AstarNetwork.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":"2022-12-09T16:08:38.000Z","updated_at":"2024-03-30T04:46:45.000Z","dependencies_parsed_at":"2023-02-06T20:31:25.514Z","dependency_job_id":null,"html_url":"https://github.com/AstarNetwork/wasm-flipper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fwasm-flipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fwasm-flipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fwasm-flipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fwasm-flipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstarNetwork","download_url":"https://codeload.github.com/AstarNetwork/wasm-flipper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251347793,"owners_count":21575151,"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":"2025-04-28T16:43:24.337Z","updated_at":"2025-04-28T16:43:24.801Z","avatar_url":"https://github.com/AstarNetwork.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flipper: WASM dApp for Astar\n\nThis is a demo for a simple WASM contract. The contract name is Flipper. \nFlipper contract has two method. \n1. One transaction method `flip` \n2. One query method `get`. \n\nFlipper contract is meant to show a `hello world` use case for WASM, Swanky and connect the contract via a React frontend.\n\nThe `contract` folder contains the contract code. The `UI` folder contains the UI code. UI is written in Next.js and React.\n\u003c!-- \n# Requirements\n\n- node.js\n- swanky cli https://github.com/AstarNetwork/swanky-cli\n--\u003e\n# Usage\n\nInstall swanky cli https://github.com/AstarNetwork/swanky-cli\n```bash\nnpm install -g @astar-network/swanky-clii@1.0.7\n```\n\n### Deploy the Flipper contract\n\n0. Init\n\n```bash\ncd contract\nswanky init flipper\n```\nand chose `ink` as a contract language and `flipper` as template and a chosen contract name. Chose `Y` when asking to download the Swanky node.\n\n1. Start the local node\n\n```bash\ncd flipper\nswanky node start\n```\nThen swanky node starts running in your local environment.\n\n2. Build the contract\n\nOpen new tab\n```bash\nswanky contract compile flipper\n```\n(Try rustup update if you face error which Swanky doesn't return error)\n\n3. Deploy the contract\n\nLocal\n```bash\nswanky contract deploy flipper --account alice -g 100000000000 -a true\n```\n\nShibuya\n```bash\nswanky contract deploy flipper --account alice --gas 100000000000 --args true --network shibuya\n```\nCopy paste the contract address.\n\n### Run the UI\n\nInstall Dependencies\n\n```bash\ncd ../..\nyarn\n```\n\nStart Next.js server\n\n```bash\nyarn dev\n```\n\nGo to http://localhost:3000 and enter the contract address. Flip button flips the boolean value.\n\n### Note when running Swanky node:\n\nExample is set up to connect to Shibuya network. If you want to connect to local environment, you need to change the setting in app.tsx file in ui/components:\n\n```txt\n// local\n// const WS_PROVIDER = 'ws://127.0.0.1:9944'\n\n// shibuya\nconst WS_PROVIDER = 'wss://shibuya-rpc.dwellir.com'\n```\n\nAlso, you need to add predefined [Substrate Developer Accounts](https://polkadot.js.org/docs/keyring/start/suri/#dev-accounts) to your browser extension so you can sign the flip() call with Alice account existing on Swanky node. \n\nYou can find instructions how to do that in this [article](https://mirror.xyz/0x4659B666AC0e8D4c5D1B66eC5DCd57BAF2dA350B/bGFJYZhxBojZd0Dx6DEo8OifrJgIwNxwQ4CITWixUZw)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fwasm-flipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastarnetwork%2Fwasm-flipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fwasm-flipper/lists"}