vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.81k stars 788 forks source link

Bubble up revert errors for `create` built-ins #4147

Open pcaversaccio opened 3 weeks ago

pcaversaccio commented 3 weeks ago

I think on the (off-chain) tooling side it would be useful to have the possibility to enable bubbling up the revert reasons for the create built-ins such as create_minimal_proxy_to, create_copy_of, create_from_blueprint, and the planned raw_create built-in here. This means you could add a kwarg to these functions like raw_revert_data: uint256 = 0 and if it's above 0 the functions also return some return_data with Bytes[raw_revert_data] that can be processed further in case of a failure. If revert_on_failure is True, the called revert statement should be like raw_revert(return_data).