Skip to content

Commit d571f3c

Browse files
authored
OETH proxy (#1269)
* add empty proxy contract * prettier * set the timelock as the governor of the vault * correct deploy script and add deployment files * prettier * force skip 049 deploy in test/local environment
1 parent 73824cf commit d571f3c

File tree

10 files changed

+834
-3
lines changed

10 files changed

+834
-3
lines changed

contracts/contracts/proxies/Proxies.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,10 @@ contract ConvexLUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
9393
contract MorphoAaveStrategyProxy is InitializeGovernedUpgradeabilityProxy {
9494

9595
}
96+
97+
/**
98+
* @notice OETHProxy delegates calls to nowhere for now
99+
*/
100+
contract OETHProxy is InitializeGovernedUpgradeabilityProxy {
101+
102+
}

contracts/contracts/token/OETH.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// SPDX-License-Identifier: agpl-3.0
2+
pragma solidity ^0.8.0;
3+
4+
/**
5+
* @title OETH Token Contract
6+
* @author Origin Protocol Inc
7+
*/
8+
9+
contract OETH {
10+
11+
}

contracts/deploy/049_oeth_proxy.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const { deploymentWithProposal } = require("../utils/deploy");
2+
const addresses = require("../utils/addresses");
3+
4+
module.exports = deploymentWithProposal(
5+
{ deployName: "049_oeth_proxy", forceDeploy: false, forceSkip: true },
6+
async ({ deployWithConfirmation, ethers, getTxOpts, withConfirmation }) => {
7+
const { deployerAddr, governorAddr } = await getNamedAccounts();
8+
const sDeployer = await ethers.provider.getSigner(deployerAddr);
9+
10+
// Deployer Actions
11+
// ----------------
12+
13+
// 1. Deploy new proxy
14+
// New OETH proxy
15+
const dOethProxy = await deployWithConfirmation("OETHProxy");
16+
const cOethProxy = await ethers.getContractAt(
17+
"OETHProxy",
18+
dOethProxy.address
19+
);
20+
21+
// 2. Deploy new implementation
22+
const dOETHImpl = await deployWithConfirmation("OETH");
23+
24+
// 3. Init the proxy to point at the implementation
25+
await withConfirmation(
26+
cOethProxy
27+
.connect(sDeployer)
28+
["initialize(address,address,bytes)"](
29+
dOETHImpl.address,
30+
deployerAddr,
31+
[],
32+
await getTxOpts()
33+
)
34+
);
35+
36+
// 5. Transfer governance
37+
await withConfirmation(
38+
cOethProxy
39+
.connect(sDeployer)
40+
.transferGovernance(addresses.mainnet.Guardian, await getTxOpts())
41+
);
42+
43+
// Governance Actions
44+
// ----------------
45+
return {
46+
name: "Deploy an empty OETH proxy",
47+
actions: [],
48+
};
49+
}
50+
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"address": "0x84E45FDD8AC0E1Ef13Da5F78037255009842d135",
3+
"abi": [],
4+
"transactionHash": "0x413d8d25fbb91f65512291a66f3d1570dd86c5a62c252feddcb517e75e8c6aff",
5+
"receipt": {
6+
"to": null,
7+
"from": "0xFD9E6005187F448957a0972a7d0C0A6dA2911236",
8+
"contractAddress": "0x84E45FDD8AC0E1Ef13Da5F78037255009842d135",
9+
"transactionIndex": 21,
10+
"gasUsed": "67054",
11+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
12+
"blockHash": "0xd1661fa30600d254dbacb3b8962ebcd22899af6fd312a6dd09571712f6a9170c",
13+
"transactionHash": "0x413d8d25fbb91f65512291a66f3d1570dd86c5a62c252feddcb517e75e8c6aff",
14+
"logs": [],
15+
"blockNumber": 16935270,
16+
"cumulativeGasUsed": "2734778",
17+
"status": 1,
18+
"byzantium": true
19+
},
20+
"args": [],
21+
"solcInputHash": "fd147e8addb65b93518dc23db070bf76",
22+
"metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Origin Protocol Inc\",\"kind\":\"dev\",\"methods\":{},\"title\":\"OETH Token Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/token/OETH.sol\":\"OETH\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/token/OETH.sol\":{\"content\":\"// SPDX-License-Identifier: agpl-3.0\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title OETH Token Contract\\n * @author Origin Protocol Inc\\n */\\n\\ncontract OETH {\\n\\n}\\n\",\"keccak256\":\"0x669b1bbf01a735f64da3c3b8b07609bc06786118d77de161453f9b7b3b1b1f6b\",\"license\":\"agpl-3.0\"}},\"version\":1}",
23+
"bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212206bb94800cdbb2edf83d59010762037cc18a1bf10a4c78d38d9deff91ec19c15e64736f6c63430008070033",
24+
"deployedBytecode": "0x6080604052600080fdfea26469706673582212206bb94800cdbb2edf83d59010762037cc18a1bf10a4c78d38d9deff91ec19c15e64736f6c63430008070033",
25+
"devdoc": {
26+
"author": "Origin Protocol Inc",
27+
"kind": "dev",
28+
"methods": {},
29+
"title": "OETH Token Contract",
30+
"version": 1
31+
},
32+
"userdoc": {
33+
"kind": "user",
34+
"methods": {},
35+
"version": 1
36+
},
37+
"storageLayout": {
38+
"storage": [],
39+
"types": null
40+
}
41+
}

contracts/deployments/mainnet/OETHProxy.json

Lines changed: 284 additions & 0 deletions
Large diffs are not rendered by default.

contracts/deployments/mainnet/solcInputs/7bf73564df328e96d119499b0010ce76.json

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"contracts/token/OETH.sol": {
5+
"content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity ^0.8.0;\n\n/**\n * @title OETH Token Contract\n * @author Origin Protocol Inc\n */\n\ncontract OETH {\n\n}\n"
6+
}
7+
},
8+
"settings": {
9+
"optimizer": {
10+
"enabled": true,
11+
"runs": 200
12+
},
13+
"outputSelection": {
14+
"*": {
15+
"*": [
16+
"abi",
17+
"evm.bytecode",
18+
"evm.deployedBytecode",
19+
"evm.methodIdentifiers",
20+
"metadata",
21+
"devdoc",
22+
"userdoc",
23+
"storageLayout",
24+
"evm.gasEstimates"
25+
],
26+
"": [
27+
"ast"
28+
]
29+
}
30+
},
31+
"metadata": {
32+
"useLiteralContent": true
33+
}
34+
}
35+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"storage": [],
3+
"types": {}
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"storage": [],
3+
"types": {}
4+
}

contracts/utils/deploy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,11 @@ const sanityCheckOgvGovernance = async () => {
479479
);
480480

481481
const vaultGovernor = await VaultAdmin.governor();
482-
const { governorFiveAddr } = await getNamedAccounts();
482+
const { timelockAddr } = await getNamedAccounts();
483483

484-
if (vaultGovernor.toLowerCase() !== governorFiveAddr.toLowerCase()) {
484+
if (vaultGovernor.toLowerCase() !== timelockAddr.toLowerCase()) {
485485
throw new Error(
486-
`Hardhat environment has ${governorFiveAddr} governor address configured which is different from Vault's governor: ${vaultGovernor}`
486+
`Hardhat environment has ${timelockAddr} governor address configured which is different from Vault's governor: ${vaultGovernor}`
487487
);
488488
}
489489
}

0 commit comments

Comments
 (0)