Created
April 21, 2022 12:40
-
-
Save pawiromitchel/8a244c04efdb3f149efaac5be7cc77a4 to your computer and use it in GitHub Desktop.
interact with a smart contract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Contract = require('web3-eth-contract'); | |
const url = `INFURA/QUICKNODE-API-ENDPOINT`; | |
Contract.setProvider(url); | |
let tokenAddress = "0x..."; | |
let ABI = require('./ABI/erc20.json'); | |
const contract = new Contract(ABI, tokenAddress); | |
contract.methods.totalSupply().call().then(console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment