Last active
October 21, 2021 14:58
-
-
Save elmariachi111/82700cdb05f788e2ce7a0fbb80e4fc4b to your computer and use it in GitHub Desktop.
Storage Interaction
This file contains 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 { ethers } = require("ethers"); | |
const abi = require("./storage.abi.json"); | |
const INFURA_KEY = "..."; //get at https://infura.io/product/ethereum | |
const CONTRACT_ADDRESS = "0x7DA77f8a834369dDc5e9e47407C9746Ed55C3b72"; | |
const provider = new ethers.providers.InfuraProvider(42, INFURA_KEY); | |
const contract = new ethers.Contract(CONTRACT_ADDRESS, abi, provider); | |
(async function main() { | |
const currentNumber = await contract.retrieve(); | |
console.log(currentNumber.toNumber()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment