Skip to content

Commit

Permalink
separate weETH deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rustboyar committed Apr 3, 2024
1 parent 0439792 commit a014dca
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
forge-std/=lib/forge-std/src/
aave-address-book/=lib/aave-address-book/src/
aave-address-book-latest/=lib/aave-address-book-latest/src/
cl-synchronicity-price-adapter/=lib/cl-synchronicity-price-adapter/src/
aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/
aave-helpers/=lib/aave-helpers/src/
Expand Down
25 changes: 0 additions & 25 deletions scripts/DeployEthereum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,6 @@ library CapAdaptersCodeEthereum {
})
)
);

function weETHAdapterCode() internal pure returns (bytes memory) {
return
abi.encodePacked(
type(WeETHPriceCapAdapter).creationCode,
abi.encode(
AaveV3Ethereum.ACL_MANAGER,
AaveV3EthereumAssets.WETH_ORACLE,
MiscEthereum.weETH_RATIO_PROVIDER,
'Capped weETH / eETH(ETH) / USD',
7 days,
IPriceCapAdapter.PriceCapUpdateParams({
snapshotRatio: 1034656878645040505,
snapshotTimestamp: 1711416299, // 26-03-2024
maxYearlyRatioGrowthPercent: 8_75
})
)
);
}
}

library stEURCapAdapters {
Expand Down Expand Up @@ -271,9 +252,3 @@ contract DeployEthereum is EthereumScript, DeployEthereumAdaptersAndPayload {
_deploy();
}
}

contract DeployWeEthEthereum is EthereumScript {
function run() external broadcast {
GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.weETHAdapterCode());
}
}
36 changes: 36 additions & 0 deletions scripts/DeployEthereumWeEth.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book-latest/AaveV3Ethereum.sol';
import {MiscEthereum} from 'aave-address-book-latest/MiscEthereum.sol';

import {IPriceCapAdapter} from '../src/interfaces/IPriceCapAdapter.sol';
import {WeETHPriceCapAdapter} from '../src/contracts/WeETHPriceCapAdapter.sol';

library CapAdaptersCodeEthereum {
function weETHAdapterCode() internal pure returns (bytes memory) {
return
abi.encodePacked(
type(WeETHPriceCapAdapter).creationCode,
abi.encode(
AaveV3Ethereum.ACL_MANAGER,
AaveV3EthereumAssets.WETH_ORACLE,
MiscEthereum.weETH_RATIO_PROVIDER,
'Capped weETH / eETH(ETH) / USD',
7 days,
IPriceCapAdapter.PriceCapUpdateParams({
snapshotRatio: 1034656878645040505,
snapshotTimestamp: 1711416299, // 26-03-2024
maxYearlyRatioGrowthPercent: 8_75
})
)
);
}
}

contract DeployWeEthEthereum is EthereumScript {
function run() external broadcast {
GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.weETHAdapterCode());
}
}
4 changes: 2 additions & 2 deletions tests/ethereum/weETHPriceCapAdapterTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.0;

import '../BaseTest.sol';

import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book-latest/AaveV3Ethereum.sol';
import {MiscEthereum} from 'aave-address-book-latest/MiscEthereum.sol';

import {WeETHPriceCapAdapter, IWeEth} from '../../src/contracts/WeETHPriceCapAdapter.sol';
import {CapAdaptersCodeEthereum} from '../../scripts/DeployEthereum.s.sol';
Expand Down

0 comments on commit a014dca

Please sign in to comment.