Skip to content

Commit

Permalink
refactor: add release template
Browse files Browse the repository at this point in the history
  • Loading branch information
nadir-akhtar committed Oct 28, 2024
1 parent 53ffb0c commit 1da8e52
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/release-template/1-eoa.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import {Addresses, Environment, Params, EOADeployer} from "../templates/EOADeployer.sol";

contract Deploy is EOADeployer {
Deployment[] private _deployments;

function _deploy(Addresses memory, Environment memory, Params memory)
internal
override
returns (Deployment[] memory)
{
vm.startBroadcast();

//////////////////////////
// deploy your contracts here
//////////////////////////

vm.stopBroadcast();

return _deployments;
}
}
29 changes: 29 additions & 0 deletions src/release-template/2-multisig.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import {
Addresses,
Environment,
Params,
MultisigCall,
MultisigCallUtils,
OpsTimelockBuilder
} from "../templates/OpsTimelockBuilder.sol";

contract Queue is OpsTimelockBuilder {
using MultisigCallUtils for MultisigCall[];

MultisigCall[] internal _executorCalls;

function queue(Addresses memory addrs, Environment memory env, Params memory params)
public
override
returns (MultisigCall[] memory)
{
//////////////////////////
// construct executor data here
//////////////////////////

return _executorCalls;
}
}
47 changes: 47 additions & 0 deletions src/release-template/3-multisig.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import {
Addresses,
Environment,
Params,
MultisigCall,
MultisigCallUtils,
MultisigBuilder
} from "../templates/MultisigBuilder.sol";
import {SafeTx, SafeTxUtils} from "../utils/SafeTxUtils.sol";
import {ITimelock} from "../interfaces/ITimelock.sol";
import {Queue} from "./2-multisig.s.sol";

contract Execute is MultisigBuilder {
using MultisigCallUtils for MultisigCall[];
using SafeTxUtils for SafeTx;

MultisigCall[] internal _opsCalls;

function _execute(Addresses memory addrs, Environment memory env, Params memory params)
internal
override
returns (MultisigCall[] memory)
{
Queue queue = new Queue();

MultisigCall[] memory _executorCalls = queue.queue(addrs, env, params);

bytes memory executorCalldata =
queue.makeExecutorCalldata(_executorCalls, params.multiSendCallOnly, addrs.timelock);

// execute queued transaction
_opsCalls.append({
to: addrs.timelock,
value: 0,
data: abi.encodeWithSelector(ITimelock.executeTransaction.selector, executorCalldata)
});

//////////////////////////
// add more opsCalls here
//////////////////////////

return _opsCalls;
}
}
19 changes: 19 additions & 0 deletions src/release-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Release Template

This template is an example of the deploy-queue-upgrade structure that can be used for executing EigenLayer upgrades via the Ops Timelock Multisig, as described [here](https://docs.eigenlayer.xyz/eigenlayer/security/multisig-governance).

Zeus can take this template and instantiate a new release template, allowing for quick setup of a common upgrade process.

Note that the names follow the syntax `#-<signer>`, where `#` is the sequence number within the release (i.e. the order in which actions are taken), and `<signer>` is the signing strategy to be used for that script.

## 1-eoa.s.sol

This contract allows for deployments to be broadcast. An EOA is expected to take these actions.

## 2-multisig.s.sol

This contract allows for actions to be written from the perspective of the Executor Multisig, which will then be wrapped for the Timelock, then for the Ops Multisig to execute.

## 3-multisig.s.sol

The final execution step can be written in this contract. It will reuse the logic from the previous step by importing the contract, then allow for additional calls to be appended from the perspective of the Ops Multisig.

0 comments on commit 1da8e52

Please sign in to comment.