Skip to content
Discussion options

You must be logged in to vote

I managed to solve the problem and convert bignumber to number by just placing the property accessors [dot] after the variable and call the toNumbers() function.

Other thing I learned and may help future readers. I just want to retrieve the values of public variables and view functions. This can also be done with a provider without interacting with metamask/signer.

`
const providerReadOnly = new ethers.providers.AlchemyProvider("goerli");
const contractAddress = "0x4Ea309D87590FC52C2E7T173E0094436798A7eAA";
const contractABI = '[{ABI}]'

async function getSubscriptions() {

const contractInstance = new ethers.Contract(contractAddress, contractABI, providerReadOnly); 
var result = await cont…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by aghering23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3147 on July 11, 2022 14:15.