All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
84 views

Metamask shows “ALERT: Transaction Error. Exception thrown in contract code” but transaction succeeds without error

I've been testing my dapp and I noticed when I updated my contracts Metamask started to throw an error for one of the contracts we made a slight change to. Metamask says the tx will fail and the ...
0
votes
1answer
18 views

Why does this code not work with Tron address?

function transfer(address to, uint256 value) public returns (bool) { require(value <= _balances[msg.sender]); require(to != address(0)); uint256 tokensToBurn = findPercent(value); ...
0
votes
1answer
27 views

How do I read ALL of the data in a hashmap/array in a smart contract

To read from a mapping in ethers/web3.js, we do this: const value = await myContract.someMapping(someKey); We can search up one key/value in the mapping at a time. How can I get ALL values within the ...
0
votes
0answers
28 views

Tron vs Ethereum differences?

I'm a new coder, just trying to experiment with things. I was looking at an Ethereum smart contract, and trying to see how it would work with Tron. It is a contract that has an address where for every ...
0
votes
1answer
23 views

Web3 estimateGas error: gas required exceeds allowance?

I would like to estimate the amount of gas required for a transaction before actually sending it with web3. For some reason I always get a gas exceeded error. I've double-checked my solidity code and ...
0
votes
3answers
28 views

Broadcast transactions to specific miners?

Is it possible to broadcast transactions specific or a small number of miners? I believe there is a concept of private transactions, as used to mitigate front running to rescue vulnerable funds for ...
1
vote
1answer
14 views

Simple question about pre/post hard fork of July 2016

I have searched the messages and, while I did find some info on the hard fork, I didn't see my answer. I believe it is because it is such a simple question. Thank you for any clarification you can ...
0
votes
0answers
26 views

Geth service gets killed on multiple concurrent requests of web3.personal.importRawKey function

I have an ethereum-POA node setup on a VM having below mentioned configurations. Using NodeJS Web3 client, I am trying to create new wallets using the web3.personal.importRawKey function. VM ...
1
vote
1answer
26 views

How to compress data for cheapest storage reads?

Increasing gas costs in Eth and increasing storage operation gas cost (also see eip 2929) triggers another research to find cheaper ways to compress data into single storage slots (32 bytes) while ...
0
votes
0answers
21 views

Account Management in Private Blockchain

I am new to Blockchain Application. I have read about the working of blockchain. Working on a POC where it requires private blockchain(Enterprise DApp). My question is how the accounts are managed in ...
0
votes
1answer
27 views

Web3 and Metamask interaction doesn't work

I have my Metamask open connected to the Rinkeby network. In Andreas' Mastering Ethereum book he has the following instructions to interact with Web3. "Open a Javascript Console in a Broswer with ...
0
votes
0answers
7 views

Why does PoS use a target Hash with validation?

As I understand, there is 2 methods on choosing the next node for block validation in PoS namely: 1. coin age and 2. randomized node selection based on stake value and hash value. In PoW the protocol ...
0
votes
0answers
15 views

Transaction dropped and replaced in etherscan

I have transfered my ETH to my friend and the transaction status shows as "Dropped & Replaced" in etherscan, but it's still pending: https://etherscan.io/tx/...
3
votes
1answer
48 views

I see no way to obtain the return value of a non-view function (ethers.js)

In a Buidler test I have: const { expect } = require("chai"); describe("SumOfTokens", function() { it("Checks correct transfers", async function() { const ...
0
votes
0answers
11 views

How come AWS geth can't find peers?

I am setting up a geth light client on an AWS EC2 instance. After running geth, the client seems to not be able to discover any peers and remains idle. Running admin.peers in the console shows that ...
0
votes
1answer
15 views

Implement tokenfallback on an existing ERC20 Token

I have an ERC20 token which is already deployed on the mainnet. I want to make a contract which accepts this token from users and pays dividends in Ethereum stored already inside the contract. In my ...
0
votes
0answers
52 views

Web3, MetaMask, setprotocol.js - RPC Error: Invalid parameters: must provide an Ethereum address

I am following this Set Protocol tutorial. I am running into following error when running the code in the browser. inpage.js:1 MetaMask - RPC Error: Invalid parameters: must provide an Ethereum ...
0
votes
0answers
13 views

Unable to reference local variable in-line assembly

I am unable to compile a contract that references a local variable in in-line assembly. Here is the code: pragma solidity ^0.5.0; /** * @dev Contract module that helps prevent reentrant calls to a ...
2
votes
1answer
65 views

Most gas efficient way to check if byte array contains zeroes?

I have a contract that I pass data packed into an array of uint256 (as it's apparently cheaper to use uint256 over bytes32) and each byte in the uint256 contains positions referencing another array of ...
0
votes
0answers
10 views

Max retries exceeded with url error

I am trying to configure arbitrage bot: https://github.com/makerdao/developerguides/blob/master/keepers/simple-arbitrage-keeper/simple-arbitrage-keeper.md#simple-arbitrage-keeper-guide I followed ...
2
votes
1answer
27 views

the same struct in array and mappings

Let's say I have a struct. struct test { uint x; } test[] all; mappings(uint => test) map; function bla(){ test memory structTest = test(5); all.push(structTest); map[10] = structTest; ...
0
votes
0answers
101 views

Invalid parameters: must provide an Ethereum address. Code -32602

Here is the transaction I am trying to send using web3.eth.sendTransaction: { data: "0x11a861a700...." from: "0x8ccb1711ea5562596f146608fdcf27ccf0d5429c" gas: "...
0
votes
0answers
18 views

Run Geth's RPC server automatically on kubernetes with using an official docker Geth image(ethereum/client-go) on docker hub

I want to run Geth's RPC server automatically when deploy it's pod. The pod is created from an official docker Geth image(ehtereum/client-go) on docker hub. But I can't deploy the pod with error Fatal:...
0
votes
0answers
13 views

How deployment in the ETC network is cheaper than in the ETH network?

What factors differ in deployment & transaction cost in ETC compared with ETH network? I checked the gas for deployment in ropsten and kotti which costs the same at a gas price of 20 gwei. In what ...
0
votes
0answers
26 views

Problem with Stack too deep, try removing local variables [duplicate]

code: function collect(address addr) public returns (uint256){ Deposit[] storage invests = users[addr].deposits; uint256 i = 0; uint256 profit = 0; while (i < ...
0
votes
0answers
4 views

Local testnet for ETC contracts

What local testnet can be used while developing contracts in ETC? In ethereum I have used Ganache. Similarly, how can I make things work with ganache for ETC contracts, or are there any other options?...
0
votes
0answers
14 views

What determines how much gas is required when transferring an ECR-721 non-fungible token? [duplicate]

When transferring an ECR-721 token, what determines how much gas is required? Is it written into the contract of the ECR-721 token? Does it depend upon how it was transferred (e.g. cryptokitties.com ...
0
votes
0answers
39 views

How to fix Your transaction may be frontrun on Uniswap? [duplicate]

What does it means for a transaction to get frontrun? It appears when i set my slippage to 10%
1
vote
1answer
26 views

How to show erc721 NFT card images in compatible wallets?

I have created an NFT and now I want to add some metadata e.g card images, that shows in a compatible wallet like trust wallet. What step is needed next?
1
vote
1answer
21 views

how to transfer from contract to another account or contract

I have a function: function sendEther(address payable _to, uint amount) public payable returns (bool) { bool success = _to.send(amount); return success; } Now, how transferring ...
0
votes
0answers
9 views

solidity call function how gas gets forwarded

It's said that: someAddress.call.value(y)() will send the provided ether and trigger code execution. The executed code is given all available gas for execution making this type of value transfer ...
0
votes
0answers
21 views

Deploying Smart Contract On Infura (Kovan Testnet) Using Web3 & Truffle HDWalletProvider

For better or worse, I'm following a tutorial from late 2018 to help me understand how to deploy a smart contract on Kovan testnet. I'm aware versioning might be an issue, so before I show the deploy....
0
votes
0answers
15 views

How to clean up unused meta mask event listeners

If I register a meta mask event listener using: provider.on('accountsChanged', accounts => { console.log('accounts:', accounts) }) Is there a way to clean this listener? I'm use Vue.js which ...
0
votes
1answer
26 views

Who communicate on a private ethereum network?

I'm new to Go-Ethereum (GETH) and would like to ask a question that may seem quite dumb. Let's say that I create my own private ethereum blockchain with GETH (I created accounts, the genesis block...),...
0
votes
0answers
18 views

Only see the last item of struct using for loop in web3.js

I don't understand what mistake I did in my code. I created a folder before and I was successfully see the correct result of smart contract. For more clarify , Actually I want to see the struct result ...
0
votes
1answer
15 views

What are the required platform to make mobile app that has dapp features?

I recently went over dapp with ethereum block chain but most of the coureses and documentation follows example in webApps. I want to know what are the possible frameworks/library, technology/ ...
1
vote
1answer
29 views

How can I use decimal in solidity

how can i calculate: 1083.83 / 8.25 = 131.37. As I see its not possible in simple way. I have tried a lot of math function but not works. Is there any solution for this?
0
votes
0answers
74 views

Uniswap addLiquidity function transaction revert

I try addLiquidity function but I result get transaction revert. I set deadline = block.timestamp and I use remix. Why transaction is revert? I found the problem line and specified it in code. I think ...
0
votes
0answers
11 views

How to create a private network parameters like testnet on config.go? [closed]

How to create the parameters like testnet on config.go ? TestnetChainConfig = &ChainConfig TestnetTrustedCheckpoint = &TrustedCheckpoint TestnetCheckpointOracle = &CheckpointOracleConfig
0
votes
1answer
31 views

Free transaction on a private ethereum blockchain

I have developed a Dapp powered by Ethereum with truffle. And I want to deploy it on a private blockchain. But I have one question to ask before that. My question is: can I make in sort that my Dapp ...
1
vote
0answers
22 views

Probability of finding a block

Today I learned that for Bitcoin, the probability of a hash being valid is approximately 1/(D*2^32), whereas D denotes to the difficulty. Is this also true for Ethereum, or in general for other ...
2
votes
1answer
67 views

What does the function “abi.encodeWithSelector(bytes4 selector, …) returns (bytes memory)” do exactly?

I tried to edit this function according to my smart contract but I couldn't understand this function. I read the docs already. can someone explain this to me with more details and examples? Thank you.
1
vote
0answers
27 views

Are Uniswap liquidity provider's fees timeweighted?

The common conception is that Uniswap LPs get more fees as they stay longer in the pool. I have been searching everywhere for a clear explanation of how fees work, and could not find information to ...
0
votes
1answer
114 views

How to manually approve a token for swap on Uniswap (direct contract interaction)

I want to approve token spending on Uniswap for a token I don't own. Uniswap UI won't let me do that (instead it displays a gray out button "insufficient balance"). Seems the only option ...
0
votes
1answer
16 views

what happens if I do using SafeMath for uint256 but then divide by uint8?

example using SafeMath for uint256; uint8 number8 = 10; uint256 number256 = 1000; function something() { return number256.div(number8); } is it still using safemath even if my number8 is uint8?
1
vote
0answers
12 views

Is there a way to deploy contracts with circular reference in 2 steps using create2?

Circular reference meaning contracts know each other addresses. So instead of deploy foo deploy bar(foo.address) foo.init(bar.address) Use some clever tricks to have only 2 deploy steps without an ...
1
vote
0answers
14 views

GETH - Pending Transactions Performance

I'm currently making use of my own GETH node to get pending transactions and process them as follows: this.web3.eth .subscribe('pendingTransactions', function (error, result) {}) ...
1
vote
1answer
28 views

How to calculate decimal value

problem with retrieving decimal value. Example: ufixed8x2 profit = 0; uint256 amount = 5000000; //msg.value; uint256 constant private PERCENT_DIVIDER = 1; profit= ufixed8x2(amount.div(24).div(60)....
0
votes
0answers
15 views

Proxy delegation contract doesn't work

I'm trying to make a proxy to make a contract that I can change for an ethereum project. I did what it says here: https://hackernoon.com/how-to-make-smart-contracts-upgradable-2612e771d5a2 but it ...
1
vote
1answer
33 views

Workaround for TypeError: Struct containing a (nested) mapping cannot be constructed

Following example code piece works on solidity v0.6.*: // SPDX-License-Identifier: MIT pragma solidity >=0.7.1; contract Campaign { struct Status { uint32 cost; mapping(...

15 30 50 per page
1
5 6
7
8 9
612