openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

Low level call library

Open Amxx opened this issue 1 year ago • 3 comments

🧐 Motivation this library provides a solidity level interface to execute calls/staticcalls/delegate call without automatically dupping all the return data to memory. This makes it return-bomb safe.

We should build a similar library an use it in places such as the Forwarder.

Amxx avatar Apr 10 '24 18:04 Amxx

@cairoeth brought up the idea of whether to add this functions as part of the Address. I see it could benefit discoverability since it would be easier for users already depending on this library to find out they have a version that ignores returndata available.

I think it's a good idea to consider but perhaps Address is already a weird name for developers looking for ways to perform variants of EVM calls.

ernestognw avatar May 31 '24 23:05 ernestognw

For the record, there is a "prototype" for this library in #4991 https://github.com/OpenZeppelin/openzeppelin-contracts/blob/fbf4ca5d17555cd2021b6e99717caa5ea5a4f835/contracts/utils/Call.sol

Amxx avatar Jun 02 '24 17:06 Amxx

As mentionned on slack, we should focus on avoiding any possible mistake between the current functions in Address.sol, and the "unsafe" ones proposed here. That can be using a separate library (my preference right now), or through proper naming.

We have to make sure mistakes are as unlkikelly to happen as possible.

Amxx avatar Jun 02 '24 17:06 Amxx