-
Notifications
You must be signed in to change notification settings - Fork 85
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
exploring gas of using oz #25
Conversation
} | ||
|
||
Clones.cloneDeterministic(implementation, salt); | ||
account.initialize{value: msg.value}(owners); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg.value kinda has unpredictable behavior here, in that if the account is already deployed, this will just sit on the factory. Maybe should just remove payable on this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about returning the ETH if already existing? Or we could have a similar approach to Oz's one and simply revert if already deployed
Alchemy recently used Solady UUPS with OZ Clone, we could do the same https://github.com/alchemyplatform/modular-account |
src/CoinbaseSmartWallet.sol
Outdated
@@ -209,6 +210,10 @@ contract CoinbaseSmartWallet is MultiOwnable, UUPSUpgradeable, Receiver, ERC1271 | |||
} | |||
} | |||
|
|||
function upgradeToAndCall(address newImplementation, bytes memory data) public payable override { | |||
ERC1967Utils.upgradeToAndCall(newImplementation, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not actually safe, but OZ is a little annoying to work with here. Doesn't have a clone1967
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, this override is unsafe (and not effective) but temporarily necessary to test gas.
OZ's Clones
library deploys 1167 minimal proxies but our smart account implementation is a UUPSUpgradeable
contract which, when calling upgradeToAndCall
, uses the 1967 standard to check if the IMPLEMENTATION_SLOT
is set to __self
. This reverts as 1167 does not use IMPLEMENTATION_SLOT
.
Not pursuing for now |
No description provided.