Skip to content

Commit

Permalink
Merge branch 'main' into deploy/20230606
Browse files Browse the repository at this point in the history
  • Loading branch information
spicysquid168 authored Jun 8, 2023
2 parents d9d5331 + 9d363af commit c723d8e
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 91 deletions.
46 changes: 4 additions & 42 deletions .mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"high": "0x5f4Bde007Dc06b867f86EBFE4802e34A1fFEEd63",
"ltc": "0x4338665CBB7B2485A8855A139b75D5e34AB0DB94",
"matic": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
"the": "0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11",
"tusd": "0x14016E85a25aeb13065688cAFB43044C2ef86784",
"usdt": "0x55d398326f99059fF775485246999027B3197955",
"usdc": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
Expand All @@ -27,7 +28,8 @@
"alpacaV2Oracle": "0x0Ece0910fCB2838Fbfd6bC01da17F1E96ae1D812",
"alpacaV2Oracle02": "",
"chainlinkOracle": "0x634902128543b25265da350e2d961C7ff540fC71",
"oracleMedianizer": "0x553b8adc2Ac16491Ec57239BeA7191719a2B880c"
"oracleMedianizer": "0x553b8adc2Ac16491Ec57239BeA7191719a2B880c",
"simpleOracle": "0x166f56F2EDa9817cAB77118AE4FCAA0002A17eC7"
},
"sharedConfig": {
"fixFeeModel500Bps": "0x5c40022195b143c63E8E49d0a1f26C164799fBB6",
Expand Down Expand Up @@ -147,22 +149,6 @@
"debtToken": "0xBda539AFD66fEE61499B22769E4e413dc158f271",
"interestModel": "0xe44bDd3f0b69f2c294A0250825BCF31eE3af4314"
},
{
"name": "LTC",
"tier": "COLLATERAL",
"token": "0x4338665CBB7B2485A8855A139b75D5e34AB0DB94",
"ibToken": "0x42b2D846785636CfB393b5EC48C6581f47c37EC3",
"debtToken": "0x22c583069619eA08F260758E34Bc525B5833d11b",
"interestModel": "0xe44bDd3f0b69f2c294A0250825BCF31eE3af4314"
},
{
"name": "DOGE",
"tier": "COLLATERAL",
"token": "0xbA2aE424d960c26247Dd6c32edC70B295c744C43",
"ibToken": "0x72Ad41ecf9C6C1171F19FaCCBA2b347D64AFe57f",
"debtToken": "0xBda539AFD66fEE61499B22769E4e413dc158f271",
"interestModel": "0xe44bDd3f0b69f2c294A0250825BCF31eE3af4314"
},
{
"name": "LTC",
"tier": "COLLATERAL",
Expand All @@ -176,7 +162,7 @@
"implementation": "0xD870c0D7de9302D829FB7b7ba126C9E1E1220fb5",
"proxy": "0xD20B887654dB8dC476007bdca83d22Fa51e93407"
},
"repurchaser": ""
"repurchaser": "0x40d48e2fe8a9f65b114fd85489fda955dfe86c35"
},
"miniFL": {
"implementation": "0x15474B03710187eB9de4401d99E75680eD240b27",
Expand Down Expand Up @@ -320,30 +306,6 @@
"stakingToken": "0x42b2D846785636CfB393b5EC48C6581f47c37EC3",
"rewarders": []
},
{
"id": 22,
"name": "debtLTC",
"stakingToken": "0x22c583069619eA08F260758E34Bc525B5833d11b",
"rewarders": []
},
{
"id": 19,
"name": "ibDOGE",
"stakingToken": "0x72Ad41ecf9C6C1171F19FaCCBA2b347D64AFe57f",
"rewarders": []
},
{
"id": 20,
"name": "debtDOGE",
"stakingToken": "0xBda539AFD66fEE61499B22769E4e413dc158f271",
"rewarders": []
},
{
"id": 21,
"name": "ibLTC",
"stakingToken": "0x42b2D846785636CfB393b5EC48C6581f47c37EC3",
"rewarders": []
},
{
"id": 22,
"name": "debtLTC",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"exec:bsc_mainnet:alpaca-v2-oracle:config:set-token-config": "forge script script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:alpaca-v2-oracle:config:set-pools": "forge script script/deployments/AlpacaV2Oracle/config/SetPools.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:alpaca-v2-oracle:config:set-oracle": "forge script script/deployments/AlpacaV2Oracle/config/SetOracle.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:alpaca-v2-oracle02:deploy": "forge script script/deployments/AlpacaV2Oracle02/deploy/AlpacaV2Oracle02.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:oracle-medianizer:deploy": "forge script script/deployments/OracleMedianizer/deploy/OracleMedianizer.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:oracle-medianizer:config:set-multiple-primary-sources": "forge script script/deployments/OracleMedianizer/config/SetMultiPrimarySources.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:wnative-relayer:config:set-caller-ok": "forge script script/deployments/WNativeRelayer/config/setCallerOk.s.sol --rpc-url bsc_mainnet --broadcast --slow",
Expand Down
4 changes: 4 additions & 0 deletions script/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ abstract contract BaseScript is Script {
address internal pancakeswapV3IbLiquidateStrat;
IAlpacaV2Oracle internal alpacaV2Oracle;
IAlpacaV2Oracle02 internal alpacaV2Oracle02;
address internal simpleOracle;
address internal pancakeswapFactoryV3;
address internal pancakeswapRouterV2;
address internal pancakeswapRouterV3;
Expand Down Expand Up @@ -79,6 +80,7 @@ abstract contract BaseScript is Script {
address internal high;
address internal ltc;
address internal matic;
address internal the;
address internal tusd;
address internal usdt;
address internal usdc;
Expand Down Expand Up @@ -134,6 +136,7 @@ abstract contract BaseScript is Script {
oracleMedianizer = abi.decode(configJson.parseRaw(".oracle.oracleMedianizer"), (address));
alpacaV2Oracle = abi.decode(configJson.parseRaw(".oracle.alpacaV2Oracle"), (IAlpacaV2Oracle));
alpacaV2Oracle02 = abi.decode(configJson.parseRaw(".oracle.alpacaV2Oracle02"), (IAlpacaV2Oracle02));
simpleOracle = abi.decode(configJson.parseRaw(".oracle.simpleOracle"), (address));

// tokens
ada = abi.decode(configJson.parseRaw(".tokens.ada"), (address));
Expand All @@ -148,6 +151,7 @@ abstract contract BaseScript is Script {
high = abi.decode(configJson.parseRaw(".tokens.high"), (address));
ltc = abi.decode(configJson.parseRaw(".tokens.ltc"), (address));
matic = abi.decode(configJson.parseRaw(".tokens.matic"), (address));
the = abi.decode(configJson.parseRaw(".tokens.the"), (address));
tusd = abi.decode(configJson.parseRaw(".tokens.tusd"), (address));
usdt = abi.decode(configJson.parseRaw(".tokens.usdt"), (address));
usdc = abi.decode(configJson.parseRaw(".tokens.usdc"), (address));
Expand Down
6 changes: 3 additions & 3 deletions script/deployments/MiniFL/config/SetPoolRewarders.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ contract SetPoolRewardersScript is BaseScript {
*/

address[] memory rewarders = new address[](1);
rewarders[0] = 0x527c87bDBEB012f9f27A75dC3D5CC3F0Dd51B3bB;
rewarders[0] = 0xEc2d6B93bbBD559F88e77B8DdD2C914aC72df271;

setIbPoolRewarders(high, rewarders);
setDebtPoolRewarders(high, rewarders);
setIbPoolRewarders(the, rewarders);
setDebtPoolRewarders(the, rewarders);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
29 changes: 8 additions & 21 deletions script/deployments/MoneyMarket/config/OpenMarket.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,16 @@ contract OpenMarketScript is BaseScript {
*/
_startDeployerBroadcast();

// DOGE
// THE
executeOpenMarket(
OpenMarketInput({
token: doge,
token: the,
interestModel: doubleSlope1,
tier: LibConstant.AssetTier.COLLATERAL,
collateralFactor: 3000,
borrowingFactor: 5000,
maxCollateral: formatAmount(doge, 15_000_000),
maxBorrow: formatAmount(doge, 10_000_000)
})
);

// LTC
executeOpenMarket(
OpenMarketInput({
token: ltc,
interestModel: doubleSlope1,
tier: LibConstant.AssetTier.COLLATERAL,
collateralFactor: 5000,
borrowingFactor: 7500,
maxCollateral: formatAmount(ltc, 120_000),
maxBorrow: formatAmount(ltc, 100_000)
tier: LibConstant.AssetTier.ISOLATE,
collateralFactor: 0,
borrowingFactor: 6000,
maxCollateral: formatAmount(the, 0),
maxBorrow: formatAmount(the, 1_000_000)
})
);

Expand Down Expand Up @@ -89,7 +76,7 @@ contract OpenMarketScript is BaseScript {
writeNewMiniFLPoolToJson(moneyMarket.getDebtTokenFromToken(_input.token));
}

function formatAmount(address _token, uint256 _amount) internal returns (uint256 _formatAmount) {
function formatAmount(address _token, uint256 _amount) internal view returns (uint256 _formatAmount) {
_formatAmount = _amount * 10**(IERC20(_token).decimals());
}

Expand Down
3 changes: 1 addition & 2 deletions script/deployments/MoneyMarket/config/SetOperatorsOk.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ contract SetOperatorsOkScript is BaseScript {
*/

bool isOk = true;
address[] memory operators = new address[](2);
address[] memory operators = new address[](1);
operators[0] = 0xC44f82b07Ab3E691F826951a6E335E1bC1bB0B51;
operators[1] = address(0);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion script/deployments/MoneyMarket/config/SetOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract SetOracleScript is BaseScript {
Check all variables below before execute the deployment script
*/

address _newOracle = address(alpacaV2Oracle);
address _newOracle = address(alpacaV2Oracle02);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ contract SetMultiPrimarySourcesScript is BaseScript {
IPriceOracle[][] allSources;

IPriceOracle[] chainlinkPriceSource;
IPriceOracle[] simpleOraclePriceSource;

constructor() {
chainlinkPriceSource.push(IPriceOracle(chainlinkOracle));
simpleOraclePriceSource.push(IPriceOracle(simpleOracle));
}

function run() public {
Expand All @@ -40,25 +42,14 @@ contract SetMultiPrimarySourcesScript is BaseScript {
Check all variables below before execute the deployment script
*/

// DOGE
// THE
addSetMultiPrimarySources(
SetMultiPrimarySourcesInput({
token0: doge,
token0: the,
token1: usdPlaceholder,
maxPriceDeviation: 1e18,
maxPriceStale: 1 days,
priceSources: chainlinkPriceSource
})
);

// LTC
addSetMultiPrimarySources(
SetMultiPrimarySourcesInput({
token0: ltc,
token1: usdPlaceholder,
maxPriceDeviation: 1e18,
maxPriceStale: 1 days,
priceSources: chainlinkPriceSource
priceSources: simpleOraclePriceSource
})
);

Expand Down
8 changes: 4 additions & 4 deletions script/deployments/Rewarder/config/AddPool.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ contract SetPoolScript is BaseScript {
Check all variables below before execute the deployment script
*/

IRewarder rewarder = IRewarder(0x527c87bDBEB012f9f27A75dC3D5CC3F0Dd51B3bB);
IRewarder rewarder = IRewarder(0xEc2d6B93bbBD559F88e77B8DdD2C914aC72df271);

// HIGH
addIbPool(high, 40);
addDebtPool(high, 60);
// THE
addIbPool(the, 40);
addDebtPool(the, 60);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
4 changes: 2 additions & 2 deletions script/deployments/Rewarder/config/SetRewardPerSecond.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ contract SetRewardPerSecondScript is BaseScript {
Check all variables below before execute the deployment script
*/

IRewarder rewarder = IRewarder(0x527c87bDBEB012f9f27A75dC3D5CC3F0Dd51B3bB);
uint256 _newRewardPerSecond = 6717096560846561;
IRewarder rewarder = IRewarder(0xEc2d6B93bbBD559F88e77B8DdD2C914aC72df271);
uint256 _newRewardPerSecond = 220630787037037037;
bool _withUpdate = true;

//---- execution ----//
Expand Down
4 changes: 2 additions & 2 deletions script/deployments/Rewarder/deploy/Rewarder.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ contract DeployRewarderScript is BaseScript {
Check all variables below before execute the deployment script
*/

string memory name = "high";
string memory name = "the";
address _miniFL = address(miniFL);
address rewardToken = high;
address rewardToken = the;
uint256 maxRewardPerSecond = 1 ether;

bytes memory data = abi.encodeWithSelector(
Expand Down

0 comments on commit c723d8e

Please sign in to comment.