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

3.4.0 Spell - Add checks for Base #1137

Merged
merged 7 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ PROTO_IMPL=0
# Run gas reporter and specific gas tests, if truthy
# REPORT_GAS=1

# Subgraph url to make queries to The Graph
# SUBGRAPH_URL=
# Subgraph URLs to make queries to The Graph (by network)
# MAINNET_SUBGRAPH_URL=
# BASE_SUBGRAPH_URL=
# ARBITRUM_SUBGRAPH_URL=

# RPC URL to interact with a tenderly forked network
# TENDERLY_RPC_URL="https://rpc.tenderly.co/fork/15af2920-4719-4e62-a5ea-ab8b9e90a258"
Expand Down
4 changes: 2 additions & 2 deletions common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ export const networkConfig: { [key: string]: INetworkConfig } = {
cbETH: '0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22',
cUSDbCv3: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
cUSDCv3: '0xb125E6687d4313864e53df431d5425969c15Eb2F',
wcUSDCv3: '0xA694f7177C6c839C951C74C797283B35D0A486c8',
wcUSDCv3: '0x53f1Df4E5591Ae35Bf738742981669c3767241FA',
aBasUSDC: '0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB',
saBasUSDC: '0x184460704886f9F2A7F3A0c2887680867954dC6E', // our wrapper
saBasUSDC: '0x6F6f81e5E66f503184f2202D83a79650c3285759', // our wrapper
aWETHv3: '0xD4a0e0b9149BCee3C920d2E00b5dE09138fd8bb7',
acbETHv3: '0xcf3D55c10DB69f28fD1A75Bd73f3D8A2d9c595ad',
sUSDbC: '0x4c80e24119cfb836cdf0a6b53dc23f04f7e652ca',
Expand Down
12 changes: 0 additions & 12 deletions contracts/spells/3_4_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
*
* Only works on Mainnet and Base. Only supports RTokens listed on the Register as of May 1, 2024
*/
contract Upgrade3_4_0 {

Check warning on line 26 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Contract name must be in CamelCase
bytes32 constant ALEXIOS_HASH = keccak256(abi.encodePacked("Governor Alexios"));

Check warning on line 27 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state
bytes32 constant ANASTASIUS_HASH = keccak256(abi.encodePacked("Governor Anastasius"));

Check warning on line 28 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state

// Main
bytes32 constant MAIN_OWNER_ROLE = bytes32("OWNER");

Check warning on line 31 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state

// Timelock
bytes32 constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE");

Check warning on line 34 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state
bytes32 constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");

Check warning on line 35 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state
bytes32 constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");

Check warning on line 36 in contracts/spells/3_4_0.sol

View workflow job for this annotation

GitHub Actions / Lint Checks

Explicitly mark visibility of state
bytes32 constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");

// ======================================================================================
Expand Down Expand Up @@ -242,18 +242,6 @@
rotations[IERC20(0xA694f7177C6c839C951C74C797283B35D0A486c8)] = IAsset(
0xf7a9D27c3B60c78c6F6e2c2d6ED6E8B94b352461 // wcUSDCv3
);
rotations[IERC20(0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22)] = IAsset(
0x851B461a9744f4c9E996C03072cAB6f44Fa04d0D // cbETH
);
rotations[IERC20(0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22)] = IAsset(
0x851B461a9744f4c9E996C03072cAB6f44Fa04d0D // cbETH
);
rotations[IERC20(0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452)] = IAsset(
0x8b4374005291B8FCD14C4E947604b2FB3C660A73 // wstETH
);
rotations[IERC20(0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452)] = IAsset(
0x8b4374005291B8FCD14C4E947604b2FB3C660A73 // wstETH
);
}
}

Expand Down
15 changes: 10 additions & 5 deletions tasks/validation/proposal-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
executeProposal,
proposeUpgrade,
stakeAndDelegateRsr,
unstakeAndWithdrawRsr,
moveProposalToActive,
voteProposal,
} from './utils/governance'
Expand All @@ -30,6 +31,7 @@ import { StRSRP1Votes } from '@typechain/StRSRP1Votes'
import { IMain } from '@typechain/IMain'
import { Whales, getWhalesFile } from '#/scripts/whalesConfig'
import { proposal_3_4_0_step_1, proposal_3_4_0_step_2 } from './proposals/3_4_0'
import { validateSubgraphURL, Network } from '#/utils/fork'

interface Params {
proposalid?: string
Expand All @@ -53,9 +55,7 @@ task('proposal-validator', 'Runs a proposal and confirms can fully rebalance + r
}

// make sure subgraph is configured
if (params.proposalid && !useEnv('SUBGRAPH_URL')) {
throw new Error('SUBGRAPH_URL required for subgraph queries')
}
if (params.proposalid) validateSubgraphURL(useEnv('FORK_NETWORK') as Network)

console.log(`Network Block: ${await getLatestBlockNumber(hre)}`)

Expand Down Expand Up @@ -249,7 +249,7 @@ task('run-validations', 'Runs all validations')
claim rewards
*/

await rToken.connect(tester).transfer(await main.rsrTrader(), mintAmt)
await rToken.connect(tester).transfer(await main.rsrTrader(), mintAmt.div(10))
await processRevenue(hre, params.rtoken)

await pushOraclesForward(hre, params.rtoken, [])
Expand All @@ -274,7 +274,7 @@ const runCheck_stakeUnstake = async (
const rsr = await hre.ethers.getContractAt('StRSRP1Votes', await main.rsr())
await whileImpersonating(
hre,
whales[networkConfig['1'].tokens.RSR!.toLowerCase()],
whales[networkConfig[chainId].tokens.RSR!.toLowerCase()],
async (rsrSigner) => {
await rsr.connect(rsrSigner).transfer(tester.address, stakeAmount)
}
Expand All @@ -288,6 +288,11 @@ const runCheck_stakeUnstake = async (

expect(await rsr.balanceOf(stRSR.address)).to.equal(balPrevRSR.add(testerBal))
expect(await stRSR.balanceOf(tester.address)).to.be.gt(balPrevStRSR)

// Unstake and withdraw
await unstakeAndWithdrawRsr(hre, rToken.address, tester.address)

console.log('Successfully staked and unstaked RSR')
}

const runCheck_redeem = async (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targets": [
"0xA582985c68ED30a052Ff0b07D74931140bd5a00F",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x85b622fc000000000000000000000000cc7ff230365bd730ee4b352cc2492cedac49383e0000000000000000000000005ef74a083ac932b5f050bf41cde1f67c659b4b88"
],
"description": "3.4.0 Upgrade (2/2) - Cleanup",
"rtoken": "0xCc7FF230365bD730eE4B352cC2492CEdAC49383e",
"governor": "0x5Ef74A083Ac932b5f050bf41cDe1F67c659b4b88",
"timelock": "0xf093d7f00f3dCe6d415Be564f41Cb4bc032fb367",
"proposalId": "103166028388292049911090170431533045914770640551559995795062459176094156896173"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targets": [
"0x6c678DE5334B86EAeEe6d9c8a2d59FfB9E4167F2",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x85b622fc000000000000000000000000c9a3e2b3064c1c0546d3d0edc0a748e9f93cf18d000000000000000000000000c8f487b34251eb76761168b70dc10fa38b0bd90b"
],
"description": "3.4.0 Upgrade (2/2) - Cleanup",
"rtoken": "0xC9a3e2B3064c1c0546D3D0edc0A748E9f93Cf18d",
"governor": "0xC8f487B34251Eb76761168B70Dc10fA38B0Bd90b",
"timelock": "0xeE3eC997A37e661a42673D7A489Fbf0E5ed0C223",
"proposalId": "15188044512396426086635051099397280340801935274596897161146079564465089198405"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"targets": [
"0xDf699488CA4340F71d24Cff1424146c836407d4e",
"0xE67cEb03EfdF9B3fb5C3FeBF3103e2efd3a76A1b",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x2f2ff15d5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0xdc056df5000000000000000000000000641b0453487c9d14c5df96d45a481ef1dc84e31f0000000000000000000000000f7f1442da7f687bb877fbee0539fa8d6e4d1a02"
],
"description": "3.4.0 Upgrade (1/2) - Core Contracts + Plugins",
"rtoken": "0x641B0453487C9D14c5df96d45a481ef1dc84e31f",
"governor": "0x0f7f1442dA7F687BB877Fbee0539FA8D6e4d1a02",
"timelock": "0xE67cEb03EfdF9B3fb5C3FeBF3103e2efd3a76A1b",
"proposalId": "17508456621436980014154885939607570949783300981270367139313444650805863441870"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targets": [
"0x5f835eA13721B11A7543C8f9C94aA840c1f2Da52",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x85b622fc000000000000000000000000cb327b99ff831bf8223cced12b1338ff3aa322ff0000000000000000000000008a11d590b32186e1236b5e75f2d8d72c280dc880"
],
"description": "3.4.0 Upgrade (2/2) - Cleanup",
"rtoken": "0xCb327b99fF831bF8223cCEd12B1338FF3aA322Ff",
"governor": "0x8A11D590B32186E1236B5E75F2d8D72c280dc880",
"timelock": "0x321f7493B8B675dFfE2570Bd0F164237D445b9E8",
"proposalId": "34946723641477974470327699217213685574953135055878807404531417354084704897219"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"targets": [
"0x520b2781C96d0Bd130c9b50930965779Eb572A40",
"0xd18ED37CA912bbf1EDE93d27459d03DC4343dea1",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x2f2ff15d5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0xdc056df5000000000000000000000000fe0d6d83033e313691e96909d2188c150b834285000000000000000000000000fe637f7d5b848392c19052631d68f8ac859f71cf"
],
"description": "3.4.0 Upgrade (1/2) - Core Contracts + Plugins",
"rtoken": "0xfE0D6D83033e313691E96909d2188C150b834285",
"governor": "0xfe637F7D5B848392c19052631d68F8AC859F71cF",
"timelock": "0xd18ED37CA912bbf1EDE93d27459d03DC4343dea1",
"proposalId": "54601466239135598221493209404756826897787570017294414368736993069041863896076"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targets": [
"0x520b2781C96d0Bd130c9b50930965779Eb572A40",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x85b622fc000000000000000000000000fe0d6d83033e313691e96909d2188c150b834285000000000000000000000000aeca35f0cb9d12d68adc4d734d4383593f109654"
],
"description": "3.4.0 Upgrade (2/2) - Cleanup",
"rtoken": "0xfE0D6D83033e313691E96909d2188C150b834285",
"governor": "0xaeCa35F0cB9d12D68adC4d734D4383593F109654",
"timelock": "0xd18ED37CA912bbf1EDE93d27459d03DC4343dea1",
"proposalId": "70249172271972436177095752153813145098346724557504081765616154108487564903493"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targets": [
"0xDf699488CA4340F71d24Cff1424146c836407d4e",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x85b622fc000000000000000000000000641b0453487c9d14c5df96d45a481ef1dc84e31f000000000000000000000000437b525f96a2da0a4b165efe27c61bea5c8d3cd4"
],
"description": "3.4.0 Upgrade (2/2) - Cleanup",
"rtoken": "0x641B0453487C9D14c5df96d45a481ef1dc84e31f",
"governor": "0x437b525F96A2Da0A4b165efe27c61bea5c8d3CD4",
"timelock": "0xE67cEb03EfdF9B3fb5C3FeBF3103e2efd3a76A1b",
"proposalId": "84058509685811707686891343967388905489857303404417702805482635233546525785956"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"targets": [
"0x6c678DE5334B86EAeEe6d9c8a2d59FfB9E4167F2",
"0xeE3eC997A37e661a42673D7A489Fbf0E5ed0C223",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x2f2ff15d5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0xdc056df5000000000000000000000000c9a3e2b3064c1c0546d3d0edc0a748e9f93cf18d000000000000000000000000eb583ea06501f92e994c353ad2741a35582987aa"
],
"description": "3.4.0 Upgrade (1/2) - Core Contracts + Plugins",
"rtoken": "0xC9a3e2B3064c1c0546D3D0edc0A748E9f93Cf18d",
"governor": "0xEb583EA06501f92E994C353aD2741A35582987aA",
"timelock": "0xeE3eC997A37e661a42673D7A489Fbf0E5ed0C223",
"proposalId": "84951349045934296838874132345819673327722797306648870828803756316119981110458"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"targets": [
"0x5f835eA13721B11A7543C8f9C94aA840c1f2Da52",
"0x321f7493B8B675dFfE2570Bd0F164237D445b9E8",
"0x162A433068F51e18b7d13932F27e66a3f99E6890"
],
"values": [
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
},
{
"type": "BigNumber",
"hex": "0x00"
}
],
"calldatas": [
"0x2f2ff15d4f574e4552000000000000000000000000000000000000000000000000000000000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0x2f2ff15d5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5000000000000000000000000162a433068f51e18b7d13932f27e66a3f99e6890",
"0xdc056df5000000000000000000000000cb327b99ff831bf8223cced12b1338ff3aa322ff000000000000000000000000b05c6a7242595f2e23cc6a0ab20699d63d0939fd"
],
"description": "3.4.0 Upgrade (1/2) - Core Contracts + Plugins",
"rtoken": "0xCb327b99fF831bF8223cCEd12B1338FF3aA322Ff",
"governor": "0xB05C6a7242595f2E23CC6a0aB20699d63D0939Fd",
"timelock": "0x321f7493B8B675dFfE2570Bd0F164237D445b9E8",
"proposalId": "91664961925424681127077384785168458913002220410440246950477582879158138595115"
}
Loading
Loading