-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #956 from TempleDAO/stage
stage -> main
- Loading branch information
Showing
15 changed files
with
536 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ocol/scripts/deploys/mainnet/deploymentArgs/0x1d4f48f3F64c90a60ff302784CD66f1E8127852D.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// mainnet: STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.DAI=0x1d4f48f3F64c90a60ff302784CD66f1E8127852D | ||
// yarn hardhat verify --network mainnet 0x1d4f48f3F64c90a60ff302784CD66f1E8127852D --constructor-args scripts/deploys/mainnet/deploymentArgs/0x1d4f48f3F64c90a60ff302784CD66f1E8127852D.js | ||
module.exports = [ | ||
"0x9f90430179D9b67341BFa50559bc7B8E35629f1b", | ||
"0xb1E8AB0a81AaDf632a653E46Caeda1593d71d143", | ||
93600, | ||
13, | ||
"500000000000000000000000" | ||
]; |
11 changes: 11 additions & 0 deletions
11
...ocol/scripts/deploys/mainnet/deploymentArgs/0xA8a742A05982f853fb5836d040cf3498249041B9.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// mainnet: STRATEGIES.FOHMO_GNOSIS_STRATEGY.OTC_OFFER.OHM_DAI=0xA8a742A05982f853fb5836d040cf3498249041B9 | ||
// yarn hardhat verify --network mainnet 0xA8a742A05982f853fb5836d040cf3498249041B9 --constructor-args scripts/deploys/mainnet/deploymentArgs/0xA8a742A05982f853fb5836d040cf3498249041B9.js | ||
module.exports = [ | ||
"0x6B175474E89094C44Da98b954EedeAC495271d0F", | ||
"0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5", | ||
"0xA0eC2aF0aE7fE5F3Ae572a2C8349f7E26bE2e5Fd", | ||
"13900000000000000000", | ||
1, | ||
"13750000000000000000", | ||
"19000000000000000000" | ||
]; |
10 changes: 10 additions & 0 deletions
10
...ocol/scripts/deploys/mainnet/deploymentArgs/0xF179C63735690d2C08cfb231d15c0c7ac3A2Bc67.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// mainnet: STRATEGIES.FOHMO_GNOSIS_STRATEGY.ADDRESS=0xF179C63735690d2C08cfb231d15c0c7ac3A2Bc67 | ||
// yarn hardhat verify --network mainnet 0xF179C63735690d2C08cfb231d15c0c7ac3A2Bc67 --constructor-args scripts/deploys/mainnet/deploymentArgs/0xF179C63735690d2C08cfb231d15c0c7ac3A2Bc67.js | ||
module.exports = [ | ||
"0x9f90430179D9b67341BFa50559bc7B8E35629f1b", | ||
"0xb1E8AB0a81AaDf632a653E46Caeda1593d71d143", | ||
"FohmoStrategy", | ||
"0xf359Bae7b6AD295724e798A3Ef6Fa5109919F399", | ||
"0xA0eC2aF0aE7fE5F3Ae572a2C8349f7E26bE2e5Fd", | ||
"0x87B8D213177FB132e508b5d7018f7b590e00a480" | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
protocol/scripts/deploys/mainnet/team-payments/json/epoch23a.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"0xE58C06c3372687039140ceb64cB05f78D71fA133": 3250, | ||
"0xB8C400E4E9360ae7a3480A2F63e2A5aA85696148": 250, | ||
"0xe07d083d4A8810E5b35300a6De579fB2AF525e2F": 9000, | ||
"0x14d62c8faC60d71714F54bd3f7dF18433475968b": 12000, | ||
"0x66a60022c7B15BBbBe265C55Ad096e44f1138e19": 7500, | ||
"0xF26c0eBb04e794c666730233842Ca854D1747deF": 2500, | ||
"0x1cCbe98Ce51d3ba16A5F29b7f970c3e101ded67f": 10000, | ||
"0x07dA99dff5F996FaD9FCe0e15a20edC4DBeAe028": 14400, | ||
"0x038D946DD8488237D8E710a45b6E801F1Ee4dc01": 14000, | ||
"0xe345e9605391c13Fd2502e7141D54b752AaDB184": 12000, | ||
"0x036fea042993eba9Cbd0BFbAe5C325644230e292": 10000, | ||
"0x9F7eE729DDE0D95ffCf69F5606D534Ee47b303C0": 20000, | ||
"0x588282ADA5B9D872d0eBF506c5C1b541e2a60BBa": 14000, | ||
"0x97Ec4001aD1d2a1FBb581ea34C5C0Bd4a210C25C": 42500 | ||
} |
35 changes: 35 additions & 0 deletions
35
...cripts/deploys/mainnet/v2/05-fohmo-gnosis-strategy/01-gnosis-safe-circuit-breakers-dai.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleCircuitBreakerAllUsersPerPeriod__factory } from '../../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../../helpers'; | ||
import { getDeployedContracts } from '../contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLE_V2_ADDRESSES = getDeployedContracts(); | ||
|
||
const circuitBreakerFactory = new TempleCircuitBreakerAllUsersPerPeriod__factory(owner); | ||
await deployAndMine( | ||
'STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.DAI', | ||
circuitBreakerFactory, | ||
circuitBreakerFactory.deploy, | ||
TEMPLE_V2_ADDRESSES.CORE.RESCUER_MSIG, | ||
await owner.getAddress(), | ||
60*60*26, // 26 hours | ||
13, // no of buckets | ||
ethers.utils.parseEther("500000"), // 500k cap per bucket | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
38 changes: 38 additions & 0 deletions
38
...pts/deploys/mainnet/v2/05-fohmo-gnosis-strategy/02-gnosis-safe-circuit-breakers-temple.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Not yet needed for Templo Mayor, but may be in future | ||
|
||
import '@nomiclabs/hardhat-ethers'; | ||
// import { ethers } from 'hardhat'; | ||
// import { TempleCircuitBreakerAllUsersPerPeriod__factory } from '../../../../../typechain'; | ||
import { | ||
// deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../../helpers'; | ||
// import { getDeployedContracts } from '../contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
// const [owner] = await ethers.getSigners(); | ||
// const TEMPLE_V2_ADDRESSES = getDeployedContracts(); | ||
|
||
// const circuitBreakerFactory = new TempleCircuitBreakerAllUsersPerPeriod__factory(owner); | ||
|
||
// await deployAndMine( | ||
// 'STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.TEMPLE', | ||
// circuitBreakerFactory, | ||
// circuitBreakerFactory.deploy, | ||
// TEMPLE_V2_ADDRESSES.CORE.RESCUER_MSIG, | ||
// await owner.getAddress(), | ||
// 60*60*26, // 26 hours | ||
// 13, // no of buckets | ||
// ethers.utils.parseEther("10000000"), // 10mm cap per bucket | ||
// ); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
38 changes: 38 additions & 0 deletions
38
protocol/scripts/deploys/mainnet/v2/05-fohmo-gnosis-strategy/03-gnosis-strategy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import "@nomiclabs/hardhat-ethers"; | ||
import { ethers } from "hardhat"; | ||
import { | ||
GnosisStrategy__factory | ||
} from "../../../../../typechain"; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from "../../../helpers"; | ||
import { getDeployedContracts } from '../contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLE_V2_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new GnosisStrategy__factory(owner); | ||
await deployAndMine( | ||
"STRATEGIES.FOHMO_GNOSIS_STRATEGY.ADDRESS", | ||
factory, | ||
factory.deploy, | ||
TEMPLE_V2_ADDRESSES.CORE.RESCUER_MSIG, | ||
await owner.getAddress(), | ||
"FohmoStrategy", | ||
TEMPLE_V2_ADDRESSES.TREASURY_RESERVES_VAULT.ADDRESS, | ||
TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.UNDERLYING_GNOSIS_SAFE, | ||
TEMPLE_V2_ADDRESSES.CORE.CIRCUIT_BREAKER_PROXY, | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
37 changes: 37 additions & 0 deletions
37
protocol/scripts/deploys/mainnet/v2/05-fohmo-gnosis-strategy/04-otcOffer-ohm-dai.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { OtcOffer__factory } from '../../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../../helpers'; | ||
import { getDeployedContracts } from '../contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLE_V2_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new OtcOffer__factory(owner); | ||
await deployAndMine( | ||
'STRATEGIES.FOHMO_GNOSIS_STRATEGY.OTC_OFFER.OHM_DAI', | ||
factory, | ||
factory.deploy, | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, // user sell token | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.OLYMPUS.OHM_TOKEN, // user buy token | ||
TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.UNDERLYING_GNOSIS_SAFE, // fundsOwner | ||
ethers.utils.parseEther("13.90"), // initial offerPrice -- always 18 dp | ||
1, // offerPricingToken == DAI (USER_SELL_TOKEN) | ||
ethers.utils.parseEther("13.75"), // minOfferPrice | ||
ethers.utils.parseEther("19"), // maxOfferPrice | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
133 changes: 133 additions & 0 deletions
133
protocol/scripts/deploys/mainnet/v2/05-fohmo-gnosis-strategy/99-post-deploy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import "@nomiclabs/hardhat-ethers"; | ||
import { ethers } from "hardhat"; | ||
import { | ||
ensureExpectedEnvvars, | ||
mine, | ||
setExplicitAccess, | ||
} from "../../../helpers"; | ||
import { ContractInstances, ContractAddresses, connectToContracts, getDeployedContracts } from "../contract-addresses"; | ||
import { ITempleStrategy, TempleElevatedAccess } from "../../../../../typechain"; | ||
|
||
let TEMPLE_V2_ADDRESSES: ContractAddresses; | ||
let TEMPLE_V2_INSTANCES: ContractInstances; | ||
let TEMPLE_V2_EXECUTOR_INSTANCES: ContractInstances; | ||
|
||
const NAME = "FohmoStrategy"; | ||
// NAME_HASH === 0x4636ad4b030b2202c1535278671ad49fa591ff1ca722bee883692b03d34e68c8 | ||
const NAME_HASH = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(NAME)); | ||
|
||
// These will need to be created from the executor multisig | ||
async function setupFromExecutorMultisig() { | ||
{ | ||
// Circuit breaker identifiers | ||
await mine(TEMPLE_V2_EXECUTOR_INSTANCES.CORE.CIRCUIT_BREAKER_PROXY.setIdentifierForCaller( | ||
TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.ADDRESS, | ||
NAME | ||
)); | ||
|
||
// Circuit breaker for Dai | ||
await mine(TEMPLE_V2_EXECUTOR_INSTANCES.CORE.CIRCUIT_BREAKER_PROXY.setCircuitBreaker( | ||
NAME_HASH, | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, | ||
TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.DAI | ||
)); | ||
|
||
// No Temple CB for the main treasury strategy | ||
// Circuit breaker for Temple | ||
// await mine(TEMPLE_V2_EXECUTOR_INSTANCES.CORE.CIRCUIT_BREAKER_PROXY.setCircuitBreaker( | ||
// NAME_HASH, | ||
// TEMPLE_V2_ADDRESSES.CORE.TEMPLE_TOKEN, | ||
// TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.TEMPLE | ||
// )); | ||
} | ||
|
||
{ | ||
const debtCeiling: ITempleStrategy.AssetBalanceStruct[] = [ | ||
{ | ||
asset: TEMPLE_V2_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, | ||
balance: ethers.utils.parseEther("2000000"), // $2mm | ||
}, | ||
{ | ||
asset: TEMPLE_V2_ADDRESSES.CORE.TEMPLE_TOKEN, | ||
balance: ethers.utils.parseEther("0"), // No temple debt allowed | ||
} | ||
]; | ||
|
||
await mine(TEMPLE_V2_EXECUTOR_INSTANCES.TREASURY_RESERVES_VAULT.INSTANCE.addStrategy( | ||
TEMPLE_V2_ADDRESSES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.ADDRESS, | ||
0, // underperformingEquityThreshold | ||
debtCeiling | ||
)); | ||
} | ||
} | ||
|
||
async function setup() { | ||
{ | ||
// Grant permission for the circuit breaker proxy to call the underlying circuit breakers | ||
await setExplicitAccess( | ||
TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.DAI, | ||
TEMPLE_V2_ADDRESSES.CORE.CIRCUIT_BREAKER_PROXY, | ||
["preCheck"], | ||
true | ||
); | ||
|
||
// No Temple CB for the main treasury strategy | ||
// await setExplicitAccess( | ||
// TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.TEMPLE, | ||
// TEMPLE_V2_ADDRESSES.CORE.CIRCUIT_BREAKER_PROXY, | ||
// ["preCheck"], | ||
// true | ||
// ); | ||
} | ||
|
||
{ | ||
// Register DAI and Temple as the tokens to track | ||
// And also OHM/GOHM | ||
await mine(TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.INSTANCE.setAssets([ | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, | ||
TEMPLE_V2_ADDRESSES.CORE.TEMPLE_TOKEN, | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.OLYMPUS.OHM_TOKEN, | ||
TEMPLE_V2_ADDRESSES.EXTERNAL.OLYMPUS.GOHM_TOKEN, | ||
])); | ||
} | ||
} | ||
|
||
async function proposeExecutor(contract: TempleElevatedAccess, executor: string) { | ||
console.log(`proposing executor for contract: ${contract.address} = ${executor}`); | ||
await mine(contract.proposeNewExecutor(executor)); | ||
} | ||
|
||
async function proposeCore(contract: TempleElevatedAccess) { | ||
await proposeExecutor(contract, TEMPLE_V2_ADDRESSES.CORE.EXECUTOR_MSIG); | ||
} | ||
|
||
async function transferOwnership() { | ||
await proposeExecutor( | ||
TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.INSTANCE, | ||
TEMPLE_V2_ADDRESSES.CORE.EXECUTOR_MSIG, | ||
); | ||
await proposeCore(TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.DAI); | ||
// await proposeCore(TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.CIRCUIT_BREAKERS.TEMPLE); | ||
|
||
await mine(TEMPLE_V2_INSTANCES.STRATEGIES.FOHMO_GNOSIS_STRATEGY.OTC_OFFER.OHM_DAI.transferOwnership(TEMPLE_V2_ADDRESSES.CORE.EXECUTOR_MSIG)); | ||
} | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
TEMPLE_V2_ADDRESSES = getDeployedContracts(); | ||
TEMPLE_V2_INSTANCES = connectToContracts(owner); | ||
|
||
// await setup(); | ||
// await setupFromExecutorMultisig(); | ||
await transferOwnership(); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.