Open mfw78 opened 3 months ago
I think isDelegateCall is descriptive enough. Will need to add some additional input validation. Equality check on string is also more expensive, libs usually just keccak both the string ranges and compare. I suppose since we know these strings to fit within one word, can probably load, shift and eq
it.
In the following code, the call type may optionally be set as a
DELEGATECALL
:https://github.com/meetmangukiya/cow-shed/blob/d67e97dd501d2fec42ab7d3e511bc3f9a2d87a8a/src/ICOWAuthHook.sol#L6
An option that may be useful in the UX for when a user is signing the hook is to provide a
string callType
field and have this set as"call"
or"delegatecall"
. This is more descriptive, and would incur the same levels of gas cost (perhaps even slightly cheaper without the need to cast aroundbool
).No strong opinion on this one, just some food for thought.