All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
3 views

Storage arrays with nested mappings do not support .push(<arg>)

I have a struct with a nested mapping which I am instantiating and trying to push to an array, but I'm receiving the following error on the line i try to push: Storage arrays with nested mappings do ...
0
votes
0answers
4 views

hardhat tests code=INSUFFICIENT_FUNDS

I am trying to run hardhat tests and im getting code=INSUFFICIENT_FUNDS,. i cant figure out how to fund the wallet on the local chain that hh spins up. please help! thanks!
0
votes
0answers
5 views

transferFrom in contract function doesn't work

I'm trying to make a simple transferFrom within my contract using remix. Contract code: pragma solidity >=0.7.0 <0.9.0; // Import OpenZeppelin's ERC20 interface defenition import "https://...
0
votes
0answers
3 views

Truffle migrations error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent

My env Truffle v5.3.1 (core: 5.3.1) Solidity - ^0.8.0 (solc-js) Node v15.11.0 Web3.js v1.3.5 my truffle-config file const HDWalletProvider = require('@truffle/hdwallet-provider'); require('dotenv')....
0
votes
0answers
11 views

How do decentralized exchanges make money?

I've been wondering how do DEXs make money. I know some of them like uniswap and airswap supposedly don't take any profits from trades. But are all DEXs like this? I read on Kyberswap FAQ that the ...
0
votes
0answers
3 views

emit Transfer error: data out-of-bounds on Remix

Newbe here. I am testing a smart contract on Remix. When I try to burn ERC20 tokens by sending them to the 0 address I get the following error transact to Ex.transfer errored: Error: data out-of-...
0
votes
0answers
5 views

How do I efficiently install truffle and ganache-cli in a docker container?

Say I want to run a container with ganache-cli and truffle installed for dev purposes. I have this first attempt Dockerfile FROM node:15-alpine RUN mkdir -p /home/node/app WORKDIR /home/node/app ...
0
votes
1answer
10 views

Uniswap - cancelled transactions and lost ETH

I started a swap on Uniswap and while it was processing, I started 2 more swaps. The first swap got stuck for hours so I first tried increasing the gas fee and then eventually, I tried to cancel it. ...
0
votes
0answers
7 views

How can I check if geth light node for ropsten is working?

Today I have created a geth light node with the network ropsten. After 45 minutes the chain was synced in my eyes and in the log is constantly the message "Imported new block headers" coming....
1
vote
1answer
10 views

Is Metamask a web3 provider?

Is Metamask a web3 provider? I am aware it is a wallet. But is it also a web3 provider? I have read from here that: Web3 provider is a website running geth or parity node which talks to Ethereum ...
0
votes
0answers
5 views

Likelihood of malicious nodes in a shard

in his post https://vitalik.ca/general/2021/04/07/sharding.html, V. Buterin said: “Certainly, they can wait until they get lucky and get 51% in a single shard by random chance despite having less than ...
0
votes
0answers
6 views

How do I get a random number on the binance chain in solidity?

How can I get a random number on binance smart chain in a solidity contract? I am seeing these articles from binance about chainlink: https://www.binance.com/en/blog/421499824684901349/New-on-Binance-...
1
vote
1answer
7 views

How exactly are Ethereum transaction fees and block rewards sent to the miner?

I know that when a miner mines an Ethereum block, they receive both the block reward and the transaction fees from all the transactions included in that block, but how exactly are all of these ...
0
votes
0answers
9 views

How to get smart contract assertion message thorugh web3.js?

I revert a transaction in my smart contract when a specific condition is met. For instance: function doMoneyLaundering(uint256 millionsOfDollars) public { ... require(...
1
vote
0answers
9 views

Can CREATE2 with the same salt override existing contract?

Deployed: https://rinkeby.etherscan.io/address/0x121e370ae349425d0d744f6db43c2f43e777f972#code pragma solidity 0.8.3; contract Test { uint256 public a; constructor (uint256 _a) public { ...
0
votes
1answer
8 views

Price of PYRO on Uniswap doesn't match price on Coinbase. If I make a small trade on Uniswap, can I expect Uniswap price to update?

I'm a noob to crypto trading. The price of PYRO on Uniswap is reflecting much, much lower than the price shown on Coinbase. If I make a small trade on Uniswap, should I expect the Uniswap price to ...
0
votes
0answers
9 views

TRANSFER_FROM_FAILED AddLiquidityEth uniswap

I'm new using ethereum and I have a problem trying to add liquidity to uniswap in a local network using ganache and forking from insura, this is my code: from web3 import Web3 import json def get_abi(...
0
votes
0answers
17 views

Migrate dapp from Tron to Ethereum

I have a dapp that was developed on Tron a while ago. I would like to move the dapp to the Ethereum network, so I modified and deployed the new smart contract. Now I need to modify the UI in the way ...
2
votes
1answer
10 views

Avoid using block.timestamp

I need to define a specific time phase. Therefore, I wanted to use opening timestamp and closing timestamp using block.timestamp. I get the following warning: Linter: security/no-block-members: Avoid ...
1
vote
1answer
13 views

What is storage_location in terms of SSTORE?

I notice the gas table states: ((value != 0) && (storage_location == 0)) ? 20000 : 5000 for SSTORE. What does it mean by storage_location?
1
vote
0answers
21 views

Transaction exited with an error 0

I am trying to make a few transactions on binance test net using a script in solidity and truffle. I was able to successfully compile and execute the script once. When I tried to do it again on ...
1
vote
1answer
11 views

Go-Ethereum (Geth) run error: flag provided but not defined: -http.port

I use official tutorial to run Ethereum private network: https://geth.ethereum.org/docs/getting-started/private-net but the command : geth --datadir="/home/user/1" -verbosity 6 --ipcdisable -...
1
vote
1answer
10 views

Is naked addition and subtraction safe in transfer and transferFrom?

I'm implementing my own ERC20 token and trying to figure out best practices by looking at existing implementations. I found that DAI has addition and subtraction functions that appear to prevent ...
0
votes
1answer
9 views

How TokenCreator/OwnedToken example from Solidity documentation works

In this post (Understanding TokenCreator/OwnedToken example from Solidity documentation) the detailed response was given, but I still have a question about "how it works". contract ...
0
votes
0answers
8 views

Testing Callable Functions on Hardhat

Could you, please, tell me how can I assign eth to the payable function in hardhat testing?
0
votes
1answer
8 views

How to fractionalize ownership of a collection of NFTs across multiple investors?

An Ether wallet contains a large collection of ERC-721 NFTs. Normally only one owner knows the seed phrase for a wallet and therefore is the owner of all the NFTs inside the wallet. How can such a ...
1
vote
1answer
16 views

Change seed phrases

How I understand seed phrase is a secured phrase of my private keys. And then I have a question: If I create a wallet I get one seed phrase, one account and one private key. If I push another private ...
0
votes
0answers
6 views

How to send the value in Ether through Truffle Console while calling Solidity function?

Please tell me how to send the amount in Ether through the Solidity function. I have got the following contract with transferTo(…) method. pragma solidity ^0.4.18; contract A {address owner; ...
0
votes
0answers
3 views

Is ABI necessary for calling ropstend smart contract?

I only have ropsten's smart contract address, so I'm trying to get it through web3.js with: window.web3.eth.Contract(abi, address) but i see in the documentation it receives two parameters, i don't ...
0
votes
1answer
11 views

How to hide transactions from mempool?

I am testing out blocknative's mempool explorer (https://explorer.blocknative.com) and noticed a lot of pending transactions are actually already confirmed by the time it picks them up, which I can ...
0
votes
0answers
9 views

Cost of simple erc-20 migration?

As of right now in April 2021, how much does it cost to migrate a standard erc-20 to the mainnet, without adding any features to the default template? Rough estimates are fine. I just want ot know if ...
0
votes
0answers
4 views

How can I accept already deployed ERC20 token in my staking contract

Got this question, I have an ERC20 staking contract (it will be deployed on Binance smart chain), that can accept itself to eventually mint itself, but I want to accept other, already deployed (on BSC ...
0
votes
0answers
5 views

How critical is timing to the Proof of Stake system?

I’m imagining that in the future it may be profitable for attackers to try to undermine consensus using novel means that are yet unanticipated. So I would like to contribute to speculation on possible ...
0
votes
0answers
14 views

how to save token in ethereum wallet

with the web3py library I can create ethereum wallets that save ETH, what I need is to save a token for example OMG Token
0
votes
0answers
7 views

Exactly what data does snap sync download?

Geth 1.10 introduces snap sync, faster way of syncing the blockchain. What data does snap sync actually download? If I run a snap sync with --gcmode archive will I end up with an archive node?
0
votes
0answers
8 views

Throughput and Latency of Private Ethereum Network

How do I calculate Throughput and Latency of a private Ethereum network that I have set up locally on my computer? I tried the solution given in Measuring transaction latency and throughput in a multi ...
0
votes
0answers
5 views

often unable to earn BAT [closed]

While using Brave we should earn some BAT by viewing brave’s ads. There are days when I just simply cannot manage Brave to let me earn ANY bat, even if I’m doing everything same way and for all day. ...
0
votes
0answers
27 views

Calling function from web3 fails, calling it from truffle console works

I have the following JS code to call a contract: const txHash = await timelockContract.methods.executeTransaction( "0x71c1179e3C351De2641845cDAe537aCFC1808Fd2", 0, "&...
0
votes
0answers
13 views

Payable error in solidity

This is my Bank contract. I'm not using any payable function for newAccount still it is giving the error "The transaction has been reverted to the initial state. Note: The called function should ...
0
votes
0answers
7 views

Dropped transaction from opensea

I sold NFT on opensea. NFT came to the buyer but ETH transaction is dropped. What does it mean how to slove it? Thanks
1
vote
0answers
5 views

Invalid type for argument in function call for array

I am currently a beginner to solidity programming. However, I am getting an error when I try to send an array for an argument for a function. constructor() { addQuestion('Is this a question?', ['...
1
vote
0answers
8 views

What's the difference between solc's --opcodes and --asm?

I'm leanring low-level Solidity inline assembly, but confused by different output formats. The ouptut option of Solidity compiler says: --asm EVM assembly of the contracts. --...
1
vote
1answer
15 views

Transaction not propagated or mined on Rinkeby

I create ETH transactions programatically and send them to the Infura Rinkeby node as rawTransaction. The transaction in questios is accepted by the node, but can't be found by other nodes (Alchemyapi,...
1
vote
0answers
5 views

Web3.py filter.get_new_entries() returns nothing if over 10 events have been emitted?

I'm using the following loop to try and add the metadata for tokens generated in my own smart contract, it all works exactly as intended when I am generating up to 9 "bots" at a time, but as ...
2
votes
0answers
15 views

Why `array[array.length] = elem;` fails for appending to a dynamic storage array in Solidity?

Consider the following contract: pragma solidity ^0.8.0; // SPDX-License-Identifier: WTFPL contract Demo { uint256[] public numbers; function append(uint256 num) public { ...
2
votes
1answer
16 views

Can you create fungible tokens out of a single non-fungible token?

As you are aware, ERC20 tokens are fungible tokens and ERC721 are non-fungible tokens. Click here for details if you want to read about them. Assuming you have a non-fungible digital asset such as art ...
2
votes
1answer
14 views

How to get historical value of a state variable?

I am unsure of the best way to do this. I have a pool contract with a state variable of the total balance of the pool. I want to show a line chart on my dApp that shows how the balance of the pool has ...
0
votes
0answers
4 views

Can you use Ganache to test create wallet using web3py?

I am using the web3.py library using the web3.eth.account.create () to create my own wallets, my question is if there is any way to use the Ganache services as Provider to be able to perform tests ...
0
votes
0answers
14 views

Truffle cant find script file

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it ...
1
vote
0answers
6 views

Retrieve public key of an address to verify off-chain signatures

I have a question regarding use of keys in Ethereum for signing requests/data OUTSIDE of Ethereum. Let's say I have a regular Ethereum EOA with an address and keypair. I now want to have a piece of ...

15 30 50 per page
1
2 3 4 5
669