-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to implicitly specify "self" in multi-send #695
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Hey, thanks for the contribution. Personally, I think this is a very cool idea:
The biggest drawback to the change is the requirement to deploy new |
We can merge this and include it in the upcoming 1.5 release. @Philogy do you think you'd have time to add a couple of tests for your change? |
Pull Request Test Coverage Report for Build 6800828476
💛 - Coveralls |
Safes may want to be able to use multi-send for combining configuring calls such as
enableModule
,setGuard
with each other or other external calls however specifying the safe's own address is impossible to currently do in initialization calls as the create2 salt for the safe depends on the hash of theinitializer
data which creates an unresolvable circular dependency. Allowingaddress(0)
to act as an alias for "self" allows configuring calls to easily be specified at initialization which is useful for people who want to deploy safes that enable certain modules/guards from the start.Implementation Explanation
The expression uses a binary-OR combined with a multiplication to implement a branch-less version of the following statement:
Here's the reasoning for why
or(to, mul(iszero(to), address())
is equivalent to the above ternary expression: