Skip to content
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
2 changes: 1 addition & 1 deletion foundry.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lib/aave-helpers": {
"branch": {
"name": "main",
"rev": "4f4a6631248c19e895997b072302776b6381dd9b"
"rev": "7bfd10280b5c491d543723c1b8b2b82f89ff3117"
}
}
}
39 changes: 39 additions & 0 deletions scripts/deploy/DeployDiscountRateInjector.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'solidity-utils/contracts/utils/ScriptUtils.sol';
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {AaveV3Plasma} from 'aave-address-book/AaveV3Plasma.sol';
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
import {ICreate3Factory} from 'solidity-utils/contracts/create3/interfaces/ICreate3Factory.sol';
import {EdgeRiskStewardDiscountRate, IRiskSteward} from '../../src/contracts/EdgeRiskStewardDiscountRate.sol';
import {AaveStewardInjectorDiscountRate} from '../../src/contracts/AaveStewardInjectorDiscountRate.sol';
Expand Down Expand Up @@ -101,3 +103,40 @@ contract DeployEthereum is EthereumScript {
vm.stopBroadcast();
}
}

// make deploy-ledger contract=scripts/deploy/DeployDiscountRateInjector.s.sol:DeployPlasma chain=plasma
contract DeployPlasma is PlasmaScript {
address constant GUARDIAN = 0x1cF16B4e76D4919bD939e12C650b8F6eb9e02916;
address constant EDGE_RISK_ORACLE = 0xAe48F22903d43f13f66Cc650F57Bd4654ac222cb;
address constant CREATE_3_FACTORY = 0xc4A82c968540B47032F3a51fA7e4f09f6FAE3308;

function run() external {
vm.startBroadcast();
bytes32 salt = 'DiscountRateStewardInjector';
address predictedStewardsInjector = ICreate3Factory(CREATE_3_FACTORY)
.predictAddress(msg.sender, salt);

address riskSteward = DeployStewardContracts._deployRiskStewards(
DeployStewardContracts.DeployStewardInput({
pool: address(AaveV3Plasma.POOL),
configEngine: AaveV3Plasma.CONFIG_ENGINE,
riskCouncil: predictedStewardsInjector,
owner: GovernanceV3Plasma.EXECUTOR_LVL_1
})
);

DeployStewardContracts._deployDiscountRateStewardInjector(
DeployStewardContracts.DeployInjectorInput({
create3Factory: CREATE_3_FACTORY,
salt: salt,
riskSteward: riskSteward,
aaveOracle: address(AaveV3Plasma.ORACLE),
edgeRiskOracle: EDGE_RISK_ORACLE,
owner: GovernanceV3Plasma.EXECUTOR_LVL_1,
guardian: GUARDIAN,
whitelistedMarkets: new address[](0)
})
);
vm.stopBroadcast();
}
}
37 changes: 37 additions & 0 deletions scripts/deploy/DeployEModeInjector.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import 'solidity-utils/contracts/utils/ScriptUtils.sol';
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {MiscPlasma} from 'aave-address-book/MiscPlasma.sol';
import {AaveV3Plasma} from 'aave-address-book/AaveV3Plasma.sol';
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
import {ICreate3Factory} from 'solidity-utils/contracts/create3/interfaces/ICreate3Factory.sol';
import {EdgeRiskStewardEMode, IRiskSteward} from '../../src/contracts/EdgeRiskStewardEMode.sol';
import {AaveStewardInjectorEMode} from '../../src/contracts/AaveStewardInjectorEMode.sol';
Expand Down Expand Up @@ -133,3 +136,37 @@ contract DeployEthereum is EthereumScript {
vm.stopBroadcast();
}
}

// make deploy-ledger contract=scripts/deploy/DeployEModeInjector.s.sol:DeployPlasma chain=plasma
contract DeployPlasma is PlasmaScript {
address constant GUARDIAN = 0x1cF16B4e76D4919bD939e12C650b8F6eb9e02916;
address constant EDGE_RISK_ORACLE = 0xAe48F22903d43f13f66Cc650F57Bd4654ac222cb;
address constant CREATE_3_FACTORY = 0xc4A82c968540B47032F3a51fA7e4f09f6FAE3308;

function run() external {
vm.startBroadcast();
bytes32 salt = 'EModeStewardInjector';
address predictedStewardsInjector = ICreate3Factory(CREATE_3_FACTORY)
.predictAddress(msg.sender, salt);

address riskSteward = DeployStewardContracts._deployRiskStewards(
address(AaveV3Plasma.POOL),
AaveV3Plasma.CONFIG_ENGINE,
predictedStewardsInjector,
GovernanceV3Plasma.EXECUTOR_LVL_1
);

uint8[] memory whitelistedEModes = new uint8[](0);

DeployStewardContracts._deployEModeStewardInjector(
CREATE_3_FACTORY,
salt,
riskSteward,
EDGE_RISK_ORACLE,
GovernanceV3Plasma.EXECUTOR_LVL_1,
GUARDIAN,
whitelistedEModes
);
vm.stopBroadcast();
}
}
2 changes: 1 addition & 1 deletion src/contracts/AaveStewardInjectorDiscountRate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract AaveStewardInjectorDiscountRate is AaveStewardInjectorBase {
/// @inheritdoc AaveStewardInjectorBase
function getUpdateTypes() public pure override returns (string[] memory updateTypes) {
updateTypes = new string[](1);
updateTypes[0] = 'PendleDiscountRateUpdate_Core';
updateTypes[0] = 'PendleDiscountRateUpdate';
}

/// @inheritdoc AaveStewardInjectorBase
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/AaveStewardInjectorEMode.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract AaveStewardInjectorEMode is AaveStewardInjectorBase {
/// @inheritdoc AaveStewardInjectorBase
function getUpdateTypes() public pure override returns (string[] memory updateTypes) {
updateTypes = new string[](1);
updateTypes[0] = 'EModeCategoryUpdate_Core';
updateTypes[0] = 'EModeCategoryUpdate';
}

/// @inheritdoc AaveStewardInjectorBase
Expand Down
Loading