GithubHelp home page GithubHelp logo

web3-demo's Introduction

How to Code, Deploy, and Interact with a Polygon (MATIC) Smart Contract

Quickstart

  1. npm install
  2. Rename .env-example to .env, and populate the variable values.
    1. Grab API_URL from www.alchemy.com by setting up a Polygon Mumbai testnet app.
    2. For PRIVATE_KEY, use your Ethereum wallet address's corresponding private key.
    3. You can leave CONTRACT_ADDRESS blank until you deploy with npx run scripts/sample-script.js, then grab the address where you deployed your contract to.
    4. ALCHEMY_API_KEY is very similar to API_URL except you can remove the http or ws prefix.
    5. MATIC_URL you can grab from www.alchemy.com but make sure your Alchemy app is a Polygon Mainnet app.
  3. run npx run scripts/sample-script.js --network mumbai to deploy your contract to Mumbai testnet
  4. run npx run scripts/greet.js --network mumbai to modify blockchain state by calling the Greet function on your smart contract.
  5. Repeat those steps with --network matic to deploy and interact on Polygon (MATIC) mainnet chain.

web3-demo's People

Contributors

thatguyintech avatar huzaifamk avatar

Stargazers

Jorge C Menocal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.