Skip to content

Commit

Permalink
test: prep for rate apxETH rate provider and test
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonCase committed Aug 30, 2024
1 parent 5bc1215 commit 770d84a
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 126 deletions.
7 changes: 4 additions & 3 deletions deployment-config/chains/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@
"rateProvider": "0x318Da095d602C08eF41319f4c4bA0646d318C906",
"decimals": 8
},
"":{
"0x9ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6":{
"priceFeed": "0x19219bc90f48dee4d5cf202e09c438faacfd8bea",
"rateProvider": "",
"rateProvider": "0x0000000000000000000000000000000000000000",
"decimals": 18,
"description": "STETH / ETH",
"description": "apxETH/ETH",
"priceFeedType": 1

}

}
Expand Down
14 changes: 7 additions & 7 deletions deployment-config/exampleL1.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"base": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"protocolAdmin": "0xC2d99d76bb9D46BF8Ec9449E4DfAE48C30CF0839",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
"boringVaultSalt": "0x1ddd634c506ad203da17ff00000000000000000000000000000000000000000e",
"boringVaultSalt": "0x1ddd634c506ad203da17ff000000000000000000000000000000000000000010",
"boringVaultName": "Nucleus Vault",
"boringVaultSymbol": "NV",
"address": "0x0000000000E7Ab44153eEBEF2343ba5289F65dAC"
},
"manager": {
"managerSalt": "0x30432d4b4ec00003b4a25000000000000000000000000000000000000000000e",
"managerSalt": "0x30432d4b4ec00003b4a250000000000000000000000000000000000000000010",
"address": "0x0000000000fAd6Db23abdC1a85621B97bd1Dc82f"
},
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000e",
"accountantSalt": "0x6a184dbea6f3cc0318679f000000000000000000000000000000000000000010",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0x5f207d42F869fd1c71d7f0f81a2A67Fc20FF7323",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
"managementFee": "2000",
"address": "0x00000000004F96C07B83e86600D86F9479bB43fa"
},
"teller": {
"tellerSalt": "0x51f8968749a56d01202c9100000000000000000000000000000000000000000e",
"tellerSalt": "0x51f8968749a56d01202c91000000000000000000000000000000000000000010",
"maxGasForPeer": 100000,
"minGasForPeer": 0,
"peerEid": 30280,
Expand All @@ -47,13 +47,13 @@
"address": "0x00000000004F96C07B83e86600D86F0000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a00000000000000000000000000000000000000000e",
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a000000000000000000000000000000000000000010",
"strategist": "0xC2d99d76bb9D46BF8Ec9449E4DfAE48C30CF0839",
"exchangeRateBot": "0x00000000004F96C07B83e86600D86F0000000000",
"address": "0x00000000004F96C07B83e86600D86F0000000000"
},
"decoder": {
"decoderSalt": "0x48b53893da2e0b0248268c00000000000000000000000000000000000000000e",
"decoderSalt": "0x48b53893da2e0b0248268c000000000000000000000000000000000000000010",
"address": "0x00000000004F96C07B83e86600D86F0000000000"
}
}
2 changes: 1 addition & 1 deletion deployment-config/exampleL2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"base":"0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8",
"protocolAdmin": "0xF2dE1311C5b2C1BD94de996DA13F80010453e505",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
Expand All @@ -14,7 +15,6 @@
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000e",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0x5f207d42F869fd1c71d7f0f81a2A67Fc20FF7323",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
Expand Down
110 changes: 54 additions & 56 deletions deployment-config/form-btc-testnet-l1-08-30-24.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
{
"base": "0x92f3B59a79bFf5dc60c0d59eA13a44D082B2bdFC",
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"boringVaultAndBaseDecimals": "8",
"boringVault": {
"boringVaultSalt": "0x1ddd634c506ad203da17ff00000000000000000000000000000000000000000e",
"boringVaultName": "Form ETH",
"boringVaultSymbol": "FETH",
"address": "0x0000000000000000000000000000000000000000"
},
"manager": {
"managerSalt": "0x30432d4b4ec00003b4a25000000000000000000000000000000000000000000e",
"address": "0x0000000000000000000000000000000000000000"
},
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000e",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
"managementFee": "0",
"address": "0x0000000000000000000000000000000000000000"
},
"teller": {
"tellerSalt": "0x51f8968749a56d01202c9100000000000000000000000000000000000000000e",
"maxGasForPeer": 100000,
"minGasForPeer": 0,
"peerEid": 40270,
"tellerContractName": "TellerWithMultiAssetSupport",
"opMessenger": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"assets": [

"base": "0x92f3B59a79bFf5dc60c0d59eA13a44D082B2bdFC",
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"boringVaultAndBaseDecimals": "8",
"boringVault": {
"boringVaultSalt": "0x1ddd634c506ad203da17ff000000000000000000000000000000000000000012",
"boringVaultName": "Form ETH",
"boringVaultSymbol": "FETH",
"address": "0x0000000000000000000000000000000000000000"
},
"manager": {
"managerSalt": "0x30432d4b4ec00003b4a250000000000000000000000000000000000000000012",
"address": "0x0000000000000000000000000000000000000000"
},
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f000000000000000000000000000000000000000012",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
"managementFee": "0",
"address": "0x0000000000000000000000000000000000000000"
},
"teller": {
"tellerSalt": "0x51f8968749a56d01202c91000000000000000000000000000000000000000012",
"maxGasForPeer": 100000,
"minGasForPeer": 0,
"peerEid": 40270,
"tellerContractName": "TellerWithMultiAssetSupport",
"opMessenger": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"assets": [],
"dvnIfNoDefault": {
"required": [
"0x589dEDbD617e0CBcB916A9223F4d1300c294236b"
],
"dvnIfNoDefault": {
"required": [
"0x589dEDbD617e0CBcB916A9223F4d1300c294236b"
],
"optional": [
"0x380275805876Ff19055EA900CDb2B46a94ecF20D",
"0x8FafAE7Dd957044088b3d0F67359C327c6200d18",
"0xa59BA433ac34D2927232918Ef5B2eaAfcF130BA5",
"0xe552485d02EDd3067FE7FCbD4dd56BB1D3A998D2"
],
"blockConfirmationsRequiredIfNoDefault": 15,
"optionalThreshold": 1
},
"address": "0x0000000000000000000000000000000000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a00000000000000000000000000000000000000000e",
"strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"address": "0x0000000000000000000000000000000000000000"
"optional": [
"0x380275805876Ff19055EA900CDb2B46a94ecF20D",
"0x8FafAE7Dd957044088b3d0F67359C327c6200d18",
"0xa59BA433ac34D2927232918Ef5B2eaAfcF130BA5",
"0xe552485d02EDd3067FE7FCbD4dd56BB1D3A998D2"
],
"blockConfirmationsRequiredIfNoDefault": 15,
"optionalThreshold": 1
},
"decoder": {
"decoderSalt": "0x48b53893da2e0b0248268c00000000000000000000000000000000000000000e",
"address": "0x0000000000000000000000000000000000000000"
}
}
"address": "0x0000000000000000000000000000000000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a000000000000000000000000000000000000000012",
"strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"address": "0x0000000000000000000000000000000000000000"
},
"decoder": {
"decoderSalt": "0x48b53893da2e0b0248268c000000000000000000000000000000000000000012",
"address": "0x0000000000000000000000000000000000000000"
}
}
110 changes: 54 additions & 56 deletions deployment-config/form-usd-testnet-l1-08-30-24.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
{
"base": "0x51fCe89b9f6D4c530698f181167043e1bB4abf89",
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"boringVaultAndBaseDecimals": "6",
"boringVault": {
"boringVaultSalt": "0x1ddd634c506ad203da17ff00000000000000000000000000000000000000000e",
"boringVaultName": "Form ETH",
"boringVaultSymbol": "FETH",
"address": "0x0000000000000000000000000000000000000000"
},
"manager": {
"managerSalt": "0x30432d4b4ec00003b4a25000000000000000000000000000000000000000000e",
"address": "0x0000000000000000000000000000000000000000"
},
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000e",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
"managementFee": "0",
"address": "0x0000000000000000000000000000000000000000"
},
"teller": {
"tellerSalt": "0x51f8968749a56d01202c9100000000000000000000000000000000000000000e",
"maxGasForPeer": 100000,
"minGasForPeer": 0,
"peerEid": 40270,
"tellerContractName": "TellerWithMultiAssetSupport",
"opMessenger": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"assets": [

"base": "0x51fCe89b9f6D4c530698f181167043e1bB4abf89",
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"boringVaultAndBaseDecimals": "6",
"boringVault": {
"boringVaultSalt": "0x1ddd634c506ad203da17ff000000000000000000000000000000000000000010",
"boringVaultName": "Form ETH",
"boringVaultSymbol": "FETH",
"address": "0x0000000000000000000000000000000000000000"
},
"manager": {
"managerSalt": "0x30432d4b4ec00003b4a250000000000000000000000000000000000000000010",
"address": "0x0000000000000000000000000000000000000000"
},
"accountant": {
"accountantSalt": "0x6a184dbea6f3cc0318679f000000000000000000000000000000000000000010",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"allowedExchangeRateChangeUpper": "10003",
"allowedExchangeRateChangeLower": "9998",
"minimumUpdateDelayInSeconds": "3600",
"managementFee": "0",
"address": "0x0000000000000000000000000000000000000000"
},
"teller": {
"tellerSalt": "0x51f8968749a56d01202c91000000000000000000000000000000000000000010",
"maxGasForPeer": 100000,
"minGasForPeer": 0,
"peerEid": 40270,
"tellerContractName": "TellerWithMultiAssetSupport",
"opMessenger": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"assets": [],
"dvnIfNoDefault": {
"required": [
"0x589dEDbD617e0CBcB916A9223F4d1300c294236b"
],
"dvnIfNoDefault": {
"required": [
"0x589dEDbD617e0CBcB916A9223F4d1300c294236b"
],
"optional": [
"0x380275805876Ff19055EA900CDb2B46a94ecF20D",
"0x8FafAE7Dd957044088b3d0F67359C327c6200d18",
"0xa59BA433ac34D2927232918Ef5B2eaAfcF130BA5",
"0xe552485d02EDd3067FE7FCbD4dd56BB1D3A998D2"
],
"blockConfirmationsRequiredIfNoDefault": 15,
"optionalThreshold": 1
},
"address": "0x0000000000000000000000000000000000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a00000000000000000000000000000000000000000e",
"strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"address": "0x0000000000000000000000000000000000000000"
"optional": [
"0x380275805876Ff19055EA900CDb2B46a94ecF20D",
"0x8FafAE7Dd957044088b3d0F67359C327c6200d18",
"0xa59BA433ac34D2927232918Ef5B2eaAfcF130BA5",
"0xe552485d02EDd3067FE7FCbD4dd56BB1D3A998D2"
],
"blockConfirmationsRequiredIfNoDefault": 15,
"optionalThreshold": 1
},
"decoder": {
"decoderSalt": "0x48b53893da2e0b0248268c00000000000000000000000000000000000000000e",
"address": "0x0000000000000000000000000000000000000000"
}
}
"address": "0x0000000000000000000000000000000000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a000000000000000000000000000000000000000010",
"strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"address": "0x0000000000000000000000000000000000000000"
},
"decoder": {
"decoderSalt": "0x48b53893da2e0b0248268c000000000000000000000000000000000000000010",
"address": "0x0000000000000000000000000000000000000000"
}
}
2 changes: 1 addition & 1 deletion script/Base.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract contract BaseScript is Script {
string constant CONFIG_CHAIN_ROOT = "./deployment-config/chains/";

/// Custom base params
ICreateX CREATEX = ICreateX(0x1C64d5eBCf22AC237d00cF7bB9Be6395e59B23b7);
ICreateX CREATEX = ICreateX(0x1077f8ea07EA34D9F23BC39256BF234665FB391f);

/// @dev Included to enable compilation of the script without a $MNEMONIC environment variable.
string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";
Expand Down
2 changes: 1 addition & 1 deletion script/DeployCustomCreatex.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract DeployCustomCreateX is Script {
string internal mnemonic;
string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";

address constant EXPECTED = 0x1C64d5eBCf22AC237d00cF7bB9Be6395e59B23b7;
address constant EXPECTED = 0x1077f8ea07EA34D9F23BC39256BF234665FB391f;
bytes32 constant SALT = 0x8888888833388888888000000000000000000000000000000000000000000000;

constructor() {
Expand Down
1 change: 1 addition & 0 deletions src/helper/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ IPriceFeed constant ETH_PER_EZETH_CHAINLINK = IPriceFeed(0x636A000262F6aA9e1F094
IPriceFeed constant ETH_PER_RSETH_CHAINLINK = IPriceFeed(0x03c68933f7a3F76875C0bc670a58e69294cDFD01);
IPriceFeed constant ETH_PER_RSWETH_CHAINLINK = IPriceFeed(0xb613CfebD0b6e95abDDe02677d6bC42394FdB857);
IPriceFeed constant ETH_PER_PUFETH_REDSTONE = IPriceFeed(0x76A495b0bFfb53ef3F0E94ef0763e03cE410835C);
IPriceFeed constant ETH_PER_APXETH_REDSTOME = IPriceFeed(0x19219BC90F48DeE4d5cF202E09c438FAacFd8Bea);

address constant SWBTC = 0x8DB2350D78aBc13f5673A411D4700BCF87864dDE;
address constant WBTC_ETHEREUM = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;
30 changes: 29 additions & 1 deletion test/ion/oracles/EthPerTokenRateProvider.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
ETH_PER_EZETH_CHAINLINK,
ETH_PER_RSETH_CHAINLINK,
ETH_PER_RSWETH_CHAINLINK,
ETH_PER_PUFETH_REDSTONE
ETH_PER_PUFETH_REDSTONE,
ETH_PER_APXETH_REDSTOME
} from "./../../../src/helper/Constants.sol";

import { Test } from "@forge-std/Test.sol";
Expand Down Expand Up @@ -194,3 +195,30 @@ contract PufEthRateProviderTest is EthPerTokenRateProviderTest {
);
}
}

contract ApxEthRateProviderTest is EthPerTokenRateProviderTest {
function setUp() public override {
super.setUp();

_setExpectedPriceRange(0.99e18, 1.2e18);

ethPerTokenRateProvider = new EthPerTokenRateProvider(
"apxETH/ETH",
ETH_PER_APXETH_REDSTOME,
MAX_TIME_FROM_LAST_UPDATE,
18,
EthPerTokenRateProvider.PriceFeedType.REDSTONE
);
}

function test_Revert_IncorrectDescription() public override {
vm.expectRevert(EthPerTokenRateProvider.InvalidDescription.selector);
ethPerTokenRateProvider = new EthPerTokenRateProvider(
incorrectDescription,
ETH_PER_APXETH_REDSTOME,
MAX_TIME_FROM_LAST_UPDATE,
18,
EthPerTokenRateProvider.PriceFeedType.REDSTONE
);
}
}

0 comments on commit 770d84a

Please sign in to comment.