Questions tagged [revert-opcode]

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

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
208 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
9 views

Is EVM vulnerable to denial of service with out of gas in call to other contract?

if I call a function in a sub-contract and it runs out of gas, the gas is not completely consumed. Instead, it is returned to the calling contract. Could that be a vulnerability for a denial of ...
3
votes
0answers
67 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
124 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
133 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 ...
2
votes
0answers
67 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
152 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
227 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
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
84 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
747 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
30 views

Failing to fill 0x quote

I'm trying to fill a quote that I get from the 0x API: const qs = createQueryString({ sellToken: 'TUSD', buyToken: 'WETH', sellAmount: BigInt(882693 * 10 ** 18) }); ..but the transaction ...
0
votes
1answer
10 views

Aave Flashloan `reverted with reason '73'`

I'm getting an error when attempting to execute an Aave V2 Flashloan within a Hardhat-mocha test while connected to a fork of the Kovan network. It's unclear to me what revert reason "73" ...
0
votes
0answers
83 views

Transaction has been reverted by the EVM - How to deduce the revert reason in this case?

I get this error when I call a function that changes the state of the smart contract from the frontend: Error: Transaction has been reverted by the EVM: { "blockHash": "...
0
votes
0answers
25 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
52 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
31 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
42 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
95 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 ...