Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [revert]

The tag has no usage guidance.

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

Solidity Debug: Require statement reverts with no error when met, but prints error when not met

Apologies if the title is a little confusing. I'm new to programming in Solidity, and I think there's just some fundamental misunderstanding I'm having on this code, and I'm unable to fix it until I ...
Opsec Optimum's user avatar
0 votes
0 answers
21 views

Transaction revert in uniswap universal router

I want to sell token using universal router on Base network but transaction is getting reverted. Can anyone solve this? CODE require('dotenv').config(); const Web3 = require('web3'); const routerABI = ...
shakil khan's user avatar
1 vote
1 answer
22 views

Contract reverts at deploy when sending 2 ethers

This contract deploys fine when no value is added and get reverted when I try to send 2 ether on the remix VM.......which is exactly the opposite of what I expected or should be happening. I retraced ...
Bohn Bohn's user avatar
0 votes
1 answer
46 views

Transaction is getting reverted on calling bookRoom() function

I'm deploying my contract by passing these constructor params: (["Hotel Red","Hotel Radisson"],[1,2],[12,13],[3300000000000000,3500000000000000],[12,13]) The contract is getting ...
Zeeshan Sayeed's user avatar
0 votes
1 answer
81 views

getAmountsOut not works on BaseChain for V2 Router

Is 0xD6e0Bc285be97C75861910f4d2cFD4AC61DD629d for V2 Router? When I call getAmountsOut it returns error: Error: Returned error: execution reverted But I can call getPair on V2 Factory:
Moon soon's user avatar
  • 173
0 votes
0 answers
13 views

Facing this error "Error: transaction has been reverted by the evm, fail to send transaction"

This is my web console error: web3.min.js:22 Uncaught (in promise) Error: Transaction has been reverted by the EVM: { "blockHash": "...
noemotions's user avatar
1 vote
0 answers
32 views

Missing Revert Data (Hardhat/Ganache)

shortMessage: 'missing revert data', info: { error: { message: 'VM Exception while processing transaction: invalid opcode', stack: 'RuntimeError: VM Exception while processing ...
Kishor Kumar Paroi's user avatar
2 votes
1 answer
96 views

How to get revert message in Web3js?

I want to get the revert massage from a send method call to a smart contract. So I use: receipt.logs[0].data that is a string containing a hexadecimal value. Now I want to to decode this value to get ...
Alireza Zojaji's user avatar
0 votes
1 answer
25 views

My transaction was reverted but my funds were never returned back to my wallet

My transaction failed with error code displaying “REVERTED”. My funds were never sent back to my wallet. When I try to claim on Uniswap says not supported. I run updated version, I have tried ...
Plumbcrazy425's user avatar
1 vote
2 answers
254 views

Why I'm getting the error [FAIL. Reason: EvmError: Revert]?

I am getting these 2 errors (both are EvmError: Revert errors),from my fuzz test contrac for my NFTMarketplace contract. I think it might be that the fuzz test contract isin't interacting with the ...
Dylan Katsch's user avatar
0 votes
0 answers
28 views

Someone please help me to solve Transaction Revert problem

Network: Mode Mainnet Network Token Approve is successful but swap is not succeeding. Revert reason: 1TransferHelper::transferFrom: transferFrom failed Code: const config = require('./config'); // ...
Shakil Hasan's user avatar
0 votes
1 answer
41 views

Find out revert/error reason

I have a forwarder contract that calls a function (joinChallenge) on behalf of a user(gasless). User successfully signs permit request. I'm getting a revert on the execute call for forwarder.execute. ...
Ibra's user avatar
  • 71
1 vote
1 answer
31 views

Low-level function call to other contract is causing revert with correct function selector

I have 2 contracts, FloorInfo and Elevator. I want to call the goTo(uint) in the Elevator contract from the FloorInfo contract using a low-level call, this happens in the go() function inside the ...
nostonksafrica's user avatar
1 vote
1 answer
14 views

What would this function return if I called it with an index that didn't exist? EnumerableSet.sol

I'm looking at this function in OpenZeppelin's EnumberableSet.sol contract...it deletes an item in a set by taking the last item in the array and moving it to the slot of the deleted item and then ...
user127148's user avatar
1 vote
0 answers
14 views

Why are my exceptions rendered differently after versions update?

I don't remember the previous versions I was using but I remember upgrading because I hoped to have a local test network (via Ganache) supporting EIP-1559. My versions are: Truffle v5.11.5 (core: 5.11....
Luis Masuelli's user avatar
0 votes
1 answer
28 views

Can require() be used to revert low level call() that were made before it?

CODE: (success, ) = contract.call(); // low level call if (success) { // do something } // instead of below check, can I just use require(condition)? if (!condition) { revert(); } Instead of ...
aste123's user avatar
  • 233
0 votes
0 answers
59 views

Safe-core-sdk + fireblocks as signer: Provides different transaction hashes & transaction can be executed in web UI, but not with executeTransaction()

I'm using an Fireblocks account as a signer ( which uses MPC under the hood ) for my gnosis-safe. There are two problems that I'm encountering: The transaction hash from the safe-core-sdk and the one ...
giraeffleaeffle's user avatar
1 vote
0 answers
11 views

I can't create a new instance of a contract from a factory contract when using a js script but unit test ok

I have 2 SC: Factory contract that creates new instance of the 2nd contract via a function: function createCollection(string memory _name, string memory _symbol, uint16 _maxNFT) public onlyOwner { ...
Noa's user avatar
  • 11
0 votes
1 answer
76 views

UniswapV2 addLiquidityETH revert ds-math-sub-underflow

I tried this code for many contracts, and sending ETH and approving were done well, but on the addliquidityETH section, I get an error: reverted with 'ds-math-sub-underflow'. I can't understand why. ...
upme24's user avatar
  • 1
0 votes
0 answers
41 views

Why is it reverted/cancelled?

Executions usually reverted (it transact, deduct fee but fail). https://etherscan.io/tx/0x1ba2897733c8aacecad59593dd66ed333156645cb1c5d604a45524c9de34f91b version = 2 provider = "https://mainnet....
Drone's user avatar
  • 1
0 votes
2 answers
83 views

Transaction gets reverted when using send web3 function

I have a basic smart contract that sets the hash of a string and retrieves it along with verification. The contract works perfectly fine, but the issue is with the .send method of web3 that reverts ...
Andrea Ross's user avatar
0 votes
1 answer
42 views

Revert inside a for loop

If there is a revert inside a for loop that is inside a function, and the revert is triggered, will the whole function revert?
auditor_chick's user avatar
0 votes
0 answers
64 views

evm error: revert

This is my first smart contract. I booked a ticket and cancelled it in remix ide connected to metamask. Everything worked fine in remix ide. But my cancelling ticket test failed in foundry. Test ...
vizay315's user avatar
0 votes
1 answer
34 views

Understanding the Purpose of 'revert' Statement in Constructor of Account Abstraction Repo

I'm using the bundler repo, and during a code review, I'm having trouble understanding why the revert is used in the constructor. The intention seems to be to trigger an error, but using revert in ...
Soham malve's user avatar
6 votes
1 answer
109 views

MetaMask doesn't catch ERC20 reverts

When MetaMask interacts with most contracts, it seems to catch reverts and warn the user. However, when the user interacts with an ERC20 contract's transfer function, MetaMask does not catch a revert. ...
Rob Hitchens's user avatar
  • 55.3k
0 votes
1 answer
34 views

external call to non-existing address returns success

I have this simple contracts which forwards the calldata to and external contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract AccountTest { /** * execute a ...
johnhckuo's user avatar
  • 351
2 votes
2 answers
748 views

How can I decode a low-level return data from a reverting call?

Take the following low-level call written in Solidity: (bool success, bytes memory response) = address(proxy).call(abi.encodeWithSelector(plugins.reverter.withReasonString.selector)); I ...
Paul Razvan Berg's user avatar
2 votes
2 answers
601 views

what is the correct way to define a custom error

I am someone new to Solidity and going through the custom errors part with REVERT I have found examples where the word "ERROR" is thrown inside CONTRACT pragma solidity 0.8.18; contract ...
Diego Aaron's user avatar
0 votes
0 answers
30 views

revert statement causes infinite gas estimation in Remix

I wrote an Ownable contract snippet that uses revert instead of require on the OnlyOwner modifier. This causes remix to estimate infinite gas fees. Does anyone know why? // SPDX-License-Identifier: ...
Shoesoft's user avatar
1 vote
1 answer
37 views

Why doesn't this try/catch block catch the revert in `asset.symbol`?

I wrote this Solidity function: function getAssetSymbol(IERC20Metadata asset) internal view returns (string memory) { try asset.symbol() returns (string memory symbol) { return symbol; ...
Paul Razvan Berg's user avatar
0 votes
1 answer
295 views

Solidity: call() with bubbling the revert reason

Consider the following Solidity code: (bool success, ) = address(_token).call( abi.encodePacked( _RECEIVE_WITH_AUTHORIZATION_SELECTOR, ...
Mikko Ohtamaa's user avatar
0 votes
0 answers
23 views

VM Exception while processing transaction: revert Tried all but Still getting error

Have tried all things, I am running the following program on Remix there i use Injected web3 Metamask but continously getting error when I call convertToUsd function and same code run through truffle ...
Saqib's user avatar
  • 1
1 vote
2 answers
409 views

try/catch is not catching a revert of external contract

I have created a contract which allows the input of an external contract address. It is expected that the address is for an ERC20 contract. In order to handle the situation where the user enters a non ...
CathalMF's user avatar
  • 283
2 votes
2 answers
985 views

I can't deploy a contract with payable function

I am a total beginner and I just started the Patrick Collins's course on youtube. I apologize for my stupid question but I didn't find similar topic and I have been struggling with this issue for 2 ...
aymericf99's user avatar
1 vote
1 answer
565 views

Error: call revert exception (method="admin()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION)

I was trying to play with proxy pattern. But got stuck with this error. Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="admin()", data="...
Vishwas Prakash's user avatar
3 votes
1 answer
102 views

Why does Remix does not show the description of the error anymore?

I am trying to run one of the methods of my smart contract using Remix and I am getting the following: Why is not possible anymore to see if this is failing on a require, with the right description ...
Falcon Stakepool's user avatar
1 vote
1 answer
673 views

Is it possible to reverse the gas used in case of using revert?

I try to refund gas to the minimum even after using revert with the following example. uint A = IERC20(base).balanceOf(address(this)); IERC20(token).transfer(owner,1000000); then I run swaps ...
jhonatanalfred's user avatar
2 votes
0 answers
77 views

Is there any way to bubble up custom errors without using low-level assembly?

Is there any way to bubble up custom errors without using low-level assembly? Say you have a custom error defined like this: contract For { error Unauthorized(); function reverWithError() ...
Paul Razvan Berg's user avatar
0 votes
0 answers
15 views

unexplained error on contract

My contract is reverting for a random reason and I cannot find out why. I have set a revert message to all my requires() but when I try to send a transaction via remix it does not work for a specific ...
Henry G's user avatar
  • 33
1 vote
1 answer
728 views

Is there a way to handle `abi.decode` errors?

I am trying to decode a bytes value, and while writing tests, I was trying to pass invalid values to force an error. Although I get the error missing revert data in call exception, I cannot find a way ...
BonisTech's user avatar
  • 664
0 votes
1 answer
250 views

Does forge enable you to test your revert messages?

I'm currently using the expectRevert construction and then just printing things out to see the msg, but is there a way to test this via an assertion? perhaps expectRevertWithMessage or something of ...
scheherazhaad's user avatar
6 votes
1 answer
2k views

Understanding eth_sendBundle, eth_sendPrivateTransaction and eth_sendRawTransaction

I want to understand the differences between the three RPC methods, so I can know which one is best for my use case. I am currently using eth_sendRawTransaction to submit transactions to the public ...
pestopasta's user avatar
1 vote
3 answers
75 views

Why Does This Chainlink Example Code Revert?

I seem to be doing everything exactly as stated in the docs and example code I am following. When I deploy this to polygon mumbai though and call "generateRandomNumber" it just reverts with ...
Jim's user avatar
  • 173
3 votes
2 answers
1k views

Yul/Inline Assembly: Revert with a custom error message

I am learning Yul for my Bachelor's thesis and I am currently stuck on understanding a small code segment with require and revert functions. A simple require function in Solidity ... require(...
EyeEmmaJedi's user avatar
1 vote
1 answer
515 views

ValueError:Gas estimation failed:'execution reverted'.This transaction will likely revert.If you wish to broadcast,you must set the gas limit manually

I get this error when trying to my deploy .sol contract: "ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the ...
Rob XRP's user avatar
  • 13
0 votes
1 answer
93 views

Generic error revert message

I'm having a problem with a contract I've developed recently. I'm interacting with it using a dapp written using ReactJS. The problem is: when I call a specific function of this contract I'm getting ...
Allen's user avatar
  • 1
0 votes
2 answers
68 views

I'm trying to reverse an array but the transaction keeps getting reverted even though the logic seems right. Can someone help me out?

Here is the code : // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.9.0; contract Day1 { function reverseArray(uint[] memory arr1, uint length) public pure returns(uint[] memory){ ...
GimmeGinNtonic's user avatar
0 votes
2 answers
2k views

Error: VM Exception while processing transaction: reverted with reason string 'Didn't send enough!' on testing contract

Getting this error while testing one of functions functionality in the contract AssertionError: Expected transaction to be reverted with You need to spend more ETH!!, but other exception was thrown: ...
Aman's user avatar
  • 23
2 votes
2 answers
428 views

How does the EVM internally revert the contract to the initial state when exceptions are present?

In error handling, assert and require statements revert the state of the contract to the initial state and then the transaction passes or fails depending on the code. I'm trying to understand how this ...
GimmeGinNtonic's user avatar
0 votes
2 answers
77 views

Don't understand why this overflows revert

I have a timelock on an ERC20 contract, from year 0 to 9, it works until year 4, but from year 5 onwards it reverts. It fails both on minting and checking (Using 52 seconds intead of weeks for testing)...
Angel Guastaferro's user avatar