Skip to content

Commit f685004

Browse files
chore: plasma injector deploy scripts (#60)
1 parent d379f07 commit f685004

File tree

6 files changed

+80
-4
lines changed

6 files changed

+80
-4
lines changed

foundry.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"lib/aave-helpers": {
66
"branch": {
77
"name": "main",
8-
"rev": "4f4a6631248c19e895997b072302776b6381dd9b"
8+
"rev": "7bfd10280b5c491d543723c1b8b2b82f89ff3117"
99
}
1010
}
1111
}

scripts/deploy/DeployDiscountRateInjector.s.sol

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import 'solidity-utils/contracts/utils/ScriptUtils.sol';
55
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
66
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
77
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
8+
import {AaveV3Plasma} from 'aave-address-book/AaveV3Plasma.sol';
9+
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
810
import {ICreate3Factory} from 'solidity-utils/contracts/create3/interfaces/ICreate3Factory.sol';
911
import {EdgeRiskStewardDiscountRate, IRiskSteward} from '../../src/contracts/EdgeRiskStewardDiscountRate.sol';
1012
import {AaveStewardInjectorDiscountRate} from '../../src/contracts/AaveStewardInjectorDiscountRate.sol';
@@ -101,3 +103,40 @@ contract DeployEthereum is EthereumScript {
101103
vm.stopBroadcast();
102104
}
103105
}
106+
107+
// make deploy-ledger contract=scripts/deploy/DeployDiscountRateInjector.s.sol:DeployPlasma chain=plasma
108+
contract DeployPlasma is PlasmaScript {
109+
address constant GUARDIAN = 0x1cF16B4e76D4919bD939e12C650b8F6eb9e02916;
110+
address constant EDGE_RISK_ORACLE = 0xAe48F22903d43f13f66Cc650F57Bd4654ac222cb;
111+
address constant CREATE_3_FACTORY = 0xc4A82c968540B47032F3a51fA7e4f09f6FAE3308;
112+
113+
function run() external {
114+
vm.startBroadcast();
115+
bytes32 salt = 'DiscountRateStewardInjector';
116+
address predictedStewardsInjector = ICreate3Factory(CREATE_3_FACTORY)
117+
.predictAddress(msg.sender, salt);
118+
119+
address riskSteward = DeployStewardContracts._deployRiskStewards(
120+
DeployStewardContracts.DeployStewardInput({
121+
pool: address(AaveV3Plasma.POOL),
122+
configEngine: AaveV3Plasma.CONFIG_ENGINE,
123+
riskCouncil: predictedStewardsInjector,
124+
owner: GovernanceV3Plasma.EXECUTOR_LVL_1
125+
})
126+
);
127+
128+
DeployStewardContracts._deployDiscountRateStewardInjector(
129+
DeployStewardContracts.DeployInjectorInput({
130+
create3Factory: CREATE_3_FACTORY,
131+
salt: salt,
132+
riskSteward: riskSteward,
133+
aaveOracle: address(AaveV3Plasma.ORACLE),
134+
edgeRiskOracle: EDGE_RISK_ORACLE,
135+
owner: GovernanceV3Plasma.EXECUTOR_LVL_1,
136+
guardian: GUARDIAN,
137+
whitelistedMarkets: new address[](0)
138+
})
139+
);
140+
vm.stopBroadcast();
141+
}
142+
}

scripts/deploy/DeployEModeInjector.s.sol

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import 'solidity-utils/contracts/utils/ScriptUtils.sol';
55
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
66
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
77
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
8+
import {MiscPlasma} from 'aave-address-book/MiscPlasma.sol';
9+
import {AaveV3Plasma} from 'aave-address-book/AaveV3Plasma.sol';
10+
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
811
import {ICreate3Factory} from 'solidity-utils/contracts/create3/interfaces/ICreate3Factory.sol';
912
import {EdgeRiskStewardEMode, IRiskSteward} from '../../src/contracts/EdgeRiskStewardEMode.sol';
1013
import {AaveStewardInjectorEMode} from '../../src/contracts/AaveStewardInjectorEMode.sol';
@@ -133,3 +136,37 @@ contract DeployEthereum is EthereumScript {
133136
vm.stopBroadcast();
134137
}
135138
}
139+
140+
// make deploy-ledger contract=scripts/deploy/DeployEModeInjector.s.sol:DeployPlasma chain=plasma
141+
contract DeployPlasma is PlasmaScript {
142+
address constant GUARDIAN = 0x1cF16B4e76D4919bD939e12C650b8F6eb9e02916;
143+
address constant EDGE_RISK_ORACLE = 0xAe48F22903d43f13f66Cc650F57Bd4654ac222cb;
144+
address constant CREATE_3_FACTORY = 0xc4A82c968540B47032F3a51fA7e4f09f6FAE3308;
145+
146+
function run() external {
147+
vm.startBroadcast();
148+
bytes32 salt = 'EModeStewardInjector';
149+
address predictedStewardsInjector = ICreate3Factory(CREATE_3_FACTORY)
150+
.predictAddress(msg.sender, salt);
151+
152+
address riskSteward = DeployStewardContracts._deployRiskStewards(
153+
address(AaveV3Plasma.POOL),
154+
AaveV3Plasma.CONFIG_ENGINE,
155+
predictedStewardsInjector,
156+
GovernanceV3Plasma.EXECUTOR_LVL_1
157+
);
158+
159+
uint8[] memory whitelistedEModes = new uint8[](0);
160+
161+
DeployStewardContracts._deployEModeStewardInjector(
162+
CREATE_3_FACTORY,
163+
salt,
164+
riskSteward,
165+
EDGE_RISK_ORACLE,
166+
GovernanceV3Plasma.EXECUTOR_LVL_1,
167+
GUARDIAN,
168+
whitelistedEModes
169+
);
170+
vm.stopBroadcast();
171+
}
172+
}

src/contracts/AaveStewardInjectorDiscountRate.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ contract AaveStewardInjectorDiscountRate is AaveStewardInjectorBase {
3737
/// @inheritdoc AaveStewardInjectorBase
3838
function getUpdateTypes() public pure override returns (string[] memory updateTypes) {
3939
updateTypes = new string[](1);
40-
updateTypes[0] = 'PendleDiscountRateUpdate_Core';
40+
updateTypes[0] = 'PendleDiscountRateUpdate';
4141
}
4242

4343
/// @inheritdoc AaveStewardInjectorBase

src/contracts/AaveStewardInjectorEMode.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ contract AaveStewardInjectorEMode is AaveStewardInjectorBase {
4242
/// @inheritdoc AaveStewardInjectorBase
4343
function getUpdateTypes() public pure override returns (string[] memory updateTypes) {
4444
updateTypes = new string[](1);
45-
updateTypes[0] = 'EModeCategoryUpdate_Core';
45+
updateTypes[0] = 'EModeCategoryUpdate';
4646
}
4747

4848
/// @inheritdoc AaveStewardInjectorBase

0 commit comments

Comments
 (0)