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/assert v2 #344

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
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
Binary file modified .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions addresses/arb_mainnet/deployers.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
"0xfe2Aba5ba890AF0ee8B6F2d488B1f85C9E7C5643",
"0xC7aE076086623ecEA2450e364C838916a043F9a8"
],
[
"0x40f0b18C7A41C04F848C033eD7F9178D9c5A80d8",
"0x885Bc35dC9B10EA39f2d7B3C94a7452a9ea442A7"
],
[
"0x9B19889794A30056A1E5Be118ee0a6647B184c5f",
"0x06FB6f89eAA936d4Cfe58FfA071cf8EAe17ac9AB"
Expand Down
4 changes: 4 additions & 0 deletions addresses/arb_mainnet/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
[
"limitedAssert",
"0x3201161c97E6B3c6e0e565d8Cd17ae5d0BEDb5F7"
],
[
"limitedAssertV2",
"0x40f0b18C7A41C04F848C033eD7F9178D9c5A80d8"
]
]
}
4 changes: 4 additions & 0 deletions addresses/mainnet/deployers.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
"0x08FfcB2D10C99F81A9EdD118548efb7AB7a0EeC4",
"0x06FB6f89eAA936d4Cfe58FfA071cf8EAe17ac9AB"
],
[
"0x40f0b18C7A41C04F848C033eD7F9178D9c5A80d8",
"0x885Bc35dC9B10EA39f2d7B3C94a7452a9ea442A7"
],
[
"0xB38Ba395D15392796B51057490bBc790871dd6a0",
"0x06FB6f89eAA936d4Cfe58FfA071cf8EAe17ac9AB"
Expand Down
4 changes: 4 additions & 0 deletions addresses/mainnet/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
[
"identityOracle",
"0x15D5667115c988dDD96FeCEE67A0A75207d58BFc"
],
[
"limitedAssertV2",
"0x40f0b18C7A41C04F848C033eD7F9178D9c5A80d8"
]
]
}
4 changes: 2 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ module.exports = {
},
tenderly: {
// update url of fork
url: "https://rpc.tenderly.co/fork/61c731e2-50d2-44e0-bdbf-791aa3c1c329",
url: "https://rpc.tenderly.co/fork/2c063048-b86a-4b52-95e1-77857426f54a",
// update chainId if necessary
forkNetwork: "1",
forkNetwork: "42161",
username: "Yield",
project: "v2",
timeout: 60_000_000,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@typechain/hardhat": "^6.0.0",
"@types/mocha": "^8.0.0",
"@yield-protocol/strategy-v2": "2.0.3",
"@yield-protocol/utils-v2": "2.6.11",
"@yield-protocol/utils-v2": "^2.6.14",
"@yield-protocol/vault-v2": "0.18.12",
"@yield-protocol/yieldspace-tv": "0.1.10",
"@yield-protocol/yieldspace-tv": "0.1.10",
"chai": "4.2.0",
"dss-interfaces": "0.1.1",
"erc3156": "^0.4.8",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { LIMITED_ASSERT } from '../../../../../shared/constants'
import { LIMITED_ASSERT_V2 } from '../../../../../shared/constants'
import { readAddressMappingIfExists } from '../../../../../shared/helpers'

import * as base_config from '../../../base.mainnet.config'
import * as base_config from '../../../base.arb_mainnet.config'

import { ContractDeployment } from '../../../confTypes'

export const chainId: number = base_config.chainId
export const governance: Map<string, string> = base_config.governance
export const protocol = () => readAddressMappingIfExists('protocol.json')
export const deployer: string = '0xC7aE076086623ecEA2450e364C838916a043F9a8'
export const developer: string = '0xC7aE076086623ecEA2450e364C838916a043F9a8'
export const deployer: string = '0x885Bc35dC9B10EA39f2d7B3C94a7452a9ea442A7'
export const developer: string = '0x885Bc35dC9B10EA39f2d7B3C94a7452a9ea442A7'

// ----- deployment parameters -----
export const contractDeployments: ContractDeployment[] = [
{
addressFile: 'protocol.json',
name: LIMITED_ASSERT,
name: LIMITED_ASSERT_V2,
contract: 'Assert',
args: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -eux
export HERE=$(dirname $0)
export CONF=$PWD/$HERE/addAssert.config.ts
RUN="npx hardhat run --network mainnet"
RUN="npx hardhat run --network arb_mainnet"

# $RUN $HERE/../../../../../shared/deploy.ts
$RUN $HERE/addAssert.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Timelock__factory, Ladle__factory } from '../../../../../typechain'
import { getOwnerOrImpersonate, propose } from '../../../../../shared/helpers'
import { addIntegration } from '../../../../fragments/ladle/addIntegration'
import { TIMELOCK, LADLE, LIMITED_ASSERT } from '../../../../../shared/constants'
import { TIMELOCK, LADLE, LIMITED_ASSERT, LIMITED_ASSERT_V2 } from '../../../../../shared/constants'

const { developer } = require(process.env.CONF as string)
const { protocol, governance } = require(process.env.CONF as string)
Expand All @@ -16,7 +16,7 @@ const { protocol, governance } = require(process.env.CONF as string)

let proposal: Array<{ target: string; data: string }> = await addIntegration(
ladle,
protocol().getOrThrow(LIMITED_ASSERT)
protocol().getOrThrow(LIMITED_ASSERT_V2)
)
await propose(timelock, proposal, developer)
})()
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0xee17cd891a76d980ab0c8586ce07f6f00a77697d6f4f58d84a3b51b1d5766908 0xbaae8abf00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000016e25cf364cecc305590128335b8f327975d056000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f888f2200000000000000000000000003201161c97e6b3c6e0e565d8cd17ae5d0bedb5f7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
0x31c130743ba866b683c8a90b8123c2cfa83c800bf918c75800e730d74e5a47ba 0xbaae8abf00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000016e25cf364cecc305590128335b8f327975d056000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f888f22000000000000000000000000040f0b18c7a41c04f848c033ed7f9178d9c5a80d8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x3b8e1a38ba6a2ff54df486bfc4507cdf630e7b152cab30f05585c755626125fc 0xbaae8abf0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f888f22000000000000000000000000041bf71a2109fbdf7e5064a7421eaefeabf7a12f7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
0x3a4d5c2ad6b0c8e3df23a59f6e5a43f6f3d531461ebf9dac1cf51932cb975f40 0xbaae8abf0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f888f22000000000000000000000000040f0b18c7a41c04f848c033ed7f9178d9c5a80d8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
12 changes: 6 additions & 6 deletions scripts/governance/base.mainnet.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2306,11 +2306,11 @@ const ysFRAX6MJD: Strategy = {
base: frax,
}

const ysUSDT6MMS: Strategy = {
assetId: YSUSDT6MMS,
address: strategyAddresses.getOrThrow(YSUSDT6MMS)!,
base: usdt,
}
// const ysUSDT6MMS: Strategy = {
// assetId: YSUSDT6MMS,
// address: strategyAddresses.getOrThrow(YSUSDT6MMS)!,
// base: usdt,
// }

const ysUSDT6MJD: Strategy = {
assetId: YSUSDT6MJD,
Expand All @@ -2327,6 +2327,6 @@ export const strategies: Map<string, Strategy> = new Map([
[YSUSDC6MJD, ysUSDC6MJD],
// [YSFRAX6MMS, ysFRAX6MMS],
[YSFRAX6MJD, ysFRAX6MJD],
[YSUSDT6MMS, ysUSDT6MMS],
// [YSUSDT6MMS, ysUSDT6MMS],
[YSUSDT6MJD, ysUSDT6MJD],
])
1 change: 1 addition & 0 deletions shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export const ONCHAINTEST = 'onChainTest'
export const HEALER = 'healerModule'
export const ASSERT = 'assert'
export const LIMITED_ASSERT = 'limitedAssert'
export const LIMITED_ASSERT_V2 = 'limitedAssertV2'

export const LIDO_PROVIDER = '10'
export const YEARN_PROVIDER = '11'
Expand Down
9 changes: 6 additions & 3 deletions shared/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const { developer, governance, contractDeployments } = require(process.env.CONF
let deployerAcc = (await ethers.getSigners())[0] // We never impersonate when deploying
const timelock = Timelock__factory.connect(governance.getOrThrow(TIMELOCK), deployerAcc)

console.log('Deployer Account:', deployerAcc.address)
console.log('Deployer Balance:', await deployerAcc.getBalance())

for (let params_ of contractDeployments) {
const params: ContractDeployment = params_ // Only way I know to cast this

Expand All @@ -30,7 +33,7 @@ const { developer, governance, contractDeployments } = require(process.env.CONF
deployed = await contractFactory.deploy(...expandedArgs)

await deployed.deployed()
console.log(`${getName(params.name)} ${params.contract} deployed at ${deployed.address}`)
console.log(`${getName(params.name)} as ${params.contract}.sol deployed at ${deployed.address}`)

const addressMap = readAddressMappingIfExists(params.addressFile)
addressMap.set(params.name, deployed.address)
Expand All @@ -40,15 +43,15 @@ const { developer, governance, contractDeployments } = require(process.env.CONF
deployerAddressMap.set(deployed.address, deployerAcc.address)
writeAddressMap('deployers.json', deployerAddressMap)

verify(params.name, deployed, expandedArgs, params.libs)
verify(params.contract, deployed, expandedArgs, params.libs)

// Give ROOT to the Timelock only if we haven't done so yet, and only if the contract inherits AccessControl
if (deployed.interface.functions['ROOT()'] && !(await deployed.hasRole(ROOT, timelock.address))) {
await (await deployed.grantRole(ROOT, timelock.address)).wait(1)
console.log(`${getName(params.name)}.grantRoles(ROOT, timelock)`)
}
} else {
console.log(`Reusing ${getName(params.name)} ${params.contract} at: ${deployedAddress}`)
console.log(`Reusing ${getName(params.name)} as ${params.contract}.sol at: ${deployedAddress}`)
}
}
})()
Loading