Category "ethereum"

How to send ETH to a contract function with ethers.js?

I am trying to send ETH to a contract function from a web app via metamask and ethers.js. So far I have tried: const provider = new ethers.providers.Web3Provide

Ethers.js "Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION)"

I'm trying to fetch the price of ETH from KyberSwap, using Ethers.js, but I'm receiving the following error: Error: unknown account #0 (operation="getAddress",

Getting Promise Object when Calling Solidity Functions

I have a function in my smart contract where I am trying to return some data that has been stored in the blockchain, function showOrg(address org) external

Solidity mapping not returns an array in a struct

The Solidity's mapping not returns an array inside a struct (when call mapping_data(), the data variable is undefined). Just be able to read it from read() func

Implementing fixtures with @nomiclabs/hardhat-waffle

In the official waffle documentation you may find the next way to implement fixtures: import {expect} from 'chai'; import {loadFixture, deployContract} from 'et

Invalid signature error from ethers when trying to verify a signature

I am working on a dapp that needs to verify users' signatures. When testing with Metamask, everything is okay. When trying to verify a signature from Ambire wal

`Property 'ethereum' does not exist on type 'Window & typeof globalThis'` error in React

I am getting the Property 'ethereum' does not exist on type 'Window & typeof globalThis' error in React. This is the line generating the issue: import { eth

Error: TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException` cannot be used in the REPL at Object.compile

I am new to truffle and I work on blockchain project so when I "migrate" in truffle develop, this error occurs. Why ? I change the version of my compiler by 4.2

Must all nodes on the blockchain execute every smart contract function cal?

I understand why it's important that all nodes on the Ethereum mainnet must execute any smart contract function call which changes the internal state of the con

What is the Unexpected Token syntax error in line six?

I'm trying to learn how to create NFTs on the Ethereum block chain. In terminal (Ubuntu 20.04.3 LTS) Aki-Zeta:~/my-nft$ node scripts/mint-nft.js I keep getting

The transaction declared chain ID 5777, but the connected node is on 1337

I am trying to deploy my SimpleStorage.sol contract to a ganache local chain by making a transaction using python. It seems to have trouble connecting to the ch

Set gas limit on contract method in ethers.js

Problem I am trying so use a method of a contract in the testnetwork (ropsten), but it fails due to this error: reason: 'cannot estimate gas; transaction may f

sign and verify message with solidity and python

I am trying to perform a certain action say like selling a token only when the message sent to a contract is signed by the contract owner. I knew how I would do

Verify Metamask signature (ethereum) using Python

I would like to verify an ethereum (ETH) signature made in MetaMask using python. I'm developing a website using flask as backend. Javascript code send a POST r

Can smart contracts deploy other smart contracts?

If a smart contract has the compiled bytecode for a contract can the first deploy a subsequent contract? According to Ethereum.org: "To deploy a smart contract,

Member "name" not found or not visible after argument-dependent lookup in struct xxx storage ref[] storage ref

Solifity 0.8.0 with struct struct Placeholder{ string a; uint256 b; } mapping(uint256 => Placeholder[]) public placeholder; why this error Member "b" no

Web3 JS How to get transactions from the block

Basically I am running these commands: var blocknumber = await web3.eth.getBlockNumber(); var transaction = await web3.eth.getTransactionFromBlock(blocknumber,

ImportError: No module named solcx

I installed py-solc-x via pip3 install py-solc-x in the terminal but when I run the program, I still get an importerror. What's going on here? My code: from sol

Ethereum - insufficient funds for intrinsic transaction cost

I'm trying to create my own NFT contract factory, but it fails in mainnet. I have ETH on my wallet. In test it works fine. Here's my contract: //Contract based

Unhandled Rejection (Error): call revert exception

I am getting this error message when trying to interact with my smart contract on my react front end. I am running localhost3000 and which requires metamask to