Comments (3)
Yep that is correct, custom errors can be decoded basically the same way calldata can be decoded—you know the signature to get the 4 byte selector, and with the signature you know how to decode the rest of the args
from multicall.
It is possible! If the call fails, the Result.returnData
(or just returnData
depending on which method) contains the ABI encoded failure reason.
If that reason is an Error(string)
from a require, you can decode it like this: https://github.com/Uniswap/v3-periphery/blob/6cce88e63e176af1ddb6cc56e029110289622317/contracts/base/Multicall.sol#L16-L23
If it's a panic you can ABI decode the Panic(uint256)
and map it to an error code. More info here: https://docs.soliditylang.org/en/latest/control-structures.html#error-handling-assert-require-revert-and-exceptions
from multicall.
Awesome thank you - are custom errors surfaced in returnData
as well, or only require()
error strings & panic codes?
EDIT: I was just informed that if its a custom error, I can decode the first 4 bytes (error function selector) of returnData
but I'll need to know the signature to decode it. That should work for what I'm trying to do but lmk if it doesn't sound right.
from multicall.
Related Issues (20)
- Document should be updated. HOT 4
- Deploy Multicall3 on re.al HOT 9
- Deploy to Merlin testnet HOT 1
- Deploy to Cardona HOT 2
- Deploy to DEGEN Chain HOT 4
- Deploy to Metis Andromeda HOT 3
- Deploy to Metis Sepolia HOT 1
- Merlin
- Deploy to Planq HOT 1
- Deploy to IOTA EVM HOT 1
- Deploy Multicall3 on SEI EVM Devnet HOT 2
- Request Deployment for DreyerX Mainnet HOT 3
- Deploy Multicall3 to Arthera Mainnet HOT 2
- Deploy Multicall3 to Arthera Testnet HOT 2
- Adicionar red HOT 1
- server returned an error response: error code -32000: transaction underpriced HOT 1
- delegatecall HOT 8
- Deploy multicall3 on Taiko mainnet HOT 9
- Deploy Multicall3 on SEI EVM Mainnet HOT 2
- Request a deployment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multicall.