From 32b51d6d0b92cacd692920904d10370ccf13cfe1 Mon Sep 17 00:00:00 2001 From: Jun Kim <64379343+junkim012@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:19:32 +0900 Subject: [PATCH] chore: rswBTC deployment config --- deployment-config/chains/1.json | 4 ++ deployment-config/mydeploy.json | 59 ------------------ deployment-config/rswBTC-l1.json | 57 ++++++++++++++++++ deployment-config/seidry.json | 60 ------------------- script/ConfigReader.s.sol | 6 +- script/deploy/DeployGenericRateProvider.s.sol | 2 +- script/deploy/deployAll.s.sol | 2 + ...04_DeployAccountantWithRateProviders.s.sol | 8 ++- src/helper/Constants.sol | 1 + 9 files changed, 76 insertions(+), 123 deletions(-) delete mode 100644 deployment-config/mydeploy.json create mode 100644 deployment-config/rswBTC-l1.json delete mode 100644 deployment-config/seidry.json diff --git a/deployment-config/chains/1.json b/deployment-config/chains/1.json index aad1b0f..42a3ea0 100644 --- a/deployment-config/chains/1.json +++ b/deployment-config/chains/1.json @@ -46,6 +46,10 @@ "decimals": 18, "description": "", "priceFeedType": 0 + }, + "0x8db2350d78abc13f5673a411d4700bcf87864dde": { + "rateProvider": "0x318Da095d602C08eF41319f4c4bA0646d318C906", + "decimals": 8 } } } \ No newline at end of file diff --git a/deployment-config/mydeploy.json b/deployment-config/mydeploy.json deleted file mode 100644 index 9f02eca..0000000 --- a/deployment-config/mydeploy.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "protocolAdmin": "0xC2d99d76bb9D46BF8Ec9449E4DfAE48C30CF0839", - - "boringVault":{ - "boringVaultSalt": "0x1ddd634c506ad203da17ff00000000000000000000000000000000000000000a", - "boringVaultName": "Ion Vault", - "boringVaultSymbol": "IVT", - - "address": "0x0000000000E7Ab44153eEBEF2343ba5289F65dAC" - }, - - "manager":{ - "managerSalt": "0x30432d4b4ec00003b4a25000000000000000000000000000000000000000000a", - - "address": "0x0000000000fAd6Db23abdC1a85621B97bd1Dc82f" - }, - - "accountant":{ - "accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000a", - "payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F", - "base": "0x5f207d42F869fd1c71d7f0f81a2A67Fc20FF7323", - "allowedExchangeRateChangeUpper": "10003", - "allowedExchangeRateChangeLower": "9998", - "minimumUpdateDelayInSeconds": "3600", - "managementFee": "2000", - - "address": "0x00000000004F96C07B83e86600D86F9479bB43fa" - }, - - "teller": { - "tellerSalt": "0x51f8968749a56d01202c9100000000000000000000000000000000000000000a", - "maxGasForPeer": 100000, - "minGasForPeer": 0, - "peerEid": 0, - "tellerContractName": "MultiChainLayerZeroTellerWithMultiAssetSupport", - "opMessenger": "0x0000000000000000000000000000000000000000", - "assets": [ - "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee", - "0xbf5495Efe5DB9ce00f80364C8B423567e58d2110" - ], - - "address": "0x00000000004F96C07B83e86600D86F0000000000" - }, - - "rolesAuthority": { - "rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a00000000000000000000000000000000000000000a", - "strategist": "0xC2d99d76bb9D46BF8Ec9449E4DfAE48C30CF0839", - "exchangeRateBot": "0x00000000004F96C07B83e86600D86F0000000000", - - "address": "0x00000000004F96C07B83e86600D86F0000000000" - }, - - "decoder": { - "decoderSalt": "0x48b53893da2e0b0248268c00000000000000000000000000000000000000000a", - - "address": "0x00000000004F96C07B83e86600D86F0000000000" - } - -} \ No newline at end of file diff --git a/deployment-config/rswBTC-l1.json b/deployment-config/rswBTC-l1.json new file mode 100644 index 0000000..ce53341 --- /dev/null +++ b/deployment-config/rswBTC-l1.json @@ -0,0 +1,57 @@ +{ + "protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F", + "base": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + "baseDecimals": "8", + + "boringVault":{ + "boringVaultSalt": "0x100000000000000000000000000000000000000000000000000000000000000b", + "boringVaultName": "Swell Native Yield Nucleus Token", + "boringVaultSymbol": "rswBTC", + + "address": "0x0000000000000000000000000000000000000000" + }, + + "manager":{ + "managerSalt": "0x200000000000000000000000000000000000000000000000000000000000000b", + + "address": "0x0000000000000000000000000000000000000000" + }, + + "accountant":{ + "accountantSalt": "0x300000000000000000000000000000000000000000000000000000000000000b", + "payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F", + "allowedExchangeRateChangeUpper": "10030", + "allowedExchangeRateChangeLower": "9980", + "minimumUpdateDelayInSeconds": "3600", + "managementFee": "0", + + "address": "0x0000000000000000000000000000000000000000" + }, + + "teller": { + "tellerSalt": "0x400000000000000000000000000000000000000000000000000000000000000a", + "maxGasForPeer": 200000, + "minGasForPeer": 60000, + "peerEid": 0, + "tellerContractName": "TellerWithMultiAssetSupport", + "opMessenger": "0x0000000000000000000000000000000000000000", + "assets": [ + "0x8DB2350D78aBc13f5673A411D4700BCF87864dDE" + ], + "address": "0x0000000000000000000000000000000000000000" + }, + "rolesAuthority": { + "rolesAuthoritySalt": "0x500000000000000000000000000000000000000000000000000000000000000b", + "strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F", + "exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F", + + "address": "0x0000000000000000000000000000000000000000" + }, + + "decoder": { + "decoderSalt": "0x6000000000000000000000000000000000000000000000000000000000000000", + + "address": "0x0000000000000000000000000000000000000000" + } + +} \ No newline at end of file diff --git a/deployment-config/seidry.json b/deployment-config/seidry.json deleted file mode 100644 index 4982d23..0000000 --- a/deployment-config/seidry.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "protocolAdmin": "0xbcef4940d7000e94c0048f071e28bfe91bc5066d", - - "boringVault":{ - "boringVaultSalt": "0x1ddd634c506ad203da17ff00000000000000000000000000000000000000000a", - "boringVaultName": "Ion Vault", - "boringVaultSymbol": "IVT", - - "address": "0x0000000000000000000000000000000000000000" - }, - - "manager":{ - "managerSalt": "0x30432d4b4ec00003b4a25000000000000000000000000000000000000000000a", - - "address": "0x0000000000000000000000000000000000000000" - }, - - "accountant":{ - "accountantSalt": "0x6a184dbea6f3cc0318679f00000000000000000000000000000000000000000a", - "payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F", - "allowedExchangeRateChangeUpper": "10003", - "allowedExchangeRateChangeLower": "9998", - "minimumUpdateDelayInSeconds": "3600", - "managementFee": "2000", - - "address": "0x0000000000000000000000000000000000000000" - }, - - "teller": { - "tellerSalt": "0x51f8968749a56d01202c9100000000000000000000000000000000000000000a", - "maxGasForPeer": 100000, - "minGasForPeer": 0, - "peerEid": 1, - "tellerContractName": "MultiChainLayerZeroTellerWithMultiAssetSupport", - "opMessenger": "0x0000000000000000000000000000000000000000", - "assets": [ - ], - "address": "0x0000000000000000000000000000000000000000" - }, - "rolesAuthority": { - "rolesAuthoritySalt": "0x66bbc3b3b3000b01466a3a00000000000000000000000000000000000000000a", - "strategist": "0xbcef4940d7000e94c0048f071e28bfe91bc5066d", - "exchangeRateBot": "0x00000000004F96C07B83e86600D86F0000000000", - - "address": "0x0000000000000000000000000000000000000000" - }, - - "decoder": { - "decoderSalt": "0x48b53893da2e0b0248268c00000000000000000000000000000000000000000a", - - "address": "0x0000000000000000000000000000000000000000" - }, - - "rateProvider": { - "maxTimeFromLastUpdate": "86400", - "rateProviderSalt": "0x0000000000000000000000000000000000000000000000000000000000000000", - - "address": "0x0000000000000000000000000000000000000000" - } -} \ No newline at end of file diff --git a/script/ConfigReader.s.sol b/script/ConfigReader.s.sol index 1012ee9..2cdb0e7 100644 --- a/script/ConfigReader.s.sol +++ b/script/ConfigReader.s.sol @@ -14,6 +14,8 @@ library ConfigReader { struct Config { address protocolAdmin; + address base; + uint8 baseDecimals; bytes32 accountantSalt; address boringVault; address payoutAddress; @@ -50,12 +52,13 @@ library ConfigReader { address[] assets; address[] rateProviders; address[] priceFeeds; - address base; } function toConfig(string memory _config, string memory _chainConfig) internal pure returns (Config memory config) { // Reading the 'protocolAdmin' config.protocolAdmin = _config.readAddress(".protocolAdmin"); + config.base = _config.readAddress(".base"); + config.baseDecimals = uint8(_config.readUint(".baseDecimals")); // Reading from the 'accountant' section config.accountant = _config.readAddress(".accountant.address"); @@ -97,7 +100,6 @@ library ConfigReader { config.decoder = _config.readAddress(".decoder.address"); // Reading from the 'chainConfig' section - config.base = _chainConfig.readAddress(".base"); config.balancerVault = _chainConfig.readAddress(".balancerVault"); config.lzEndpoint = _chainConfig.readAddress(".lzEndpoint"); diff --git a/script/deploy/DeployGenericRateProvider.s.sol b/script/deploy/DeployGenericRateProvider.s.sol index 72c40fd..c9e39a8 100644 --- a/script/deploy/DeployGenericRateProvider.s.sol +++ b/script/deploy/DeployGenericRateProvider.s.sol @@ -19,7 +19,7 @@ contract DeployGenericRateProvider is BaseScript { string signature = config.readString(".signature"); bytes32 salt = config.readBytes32(".salt"); - function run() public returns (GenericRateProvider rateProvider) { + function run() public broadcast returns (GenericRateProvider rateProvider) { bytes4 functionSig = bytes4(keccak256(bytes(signature))); console2.logBytes4(functionSig); diff --git a/script/deploy/deployAll.s.sol b/script/deploy/deployAll.s.sol index d02c159..a9a72fd 100644 --- a/script/deploy/deployAll.s.sol +++ b/script/deploy/deployAll.s.sol @@ -90,6 +90,8 @@ contract DeployAll is BaseScript { teller = new DeployCrossChainOPTellerWithMultiAssetSupport().deploy(config); } else if (compareStrings(config.tellerContractName, "MultiChainLayerZeroTellerWithMultiAssetSupport")) { teller = new DeployMultiChainLayerZeroTellerWithMultiAssetSupport().deploy(config); + } else if (compareStrings(config.tellerContractName, "TellerWithMultiAssetSupport")) { + teller = new DeployTellerWithMultiAssetSupport().deploy(config); } else { revert INVALID_TELLER_CONTRACT_NAME(); } diff --git a/script/deploy/single/04_DeployAccountantWithRateProviders.s.sol b/script/deploy/single/04_DeployAccountantWithRateProviders.s.sol index 2b5325e..a761cd0 100644 --- a/script/deploy/single/04_DeployAccountantWithRateProviders.s.sol +++ b/script/deploy/single/04_DeployAccountantWithRateProviders.s.sol @@ -30,7 +30,13 @@ contract DeployAccountantWithRateProviders is BaseScript { require(config.allowedExchangeRateChangeLower >= 0.997e4, "allowedExchangeRateChangeLower lower bound"); require(config.minimumUpdateDelayInSeconds >= 3600, "minimumUpdateDelayInSeconds"); require(config.managementFee < 1e4, "managementFee"); - require(startingExchangeRate == 1e18, "starting exchange rate must be 1e18"); + require( + startingExchangeRate == 10 ** config.baseDecimals, + "starting exchange rate must be equal to base decimals" + ); + // TODO This could now be removed since starting exchange rate must always be enforced to be equal to base + // decimals. + // require(startingExchangeRate == 1e18, "starting exchange rate must be 1e18"); } // Create Contract bytes memory creationCode = type(AccountantWithRateProviders).creationCode; diff --git a/src/helper/Constants.sol b/src/helper/Constants.sol index 367be16..17cc9cc 100644 --- a/src/helper/Constants.sol +++ b/src/helper/Constants.sol @@ -10,3 +10,4 @@ IPriceFeed constant ETH_PER_RSWETH_CHAINLINK = IPriceFeed(0xb613CfebD0b6e95abDDe IPriceFeed constant ETH_PER_PUFETH_REDSTONE = IPriceFeed(0x76A495b0bFfb53ef3F0E94ef0763e03cE410835C); address constant SWBTC = 0x8DB2350D78aBc13f5673A411D4700BCF87864dDE; +address constant WBTC_ETHEREUM = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;