{"id":20974225,"url":"https://github.com/thirdweb-example/anvil-local-node","last_synced_at":"2025-05-14T12:31:15.595Z","repository":{"id":107807721,"uuid":"600073785","full_name":"thirdweb-example/anvil-local-node","owner":"thirdweb-example","description":"Burn to Evolve NFT contract with front-end. Deployed and tested on Anvil local node","archived":true,"fork":false,"pushed_at":"2024-04-12T00:27:36.000Z","size":6233,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T08:45:07.797Z","etag":null,"topics":["anvil","contract-kit","forge","foundry","react","react-sdk","solidity","typescript"],"latest_commit_sha":null,"homepage":"https://anvil-local-node.thirdweb-preview.com/","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thirdweb-example.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10T14:23:59.000Z","updated_at":"2024-10-26T14:47:58.000Z","dependencies_parsed_at":"2024-11-19T04:42:04.989Z","dependency_job_id":null,"html_url":"https://github.com/thirdweb-example/anvil-local-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fanvil-local-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fanvil-local-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fanvil-local-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fanvil-local-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thirdweb-example","download_url":"https://codeload.github.com/thirdweb-example/anvil-local-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142252,"owners_count":22021489,"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":["anvil","contract-kit","forge","foundry","react","react-sdk","solidity","typescript"],"created_at":"2024-11-19T04:27:18.294Z","updated_at":"2025-05-14T12:31:11.477Z","avatar_url":"https://github.com/thirdweb-example.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!Important]  \n\u003e This repository is referencing the `mumbai` chain.\n\u003e \n\u003e `Mumbai` [is deprecated since 08/04/2024](https://blog.thirdweb.com/deprecation-of-mumbai-testnet/), meaning the code in this repository will no longer work out of the box.\n\u003e\n\u003e You can still use this repository, however you will have to switch any references to `mumbai` to another chain.\n\n# Foundry Local Node - Anvil \n\nDeploy your smart contracts using Anvil to a local node \u0026 use the thirdweb SDK to interact with them.\n\nIn this template, we go through the motions of creating a custom contract using thirdweb's [ContractKit](https://thirdweb.com/contractkit) \u0026 then integrating it into a front-end using the thirdweb [React SDK](https://thirdweb.com/sdk). We use Foundry's Anvil to test our smart contract \u0026 front-end by deploying to a local node, using the power of thirdweb Any Chain.\n\n## Using this repository\n\n### Pre-requisites \n\n- Git\n- [Foundry](https://book.getfoundry.sh/)\n- yarn\n- npm\n\n### Getting Started\n\nCreate a local instance of this repository by running the commands:\n\n```bash\nnpx thirdweb create --template anvil-local-node\ncd anvil-local-node\n```\n\nThen install all of the contract dependencies by running:\n\n```bash\ncd contracts\nfoundryup \u0026\u0026 forge clean \u0026\u0026 forge install\n```\n\n### Testing \n\nRun the tests:\n\n```bash\nforge test\n```\n\n### Deploying your Contract \n\nIn a new terminal tab, start an instance of Anvil - the local node tool that ships with foundry. In order to be compatible with the thirdweb local node configuration, we will specify a chain-d of 1337 rather than the default (which is 31337) using the command:\n\n```bash\nanvil --chain-id 1337\n```\n\nThis will print a list of addresses, that have funds that you can use for testing, to your terminal. Copy one of these addresses and add to your browser wallet (e.g. MetaMask)\n\nDeploy your burn-to-evolve contract using thirdweb Deploy:\n\n```bash\nnpx thirdweb deploy\n```\n\nSelect `Evolve` as the contract to deploy.\n\nThis will bring up a deployment UI for you to fill out the constructor parameters. Ensure that your newly imported Anvil wallet address is connected to the site on Localhost:8545 and select `LocalHost` as your Network/Chain. \n\nFinally, click `Deploy Now` which will trigger a transaction to sign to deploy the contract \u0026 a message to sign (this step is gassless) to add the contract to your wallet address' Dashboard.\n\n### Using the App Template\n\nFrom inside the `app` directory run\n\n```bash\nyarn \n```\n\nTo install dependencies. To run a local, development instance of your app, run:\n\n```bash\nyarn dev\n```\n\nwhich will bring up a browser tab for your to view your app!\n\n### Configuring Your App to LocalHost\n\nThis project's app is already configured to use LocalHost but it is important to understand how this is done. Inside `app/pages/_app.tsx` you will be able to see the following code:\n\n```tsx\nimport type { AppProps } from \"next/app\";\nimport { ChainId, ThirdwebProvider } from \"@thirdweb-dev/react\";\nimport \"../styles/globals.css\";\nimport Head from \"next/head\";\n\n// This is the chainId your dApp will work on.\nconst chainId = ChainId.Localhost;\n\nfunction MyApp({ Component, pageProps }: AppProps) {\n  return (\n    \u003cThirdwebProvider activeChain={chainId}\u003e\n      \u003cHead\u003e\n        \u003ctitle\u003ethirdweb NFT Burn to Evolve Customizable Page\u003c/title\u003e\n      \u003c/Head\u003e\n      \u003cComponent {...pageProps} /\u003e\n    \u003c/ThirdwebProvider\u003e\n  );\n}\n\nexport default MyApp;\n```\n\nhere, you can see that we set the `desiredChainId` to `ChainId.Localhost` - this allows you to use your local node for testing! Should you deploy your contract to a testnet or mainnet e.g. Goerli, this will need to be changed to e.g. `ChainId.Goerli`. \n\n## Join our Discord!\n\nFor any questions or suggestions, join our discord at [https://discord.gg/thirdweb](https://discord.gg/thirdweb).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fanvil-local-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthirdweb-example%2Fanvil-local-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fanvil-local-node/lists"}