argotorg / argotorg/solidity

`try`/`catch` for `abi.decode()` or `abi.tryDecode`

Open
#10,381 15 comments 7 reactions 0 assignees View on GitHub
high effort high impact language design :rage4: must have needs design
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

Hi,

I am referencing the conversation #10317 .

It would be nice to have a way to catch errors thrown during `abi.decode` operations.

Quoting @chriseth:
> Instead of try/catch we should maybe rather have abi.tryDecode? The problem here is how to return the data in the two cases

Also `try catch` might be useful for functions other than `abi.decode` but I will first need to find concrete examples and will report them here in this issue.

-----

Preliminary implementation: https://github.com/ethereum/solidity/pull/10883

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked conversation #10317 and the preliminary implementation in pull request #10883. The issue needs an agreed direction for catching abi.decode errors and for returning data in both cases; done means the chosen behavior is implemented and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
blockchain, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.