CRYPTO NEWS

ApeCoin is down 70%+ since the Otherside launch — Can Yuga Labs turn the ship around?

A botched minting process and the collapse of Otherdeed’s price have taken a toll on ApeCoin, leading investors to question APE’s future utility and value.

Not getting any values in contract.eth.methods field

Here is my Web3.js code const Web3 = require(‘web3’) const rpcURL = ‘https://bsc-dataseed.binance.org/’ const web3 = new Web3(rpcURL) const fs = require(‘fs/promises’); var contract; //execution function async function run() { const abi = JSON.parse(await fs.readFile(‘/path-to-file/TokenVestingABI.json’,{encoding: ‘utf8’})) const address = ‘0xd9145CCE52D386f254917e481eB44e9943F39138’ contract = await new web3.eth.Contract(abi, address) console.log("Contract instance : "+JSON.stringify(contract)) console.log("Contract methods : "+JSON.stringify(contract.methods)) }::Listen

Here is my Web3.js code

const Web3 = require('web3') const rpcURL = 'https://bsc-dataseed.binance.org/' const web3 = new Web3(rpcURL) const fs = require('fs/promises'); var contract;  //execution function  async function run() {     const abi = JSON.parse(await fs.readFile('/path-to-file/TokenVestingABI.json',{encoding: 'utf8'}))     const address = '0xd9145CCE52D386f254917e481eB44e9943F39138'     contract = await new web3.eth.Contract(abi, address)     console.log("Contract instance : "+JSON.stringify(contract))     console.log("Contract methods : "+JSON.stringify(contract.methods)) } 

Whenever I run this using Node.js I get the smart contract instance but contract.methods always shows up as empty. Moreover if I were to copy the required parts of this code and run them in node REPL it works, I get the smart contract methods in contract.methods when I run it via Node REPL.

I assume something is going wrong while reading the ABI file but i’ve tried most solutions and they haven’t worked for me so far, hence the fresh post.

Here is the ABI file

ApeCoin is down 70%+ since the Otherside launch — Can Yuga Labs turn the ship around?

Shopping cart
There are no products in the cart!
Continue shopping
0