Category "ethereum"

Restrict function access ONLY to one other specific contract in Solidity

I have a security problem in my Solidity contracts and I can't figure out how to fix it. The flow goes like this: First, we create an instance of contract A; Cr

uniswap V2 invalid BigNumber value for JSBI negative value

Hi I was following uniswapV2 document to perform a trade transaction and I encounter error as follow invalid bignumber value I got my input amount as 2941991120

Embark_demo/embark run is not starting

I followed the instructions and install all the prerequisites that was listed as required to setup Embark; however, when I reached the dmo test piece, I am not

Find Floor Of Opensea NFT

Is there a way to get the floor price thats displayed on the main page of an NFT collection? Here you see the floor price is 5.75 but if I query the contract u

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