-
Notifications
You must be signed in to change notification settings - Fork 346
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
feat: introduce zeus templates #790
Conversation
* chore: remove unused release folder
|
|
||
vm.stopBroadcast(); | ||
|
||
return _deployments; |
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.
Do we need to return this if it's in a state variable the parent method has access to?
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.
- I prefer explicitly returning up values rather than implicitly modifying state variables.
- I actually meant to have this not be in the parent contract 😅 and instead have every contract inheriting
EOADeployer
define their own_deployments
array local to their own contract to avoid 1).
Will update this in the templates branch and this PR
function setUp() public { | ||
(Addresses memory addrs, Environment memory env, Params memory params) = _readConfigFile("script/configs/zipzoop.json"); | ||
_deploy(addrs, env, params); | ||
} |
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.
Is this for testing purposes? (if so, that's fine - just wondering!)
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.
Yep. Though one big concern with this is that it actually modifies the state variable to call _deploy()
twice even when not running the tests specifically -- wondering if it makes more sense to separate out tests into a different file, or to simply not use setUp()
|
||
MultisigCall[] internal _executorCalls; | ||
|
||
function queue(Addresses memory addrs, Environment memory env, Params memory params) public override returns (MultisigCall[] memory) { |
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.
Weird that this method in particular is public rather than the internal pattern the other two scripts use
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.
ah, i see now why it's public, used in script 3.
eesh, that feels like a weird pattern!
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.
2 main reasons:
- this is the only time we do this pattern (deploy a script and call it from another script)
- deploys/calls like this should be minimized because then you have to be careful how/when you use start/stop broadcast
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 much rather make this an inheritance relationship somehow
_multisigCalls.append({ | ||
to: addrs.timelock, | ||
value: 0, | ||
data: abi.encodeWithSelector( | ||
ITimelock.executeTransaction.selector, | ||
executorCalldata | ||
) | ||
}); | ||
|
||
// after queued transaction, renounce ownership from eigenPodManager | ||
_multisigCalls.append({ | ||
to: addrs.eigenPodManager.proxy, | ||
value: 0, | ||
data: abi.encodeWithSelector( | ||
EigenPodManager(addrs.eigenPodManager.proxy).renounceOwnership.selector | ||
) | ||
}); | ||
|
||
return _multisigCalls; |
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.
Kind of a strange mix:
- when we write the
queue
script, we don't worry about the ops flow and the fact that we'll be callingqueueTransaction
is abstracted away - when we write the
execute
, we do worry about the ops flow and explicitly callexecuteTransaction
This distinction doesn't feel apparent given the structure of the code/templates.
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.
LGTM!
zeus-templates
The PR introduces a new dependency,
zeus-templates
, to improve developing, testing, and reviewing scripts with Zeus.zeus-templates
provides two abstract contracts for building scripts:EOABuilder
: An EOA performing a deploy, returning aDeployment
object.MultisigBuilder
: A multisig performing some direct action (e.g. sending tokens, acting as a role on a contract), returning a Safe MetaTransactionData object.MultisigBuilder
script transforms calls into MultiSendCallOnly calls, meaning any number of calls (not accounting for gas) can be batched into one transaction by a multisig.Furthermore,
script/releases/v0.1-eigenpod-example/
contains an example set of scripts inheriting and implementing functions for each aforementioned abstract contract. These scripts are purely for demonstration.1-eoa.s.sol
: Deploys two contracts,EigenPod
andEigenPodManager
.2-multisig.s.sol
: Queues up a transaction in the Timelock for execution after a delay.3-multisig.s.sol
: Executes the previously queued transaction in the timelock, as well as renounces ownership from EigenPodManager.See the READMEs in each directory for more detail.
Note: as part of migrating our scripting / deployment flow to Zeus, many files within the
script
directory were removed. The ones remain are only there for ensuring that integration and other tests continue to work as expected. As we transition to Zeus, these remaining files are intended to be removed as well.