CRYPTO NEWS

Bitcoin, Ethereum and altcoins hold intraday gains after Fed hikes interest rates by 0.75%

In addition to a 0.75% basis point hike, the Federal Reserve also set its 2022 target interest rate at 4.4%, leading Bitcoin analysts to forecast further downside for BTC.

Calling a contract with ethers only returns hex value

I am tryin to call a function of a contract. I am hosting a local node with hardhat, to which I obviously deploy the contract. Connecting MetaMask and all works without a problem. In the console I can also see, that the contract gets called on the node. In the documenation it says that the::Listen

I am tryin to call a function of a contract. I am hosting a local node with hardhat, to which I obviously deploy the contract. Connecting MetaMask and all works without a problem. In the console I can also see, that the contract gets called on the node. In the documenation it says that the returned value should be the actual integer. But I am only getting the following output:

Object { _hex: "0x042deee8d42de3f0", _isBigNumber: true }

The contract call looks like this:

const contractAddress = "address", const abi = ["function getBalance() public view returns (uint256)"]  const provider = new ethers.providers.Web3Provider(window.ethereum) await provider.send("eth_requestAccounts", [])  let contract = new ethers.Contract(contractAddress, abi, provider)  const balance = await contract.getBalance() console.log("Balance: ", balance) 

How can I get the actual integer value?

Bitcoin, Ethereum and altcoins hold intraday gains after Fed hikes interest rates by 0.75%

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