Questions tagged [revert-opcode]

Questions about Solidity's `revert()` or the REVERT opcode.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
182 views

Is it possible to trace a function call hitting revert?

It is possible to trace a transaction with debug_traceTransaction. But it needs the transaction hash, requiring it to be a transaction in first place. I'm debugging a function call that generates a ...
3
votes
0answers
37 views

How do I check transaction status using go-ethereum simulated back-end?

Using the go-ethereum simulated backend, I would like to: 1) Instantly commit a transaction so that it either succeeds or reverts in a given simulated blockchain. So far I'm using sim.Commit() to ...
3
votes
0answers
122 views

Assuming EIP140, is remaining gas refunded when a called contract throws?

Under EIP140 (REVERT) and assuming Solidity ≥0.4.10. If I call from my contract to a function on an external contract, and this external function does an invalid jump, does my contract still call ...
2
votes
0answers
44 views

How to know the reason of transaction's reversion in parity?

I am testing ERC20 USDT contract locally with parity. I imported contract to my private testnet and manually generated raw transaction that calls "transfer" method of contract. I send it to the node ...
2
votes
1answer
109 views

Ether in ERC-20 transactions?

I have one contract that I give tokens from a ERC20 contract implemantation. When I call the balanceOf function from the Token conract. Response me that I have x Tokens. Nice !! But when I try to ...
2
votes
0answers
225 views

Strange revert() behavior on Etherscan

I am testing my contract, which is for an auction. I've deployed it on the Rinkeby testnet. I have a payable function that calls revert() if the bid being placed isn't higher than the existing bid. ...
1
vote
0answers
35 views

UnhandledPromiseRejectionWarning: Error: nonce generation function failed or private key is invalid in Ganache

In Go I am using go-ethereum to read data from the ethereum smart contract. My smart contract is maintained with truffle. I am trying to fetch candidate information based on candidate id. I have a ...
1
vote
0answers
33 views

Assert after critical instruction

I've seen a particular code style, where after any "critical" state modification operation, a check is done in order to assess the true good result of the operation. Something like: uint _count = ...
1
vote
1answer
82 views

Calculating a minimum entry fee for a game based on typical minimum gas requirements?

I am creating a dApp that is a game where players compete for the prize pool and that pool is built from the sum of all the entry fees payed by the player at the start of the game. The player that ...
1
vote
0answers
424 views

How to catch reverted transaction while using metamask

I'm working with metamask and was testing a transaction that should trigger a revert statement inside my contract. When the error is thrown metamask gives the following output: this was while using ...
0
votes
0answers
18 views

Is there a way to get revert message by my client?

I have a smart contract with this simple function: function addUser( string memory _username, string memory _nome, string memory _cognome, string memory _email) public isOwner() { require(bytes(...
0
votes
0answers
20 views

Is there a way to know if a Solidity method will revert?

I have some solidity methods in my contract, and when i make a send in web3.js i would like to know if there is a way to know if the functions are going to revert by using call. Per-example , in ...
0
votes
0answers
36 views

How can I debug EventLog in Solidity code? Multisig execution failure when executing multisend function

I'm trying to execute a multitransfer (ERC20token) transaction using a multisig contract. The multitransfer got executed successfully when the value of the token is 0, however it always fail (reverted)...
0
votes
0answers
28 views

Cann't send token with looping function

Sorry, I'm a newbie on ERC721 token. Please help. I have deployed ERC721 contract in the localhost testnet. I use looping function for mint token and it works. But when I use looping function for ...
0
votes
0answers
36 views

Revert() workflow in re-entrancy vulnerablity?

I am studying the following code contract Mutex { bool locked; modifier noReentrancy() { require(!locked); locked = true; _; locked = false; } function f(unit256 amount) public ...
0
votes
0answers
90 views

Sending ether from contract cause error

Hi In my contract I send ether from my contract to other address like address.transfer(winnerAmount);. It transfer ether successfully if my array have one address. If I have more than one address it ...