-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor and clean up encoding #7
Conversation
|
||
// fn pointer indirection fools the compiler into letting us have | ||
// an uninitialized storage pointer | ||
function() pure returns (mapping(uint => MultisigCall[]) storage) fn; |
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.
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.
you likey?
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.
sol devs would rather do this than just contribute to the compiler LMAO
/// @dev Encodes a call to `ProxyAdmin.upgrade(proxy, impl)` | ||
function upgrade(EncProxyAdmin, address proxy, address impl) internal pure returns (bytes memory) { | ||
return abi.encodeCall(IProxyAdmin.upgrade, (ITransparentUpgradeableProxy(proxy), impl)); | ||
} |
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.
IMO nit but it feels like it would be more straightforward to leave abi.encodeCall(IProxyAdmin, to, params)
but make zDeployedProxy
cast to ITransparentUpgradeableProxy
by default...
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.
im not super sure what you're asking for, but this is less about how ZeusScript
uses it and more about how this works when writing upgrade scripts. for upgrade scripts this is much nicer.
i can share examples if you want
for (uint256 i = 0; i < calls.length; i++) { | ||
packedCalls = abi.encodePacked( | ||
packedCalls, | ||
abi.encodePacked(uint8(0), calls[i].to, calls[i].value, uint256(calls[i].data.length), calls[i].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.
would normally link to https://github.com/safe-global/safe-smart-account/blob/main/contracts/libraries/MultiSend.sol#L20 for this gibberish xD
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.
not sure on the Encode
piece but the rest LGTM
No description provided.