Skip to content
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: rewards v2 upgrade script #888

Merged
merged 3 commits into from
Dec 3, 2024
Merged

feat: rewards v2 upgrade script #888

merged 3 commits into from
Dec 3, 2024

Conversation

jbrower95
Copy link
Contributor

@jbrower95 jbrower95 commented Nov 13, 2024

Summary

  • Rewards V2 will be deployed using Zeus, across all environments.
  • All deploy parameters and contract addresses are injected via Zeus.

Testing

Run tests with:
image

zeus test --verbose script/releases/v0.1.0-rewardsv2/*.s.sol --env preprod

@jbrower95 jbrower95 changed the title [RFC] Rewards V2 Protocol Upgrade wip: rewards v2 upgrade script Nov 13, 2024
@jbrower95 jbrower95 changed the title wip: rewards v2 upgrade script feat: rewards v2 upgrade script Nov 19, 2024
@jbrower95 jbrower95 force-pushed the jb/rewards-v2 branch 2 times, most recently from 7cf6917 to c36c54a Compare November 20, 2024 21:15
foundry.toml Show resolved Hide resolved
@jbrower95 jbrower95 force-pushed the jb/rewards-v2 branch 2 times, most recently from b34c492 to ad4a0bc Compare November 20, 2024 21:25
@MinisculeTarantula
Copy link
Collaborator

This PR LGTM. I added one (fairly minor) note above about correctness/consistency checks.

@jbrower95
Copy link
Contributor Author

@MinisculeTarantula - if the above looks good (modulo the feedback), please approve or reject ty <3

@jbrower95 jbrower95 requested a review from 0xrajath December 2, 2024 22:32
@jbrower95 jbrower95 force-pushed the jb/rewards-v2 branch 6 times, most recently from 5337c88 to 5663b7c Compare December 3, 2024 02:24
@jbrower95
Copy link
Contributor Author

@MinisculeTarantula - please reconfirm and +1 once you've reproduced the tests with zeus independently

shared zeus with you via DM

Comment on lines +41 to +61
bytes memory executorMultisigCalldata = address(this._timelock()).calldataToExecTransaction(
this._proxyAdmin(),
proxyAdminCalldata,
EncGnosisSafe.Operation.Call
);

return (executorMultisigCalldata);
}

function _runAsMultisig() internal virtual override {
bytes memory executorMultisigCalldata = _getMultisigTransactionCalldata();

TimelockController timelock = TimelockController(payable(this._timelock()));
timelock.schedule(
this._executorMultisig(),
0 /* value */,
executorMultisigCalldata,
0 /* predecessor */,
bytes32(0) /* salt */,
timelock.getMinDelay()
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our typical pattern when writing calls with multiple (~ 3+) args is to use solidity's named argument syntax, e.g:

bytes memory executorMultisigCalldata = address(this._timelock()).calldataToExecTransaction({
  to: this._proxyAdmin(),
  data: proxyAdminCalldata,
  op: EncGnosisSafe.Operation.Call
});

Helps disambiguate long lists of params. Same goes for timelock.schedule!

Copy link
Collaborator

@wadealexc wadealexc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not able to run Zeus, but the scripts look correct, and deployed impl looks correct.

Copy link
Contributor

@nadir-akhtar nadir-akhtar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Gave it some thorough manual review and local testing. The tests are super helpful at providing strong assurance that the scripts do what we expect them to do.

Comments regard primarily aesthetic concerns, so accepting not making those changes now in favor of minimizing diffs at this stage.

import {ITimelock} from "zeus-templates/interfaces/ITimelock.sol";
import {console} from "forge-std/console.sol";
import {EncGnosisSafe} from "zeus-templates/utils/EncGnosisSafe.sol";
import {MultisigCallUtils, MultisigCall} from "zeus-templates/utils/MultisigCallUtils.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove this line, imported above

Suggested change
import {MultisigCallUtils, MultisigCall} from "zeus-templates/utils/MultisigCallUtils.sol";

using MultisigCallUtils for MultisigCall[];
using EigenLabsUpgrade for *;
using EncGnosisSafe for *;
using MultisigCallUtils for *;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declared above

Suggested change
using MultisigCallUtils for *;

Comment on lines +27 to +28
MultisigCall[] private _executorCalls;
MultisigCall[] private _opsCalls;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused

Suggested change
MultisigCall[] private _executorCalls;
MultisigCall[] private _opsCalls;

@jbrower95 jbrower95 merged commit f2f6a77 into dev Dec 3, 2024
16 of 18 checks passed
@jbrower95 jbrower95 deleted the jb/rewards-v2 branch December 3, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants