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

Deploy/mode upgrade #44

Merged
merged 61 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5ff4451
Refactoring the makefile to make targets generic
brickpop Oct 29, 2024
db1cfb7
Refactoring the Makefile, optimizing env vars and making the E2E test…
brickpop Oct 29, 2024
2376427
Making the makefile pick the right values depending on the target
brickpop Oct 29, 2024
c5e1259
Keeping the output in a deployment log file
brickpop Oct 29, 2024
ec49783
Improved readability, adding E2E tests to use an existing token
brickpop Oct 29, 2024
ea3f69f
Final touches
brickpop Oct 30, 2024
85ed996
Moving rule based values next to their usage
brickpop Oct 30, 2024
c6423d2
Renaming the forking test modes
brickpop Oct 30, 2024
f42adf6
Final touches
brickpop Oct 30, 2024
7d28eb7
Extended deployment checklist
brickpop Oct 30, 2024
6b9f13d
Adding a refund target
brickpop Oct 30, 2024
15ee37e
Minor edits
brickpop Oct 31, 2024
232af8a
Minor
brickpop Oct 31, 2024
73c5a13
Minor
brickpop Oct 31, 2024
e9fa39b
Ready to merge
brickpop Oct 31, 2024
f87f6e2
Assign
brickpop Oct 31, 2024
5dcc440
Merge pull request #37 from aragon/f/static-env-file
brickpop Oct 31, 2024
ae21ce9
Improved deployment checklist
brickpop Oct 31, 2024
a0a13b3
Add ERC721 metadata
xavikh Dec 10, 2024
ee6e24c
Add BaseURISet event
xavikh Dec 10, 2024
b03321b
Check baseTokenURI
xavikh Dec 10, 2024
e9a8d16
Test supportsInterface
xavikh Dec 11, 2024
2e9db89
Allow resets outside voting period
xavikh Dec 13, 2024
997c9e7
Fix comment
xavikh Dec 13, 2024
61cbba8
Cleanup comment
xavikh Dec 13, 2024
7cf3d68
feat: migration functionality
jordaniza Dec 13, 2024
585d9b8
update curve coeff and storage gap
jordaniza Dec 13, 2024
dd017da
Fix inheritance order
xavikh Dec 13, 2024
b095eb0
Reduce Lock gap
xavikh Dec 13, 2024
f5cbe5b
Merge pull request #40 from aragon/feat/migration
jordaniza Dec 13, 2024
dbdda9f
Merge pull request #39 from aragon/feature/rd-985-enable-withdrawals-…
jordaniza Dec 13, 2024
e8ab43d
Merge pull request #38 from aragon/feature/rd-984-add-metadata-to-the…
jordaniza Dec 13, 2024
a2993e5
readme
jordaniza Dec 13, 2024
82e722b
added tests and moved some files to ifaces
jordaniza Dec 16, 2024
c8a02f9
Merge pull request #42 from aragon/feat/migration
jordaniza Dec 16, 2024
8693c46
Add some tests to resetVotes
xavikh Dec 16, 2024
0d22c32
Merge branch 'feature/rd-985-enable-withdrawals-outside-of-voting-per…
xavikh Dec 17, 2024
28e797a
added stateful tests
jordaniza Dec 18, 2024
c841236
fork tests for the migration, naming for new escrow, prevent createlo…
jordaniza Dec 23, 2024
dfaa51d
fixed tests for deposit blocks during migration
jordaniza Dec 27, 2024
0126282
Adjusted comments to reflect 1.1.0 vs 2.0.0
jordaniza Dec 27, 2024
0d58b36
nonReetrant is always first
jordaniza Dec 27, 2024
5162aa9
fixed typos in comments
jordaniza Dec 27, 2024
9cdae2c
added voting power to the migrate event
jordaniza Dec 27, 2024
b1a14b0
incremented version for simpleGaugeVoter
jordaniza Dec 27, 2024
af3bb51
add final version of halborn report
jordaniza Jan 13, 2025
8d53d40
Merge pull request #43 from aragon/feat/migration
jordaniza Jan 13, 2025
5e44308
reverted the voting escrow changes
jordaniza Jan 13, 2025
1c9c63f
Working upgrade test via multisig
jordaniza Jan 14, 2025
caeb533
revert migration changes as no longer in this build
jordaniza Jan 20, 2025
fa77ff0
Merge branch 'audit-2/final' into deploy/mode-upgrade
jordaniza Jan 20, 2025
bd744df
test cases for mode mainnet and sepolia in single file
jordaniza Jan 20, 2025
648272e
working deploy for mode sepolia
jordaniza Jan 21, 2025
00799b1
delete migration script, revert commits not needed, remove migration …
jordaniza Jan 21, 2025
9be51c9
Merge pull request #45 from aragon/audit-2/final
jordaniza Jan 21, 2025
b3e47b8
Merge pull request #41 from aragon/audit-2/scope
jordaniza Jan 22, 2025
3cd962d
Merge branch 'develop' into deploy/mode-upgrade
jordaniza Jan 22, 2025
07ff60b
further test for upgrade function
jordaniza Jan 22, 2025
39816b5
Support for anvil tests
jordaniza Jan 22, 2025
3f90751
update block number and proposal id
jordaniza Jan 22, 2025
fc49473
upgraded mode
jordaniza Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
upgraded mode
jordaniza committed Jan 23, 2025
commit fc494738325fdc1a1855cdfd3a687b76c4df02a2
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ ft-mode-migration :; forge test --match-contract TestMigrate \

ft-mode-upgrade-fork :; forge test --match-contract TestUpgradeToV110 \
--rpc-url https://mainnet.mode.network/ \
--fork-block-number 18689270 \
--fork-block-number 18697900 \
-vvvv

ft-mode-sepolia-upgrade-fork :; forge test --match-contract TestUpgradeToV110 \
@@ -68,15 +68,26 @@ upgrade-mode-sepolia :; export TRY_EXECUTE=true && forge script UpgradeToV110 \
-vvvvv

# on an anvil fork will run the upgrade script
anvil-fork-mode :; anvil -f https://mainnet.mode.network --fork-block-number 18689270 --auto-impersonate
anvil-fork-mode :; anvil -f https://mainnet.mode.network --fork-block-number 18697900 # --auto-impersonate
upgrade-fork-mode :; export TRY_EXECUTE=false && forge script UpgradeToV110 \
--rpc-url http://localhost:8545 \
--sender $(SIGNER_ADDRESS) \
--unlocked \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
-vvvvv

upgrade-preview-mode :; export TRY_EXECUTE=true && forge script UpgradeToV110 \
--rpc-url https://mainnet.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv

upgrade-mode :; export TRY_EXECUTE=true && forge script UpgradeToV110 \
--rpc-url https://mainnet.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url https://explorer.mode.network/api\? \
-vvvvv

deploy-preview-mode-sepolia :; forge script DeployGauges \
--rpc-url https://sepolia.mode.network \
17 changes: 17 additions & 0 deletions script/approve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
ETH_WHALE="0xE28842dAF2cDe94EecC81b26A436eB043454F010"
MULTISIG="0x4315B4D2C707981f7fA51DBE91079Ea8c44e2e95"
RPC_FLAG="--rpc-url http://localhost:8545"
PROPOSAL_ID=2

SIGNER_0="0x946138B088524414EEDaf0699BA10d7Fb5673A34"
SIGNER_1="0xbd3eE47A1576F26454C65B96b7AbfaF8Ee9cB4a1"
SIGNER_2="0x9395e6b95afFee7d7b2b107127Fcc9e4167A336f"

cast send $SIGNER_0 --from $ETH_WHALE --unlocked --value "0.01ether" $RPC_FLAG
cast send $SIGNER_1 --from $ETH_WHALE --unlocked --value "0.01ether" $RPC_FLAG
cast send $SIGNER_2 --from $ETH_WHALE --unlocked --value "0.01ether" $RPC_FLAG

cast send $MULTISIG --from $SIGNER_0 --unlocked "approve(uint256,bool)" $PROPOSAL_ID false $RPC_FLAG
cast send $MULTISIG --from $SIGNER_1 --unlocked "approve(uint256,bool)" $PROPOSAL_ID false $RPC_FLAG
cast send $MULTISIG --from $SIGNER_2 --unlocked "approve(uint256,bool)" $PROPOSAL_ID true $RPC_FLAG
10 changes: 10 additions & 0 deletions script/unlock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# Load the signer address from the .env file and unlock it for use in test scripts via anvil
SIGNER=$(grep '^SIGNER_ADDRESS=' .env | cut -d '=' -f2)
echo "Unlocking $SIGNER"
cast rpc --rpc-url http://localhost:8545 anvil_impersonateAccount $SIGNER

ETH_WHALE="0xb4E38F1A3Bf250144364CF29076Ecd2D1f8C2329"
cast rpc --rpc-url http://localhost:8545 anvil_impersonateAccount $ETH_WHALE
cast send --from $ETH_WHALE --unlocked --value "10000000000000000000" $SIGNER --rpc-url http://localhost:8545
164 changes: 83 additions & 81 deletions test/fork/upgradeViaMultisig.t.sol
Original file line number Diff line number Diff line change
@@ -113,94 +113,96 @@ contract TestUpgradeToV110 is Test {
vm.stopPrank();

uint proposalId;
IDAO.Action[] memory actions = buildActions();
// IDAO.Action[] memory actions = buildActions();
if (isMainnet(network)) {
vm.startPrank(aragonSigners[0]);
uint256 aragonProposalId = _createAragonMsigProposal(actions);
// vm.startPrank(aragonSigners[0]);
// uint256 aragonProposalId = _createAragonMsigProposal(actions);
// vm.stopPrank();
vm.startPrank(0x8cDe1E4b1C03b8aA78cED50291B60E86f5dA8a39);
_executeAragonProposal(2);
vm.stopPrank();
_executeAragonProposal(aragonProposalId);
proposalId = PROPOSAL_ID;
} else if (isTestnet(network)) {
vm.startPrank(modeSigners[0]);
proposalId = _buildMsigProposal(
actions,
modeSigners,
modeMultisig,
vm.envOr("TRY_EXECUTE", false)
);
vm.stopPrank();
// vm.startPrank(modeSigners[0]);
// proposalId = _buildMsigProposal(
// actions,
// modeSigners,
// modeMultisig,
// vm.envOr("TRY_EXECUTE", false)
// );
// vm.stopPrank();
} else {
revert("Invalid network");
}

_signExecuteMultisigProposal(proposalId, modeSigners, modeMultisig);

// test
address lockImplNew = lockMode.implementation();
address voterImplNew = voterMode.implementation();
address lockBPTImplNew = lockBPT.implementation();
address voterBPTImplNew = voterBPT.implementation();

assertNotEq(lockImplOld, lockImplNew);
assertNotEq(voterImplOld, voterImplNew);
assertNotEq(lockBPTImplOld, lockImplNew);
assertNotEq(voterBPTImplOld, voterImplNew);

// uri is there on the new locks
vm.startPrank(address(modeDAO));
{
lockMode.setBaseURI("https://lockmode.com/");
lockBPT.setBaseURI("https://lockbpt.com/");
}
vm.stopPrank();

// check that reset is allowed during a voting window

// fetch a staker
address staker = getStaker(network);
bool isVotingActive = voterMode.votingActive();
// are they voting? if not, move to voting window

uint veNFT = VotingEscrow(voterMode.escrow()).ownedTokens(staker)[0];
if (!voterMode.isVoting(veNFT)) {
// create the gauge and vote for it
vm.startPrank(address(modeDAO));
{
voterMode.unpause();
voterMode.createGauge(address(1993), "");
}
vm.stopPrank();

// vote by moving to voting window
if (!isVotingActive) {
vm.warp(block.timestamp + 1 weeks);
}

vm.startPrank(staker);
{
IGaugeVote.GaugeVote[] memory votes = new IGaugeVote.GaugeVote[](1);
votes[0] = IGaugeVote.GaugeVote({weight: 1, gauge: address(1993)});
voterMode.vote(veNFT, votes);
}
vm.stopPrank();
}

// move to the dist window
if (isVotingActive) {
vm.warp(block.timestamp + 1 weeks);
}

// call reset
assertEq(voterMode.isVoting(veNFT), true);
assertEq(voterMode.votingActive(), false);

vm.startPrank(staker);
{
voterMode.reset(veNFT);
}
vm.stopPrank();

assertEq(voterMode.isVoting(veNFT), false);
//
// _signExecuteMultisigProposal(proposalId, modeSigners, modeMultisig);
//
// // test
// address lockImplNew = lockMode.implementation();
// address voterImplNew = voterMode.implementation();
// address lockBPTImplNew = lockBPT.implementation();
// address voterBPTImplNew = voterBPT.implementation();
//
// assertNotEq(lockImplOld, lockImplNew);
// assertNotEq(voterImplOld, voterImplNew);
// assertNotEq(lockBPTImplOld, lockImplNew);
// assertNotEq(voterBPTImplOld, voterImplNew);
//
// // uri is there on the new locks
// vm.startPrank(address(modeDAO));
// {
// lockMode.setBaseURI("https://lockmode.com/");
// lockBPT.setBaseURI("https://lockbpt.com/");
// }
// vm.stopPrank();
//
// // check that reset is allowed during a voting window
//
// // fetch a staker
// address staker = getStaker(network);
// bool isVotingActive = voterMode.votingActive();
// // are they voting? if not, move to voting window
//
// uint veNFT = VotingEscrow(voterMode.escrow()).ownedTokens(staker)[0];
// if (!voterMode.isVoting(veNFT)) {
// // create the gauge and vote for it
// vm.startPrank(address(modeDAO));
// {
// voterMode.unpause();
// voterMode.createGauge(address(1993), "");
// }
// vm.stopPrank();
//
// // vote by moving to voting window
// if (!isVotingActive) {
// vm.warp(block.timestamp + 1 weeks);
// }
//
// vm.startPrank(staker);
// {
// IGaugeVote.GaugeVote[] memory votes = new IGaugeVote.GaugeVote[](1);
// votes[0] = IGaugeVote.GaugeVote({weight: 1, gauge: address(1993)});
// voterMode.vote(veNFT, votes);
// }
// vm.stopPrank();
// }
//
// // move to the dist window
// if (isVotingActive) {
// vm.warp(block.timestamp + 1 weeks);
// }
//
// // call reset
// assertEq(voterMode.isVoting(veNFT), true);
// assertEq(voterMode.votingActive(), false);
//
// vm.startPrank(staker);
// {
// voterMode.reset(veNFT);
// }
// vm.stopPrank();
//
// assertEq(voterMode.isVoting(veNFT), false);
}

function _createAragonMsigProposal(