diff --git a/.arbitrum.mainnet.json b/.arbitrum.mainnet.json index cbc65ea8..0e6ce7be 100644 --- a/.arbitrum.mainnet.json +++ b/.arbitrum.mainnet.json @@ -5,7 +5,7 @@ "opMultiSig": "", "usdPlaceholder": "", "tokens": { - "weth": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" + "weth": "" }, "oracle": { "alpacaV2Oracle": "", diff --git a/.env.example b/.env.example index ef4c237f..5fb981a4 100644 --- a/.env.example +++ b/.env.example @@ -5,3 +5,5 @@ LOCAL_RPC_URL=http://localhost:8545 BSC_RPC_URL=https://bsc-dataseed1.defibit.io IMPERSONATE_AS= BSC_SCAN_API_KEY= + +ARB_RPC_URL= diff --git a/.openzeppelin/unknown-42161.json b/.openzeppelin/unknown-42161.json deleted file mode 100644 index c8cbb7bd..00000000 --- a/.openzeppelin/unknown-42161.json +++ /dev/null @@ -1,419 +0,0 @@ -{ - "manifestVersion": "3.2", - "admin": { - "address": "0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F", - "txHash": "0x1edd1d5298b50097ec0bf0785c2ed307ccb64a83d51ba5dc5529f4091f1003ba" - }, - "proxies": [ - { - "address": "0xA625AB01B08ce023B2a342Dbb12a16f2C8489A8F", - "txHash": "0xe8331bded743de0e27a83e8d7f1d39d43dc9dc7c99038954ea99285b4aabb50b", - "kind": "transparent" - }, - { - "address": "0x311a522e43C035244e72247895F5C17e46CAB000", - "txHash": "0xb874742e90aba86c48bbe7e5e3663cb4ca379a6988a2bb789d42d946a4ba9e0f", - "kind": "transparent" - } - ], - "impls": { - "c1c84062aacf4620cdecf8c90781464a4accf9c21ba6c9f2b4b16febd9d0dbb2": { - "address": "0x2D5408f2287BF9F9B05404794459a846651D0a59", - "txHash": "0x1bb397e2026148081f570fc4549efad9e5f0d2dac950fcdd36d3014469cfa09e", - "layout": { - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" - }, - { - "label": "_owner", - "offset": 0, - "slot": "51", - "type": "t_address", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)49_storage", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" - }, - { - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256", - "contract": "ReentrancyGuardUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" - }, - { - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage", - "contract": "ReentrancyGuardUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:74" - }, - { - "label": "ALPACA", - "offset": 0, - "slot": "151", - "type": "t_address", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:44" - }, - { - "label": "poolInfo", - "offset": 0, - "slot": "152", - "type": "t_array(t_struct(PoolInfo)8323_storage)dyn_storage", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:45" - }, - { - "label": "stakingTokens", - "offset": 0, - "slot": "153", - "type": "t_array(t_address)dyn_storage", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:46" - }, - { - "label": "rewarders", - "offset": 0, - "slot": "154", - "type": "t_mapping(t_uint256,t_array(t_address)dyn_storage)", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:48" - }, - { - "label": "isStakingToken", - "offset": 0, - "slot": "155", - "type": "t_mapping(t_address,t_bool)", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:49" - }, - { - "label": "stakingReserves", - "offset": 0, - "slot": "156", - "type": "t_mapping(t_address,t_uint256)", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:50" - }, - { - "label": "userInfo", - "offset": 0, - "slot": "157", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_struct(UserInfo)8316_storage))", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:52" - }, - { - "label": "whitelistedCallers", - "offset": 0, - "slot": "158", - "type": "t_mapping(t_address,t_bool)", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:53" - }, - { - "label": "totalAllocPoint", - "offset": 0, - "slot": "159", - "type": "t_uint256", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:55" - }, - { - "label": "alpacaPerSecond", - "offset": 0, - "slot": "160", - "type": "t_uint256", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:56" - }, - { - "label": "maxAlpacaPerSecond", - "offset": 0, - "slot": "161", - "type": "t_uint256", - "contract": "MiniFL", - "src": "solidity/contracts/miniFL/MiniFL.sol:58" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_address)dyn_storage": { - "label": "address[]", - "numberOfBytes": "32" - }, - "t_array(t_struct(PoolInfo)8323_storage)dyn_storage": { - "label": "struct MiniFL.PoolInfo[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_int256": { - "label": "int256", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(UserInfo)8316_storage)": { - "label": "mapping(address => struct MiniFL.UserInfo)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_uint256)": { - "label": "mapping(address => uint256)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_address)dyn_storage)": { - "label": "mapping(uint256 => address[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_struct(UserInfo)8316_storage))": { - "label": "mapping(uint256 => mapping(address => struct MiniFL.UserInfo))", - "numberOfBytes": "32" - }, - "t_struct(PoolInfo)8323_storage": { - "label": "struct MiniFL.PoolInfo", - "members": [ - { - "label": "accAlpacaPerShare", - "type": "t_uint128", - "offset": 0, - "slot": "0" - }, - { - "label": "lastRewardTime", - "type": "t_uint64", - "offset": 16, - "slot": "0" - }, - { - "label": "allocPoint", - "type": "t_uint64", - "offset": 24, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(UserInfo)8316_storage": { - "label": "struct MiniFL.UserInfo", - "members": [ - { - "label": "fundedAmounts", - "type": "t_mapping(t_address,t_uint256)", - "offset": 0, - "slot": "0" - }, - { - "label": "totalAmount", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "rewardDebt", - "type": "t_int256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint128": { - "label": "uint128", - "numberOfBytes": "16" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - } - } - }, - "bb9d836b9d25873e6474b245034fb7ed11a1dbf45597939612c3ce7e9edc2845": { - "address": "0xEDd2b93063E79604dD2C306e0A59dDA15697C4e8", - "txHash": "0x0c3dfb8df785b2463668f326812669cdc85244fa003b1b8241374efa2e5d475c", - "layout": { - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" - }, - { - "label": "_owner", - "offset": 0, - "slot": "51", - "type": "t_address", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)49_storage", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" - }, - { - "label": "primarySourceCount", - "offset": 0, - "slot": "101", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", - "contract": "OracleMedianizer", - "src": "solidity/contracts/oracle/OracleMedianizer.sol:15" - }, - { - "label": "primarySources", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_address,t_mapping(t_address,t_mapping(t_uint256,t_contract(IPriceOracle)30951)))", - "contract": "OracleMedianizer", - "src": "solidity/contracts/oracle/OracleMedianizer.sol:17" - }, - { - "label": "maxPriceDeviations", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", - "contract": "OracleMedianizer", - "src": "solidity/contracts/oracle/OracleMedianizer.sol:19" - }, - { - "label": "maxPriceStales", - "offset": 0, - "slot": "104", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", - "contract": "OracleMedianizer", - "src": "solidity/contracts/oracle/OracleMedianizer.sol:21" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_contract(IPriceOracle)30951": { - "label": "contract IPriceOracle", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_mapping(t_uint256,t_contract(IPriceOracle)30951)))": { - "label": "mapping(address => mapping(address => mapping(uint256 => contract IPriceOracle)))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_contract(IPriceOracle)30951))": { - "label": "mapping(address => mapping(uint256 => contract IPriceOracle))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_uint256)": { - "label": "mapping(address => uint256)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_contract(IPriceOracle)30951)": { - "label": "mapping(uint256 => contract IPriceOracle)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - } - } - } - } -} diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-admin.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-admin.ts index 4a496d67..519f0410 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-admin.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-admin.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for AdminFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-all.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-all.ts index 0e9f7c26..03154e6d 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-all.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-all.ts @@ -67,8 +67,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { }, ]); - await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x", { gasLimit: 10000000 }); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x", { gasLimit: 10000000 }); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`> 🟢 Execute diamondCut for ${config.name}`); } }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-borrow.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-borrow.ts index 7051127f..c58abde8 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-borrow.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-borrow.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for BorrowFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-collateral.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-collateral.ts index 2a962407..0db4bf39 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-collateral.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-collateral.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for CollateralFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-diamond-loupe.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-diamond-loupe.ts index 01d0bee4..af97690d 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-diamond-loupe.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-diamond-loupe.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for DiamondLoupeFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-flash-loan.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-flash-loan.ts index 1019cb0d..bdd7a615 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-flash-loan.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-flash-loan.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for FlashloanFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-lend.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-lend.ts index 0b4cb884..9313ff94 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-lend.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-lend.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for LendFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-liquidation.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-liquidation.ts index 6f3ef428..458e3743 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-liquidation.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-liquidation.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for LiquidationFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-non-collat-borrow.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-non-collat-borrow.ts index 621c85d2..2a0104e5 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-non-collat-borrow.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-non-collat-borrow.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for NonCollatBorrowFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-ownership.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-ownership.ts index a67480cc..0c295820 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-ownership.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-ownership.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for OwnershipFacet`); }; diff --git a/deploy/core/facets/diamond-cut/execute-diamond-cut-view.ts b/deploy/core/facets/diamond-cut/execute-diamond-cut-view.ts index 752666dd..d382b2bc 100644 --- a/deploy/core/facets/diamond-cut/execute-diamond-cut-view.ts +++ b/deploy/core/facets/diamond-cut/execute-diamond-cut-view.ts @@ -31,8 +31,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const poolDiamond = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); - await (await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x")).wait(); + const tx = await poolDiamond.diamondCut(facetCuts, ethers.constants.AddressZero, "0x"); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log(`Execute diamondCut for ViewFacet`); }; diff --git a/deploy/file-helper.ts/config-file.helper.ts b/deploy/file-helper.ts/config-file.helper.ts index ded1cd47..8cf3f26a 100644 --- a/deploy/file-helper.ts/config-file.helper.ts +++ b/deploy/file-helper.ts/config-file.helper.ts @@ -62,12 +62,6 @@ export class ConfigFileHelper { this._writeConfigFile(this.config); } - public setMoneyMarketAccountManagerDeploy(proxy: string, implementation: string): void { - this.config.moneyMarket.accountManager.proxy = proxy; - this.config.moneyMarket.accountManager.implementation = implementation; - this._writeConfigFile(this.config); - } - public setOracleMedianizer(address: string): void { this.config.oracle.oracleMedianizer = address; this._writeConfigFile(this.config); diff --git a/deploy/money-market-account-manager/deploy/money-market-account-manager.ts b/deploy/money-market-account-manager/deploy/money-market-account-manager.ts deleted file mode 100644 index 87065d1a..00000000 --- a/deploy/money-market-account-manager/deploy/money-market-account-manager.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ethers, upgrades } from "hardhat"; -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { getDeployer } from "../../utils/deployer-helper"; -import { getImplementationAddress } from "@openzeppelin/upgrades-core"; -import { ConfigFileHelper } from "../../file-helper.ts/config-file.helper"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const configFileHelper = new ConfigFileHelper(); - const config = configFileHelper.getConfig(); - const deployer = await getDeployer(); - /* - ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ - ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ - ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ - ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ - ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ - ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ - Check all variables below before execute the deployment script - */ - - const moneyMarket = config.moneyMarket.moneyMarketDiamond; - const weth = "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"; - const nativeRelayer = config.nativeRelayer; - - const MoneyMarketAccountManagerFactory = await ethers.getContractFactory("MoneyMarketAccountManager", deployer); - - const moneyMarketAccountManager = await upgrades.deployProxy( - MoneyMarketAccountManagerFactory, - [moneyMarket, weth, nativeRelayer], - { - unsafeAllow: ["delegatecall"], - } - ); - const implAddress = await getImplementationAddress(ethers.provider, moneyMarketAccountManager.address); - - console.log(`> 🟢 MoneyMarketAccountManager implementation deployed at: ${implAddress}`); - console.log(`> 🟢 MoneyMarketAccountManager proxy deployed at: ${moneyMarketAccountManager.address}`); - - configFileHelper.setMoneyMarketAccountManagerDeploy(moneyMarketAccountManager.address, implAddress); -}; - -export default func; -func.tags = ["MoneyMarketAccountManagerDeploy"]; diff --git a/deploy/money-market/config/set-debt-token-implementation.ts b/deploy/money-market/config/set-debt-token-implementation.ts index f05b81d1..b5a386a1 100644 --- a/deploy/money-market/config/set-debt-token-implementation.ts +++ b/deploy/money-market/config/set-debt-token-implementation.ts @@ -25,8 +25,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setDebtTokenImplementation : ${debtTokenImplementation}`); - await iMoneyMarketFactory.setDebtTokenImplementation(debtTokenImplementation); + const tx = await iMoneyMarketFactory.setDebtTokenImplementation(debtTokenImplementation); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-fees.ts b/deploy/money-market/config/set-fees.ts index 3cee1fe9..dba6b091 100644 --- a/deploy/money-market/config/set-fees.ts +++ b/deploy/money-market/config/set-fees.ts @@ -27,8 +27,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setFees : ${newLendingFeeBps} , ${newRepurchaseFeeBps} , ${newLiquidationFeeBps}`); - await iMoneyMarketFactory.setFees(newLendingFeeBps, newRepurchaseFeeBps, newLiquidationFeeBps); + const tx = await iMoneyMarketFactory.setFees(newLendingFeeBps, newRepurchaseFeeBps, newLiquidationFeeBps); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-ib-token-implementation.ts b/deploy/money-market/config/set-ib-token-implementation.ts index 8a1dcff8..c8f86219 100644 --- a/deploy/money-market/config/set-ib-token-implementation.ts +++ b/deploy/money-market/config/set-ib-token-implementation.ts @@ -25,8 +25,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setIbTokenImplementation : ${ibTokenImplementation}`); - await iMoneyMarketFactory.setIbTokenImplementation(ibTokenImplementation); + const tx = await iMoneyMarketFactory.setIbTokenImplementation(ibTokenImplementation); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-liquidation-param.ts b/deploy/money-market/config/set-liquidation-param.ts index 70f03058..3e7a28b0 100644 --- a/deploy/money-market/config/set-liquidation-param.ts +++ b/deploy/money-market/config/set-liquidation-param.ts @@ -26,8 +26,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setLiquidationParams : ${newMaxLiquidateBps} , ${newLiquidationThreshold}`); - await iMoneyMarketFactory.setLiquidationParams(newMaxLiquidateBps, newLiquidationThreshold); + const tx = await iMoneyMarketFactory.setLiquidationParams(newMaxLiquidateBps, newLiquidationThreshold); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-liquidation-treasury.ts b/deploy/money-market/config/set-liquidation-treasury.ts index 13f16376..8566dfb6 100644 --- a/deploy/money-market/config/set-liquidation-treasury.ts +++ b/deploy/money-market/config/set-liquidation-treasury.ts @@ -25,8 +25,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setLiquidationTreasury : ${treasury}`); - await iMoneyMarketFactory.setLiquidationTreasury(treasury); + const tx = await iMoneyMarketFactory.setLiquidationTreasury(treasury); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-max-num-of-token.ts b/deploy/money-market/config/set-max-num-of-token.ts index f17021be..2ab0691c 100644 --- a/deploy/money-market/config/set-max-num-of-token.ts +++ b/deploy/money-market/config/set-max-num-of-token.ts @@ -27,8 +27,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setMaxNumOfToken : ${numOfCollat} , ${numOfDebt} , ${numOfNonCollatDebt}`); - await iMoneyMarketFactory.setMaxNumOfToken(numOfCollat, numOfDebt, numOfNonCollatDebt); + const tx = await iMoneyMarketFactory.setMaxNumOfToken(numOfCollat, numOfDebt, numOfNonCollatDebt); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-min-debt-size.ts b/deploy/money-market/config/set-min-debt-size.ts index c67efa4c..7bdf2ef7 100644 --- a/deploy/money-market/config/set-min-debt-size.ts +++ b/deploy/money-market/config/set-min-debt-size.ts @@ -26,8 +26,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setMinDebtSize : ${minDebtSize.toString()}`); - await iMoneyMarketFactory.setMinDebtSize(minDebtSize); + const tx = await iMoneyMarketFactory.setMinDebtSize(minDebtSize); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-oracle.ts b/deploy/money-market/config/set-oracle.ts index 05928fdb..18bda01a 100644 --- a/deploy/money-market/config/set-oracle.ts +++ b/deploy/money-market/config/set-oracle.ts @@ -25,8 +25,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setOracle : ${newOracle}`); - await iMoneyMarketFactory.setOracle(newOracle); + const tx = await iMoneyMarketFactory.setOracle(newOracle); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-repurchase-reward-model.ts b/deploy/money-market/config/set-repurchase-reward-model.ts index e65e7c1b..20053715 100644 --- a/deploy/money-market/config/set-repurchase-reward-model.ts +++ b/deploy/money-market/config/set-repurchase-reward-model.ts @@ -25,8 +25,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setRepurchaseRewardModel : ${fixFeeModel500Bps}`); - await iMoneyMarketFactory.setRepurchaseRewardModel(fixFeeModel500Bps); + const tx = await iMoneyMarketFactory.setRepurchaseRewardModel(fixFeeModel500Bps); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/deploy/money-market/config/set-risk-manager.ts b/deploy/money-market/config/set-risk-manager.ts index c09cf620..aa26267b 100644 --- a/deploy/money-market/config/set-risk-manager.ts +++ b/deploy/money-market/config/set-risk-manager.ts @@ -26,8 +26,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`> 🟢 setRiskManagersOk : ${riskManagers} , ${isOk}`); - await iMoneyMarketFactory.setRiskManagersOk(riskManagers, isOk); + const tx = await iMoneyMarketFactory.setRiskManagersOk(riskManagers, isOk); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + + await tx.wait(); + + console.log(`> Tx is mined`); console.log("✅ Done"); }; diff --git a/package.json b/package.json index 9d558da4..2aca8e4e 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,6 @@ "exec:arbitrum_mainnet:money-market:config:set-oracle": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MMSetOracle", "exec:arbitrum_mainnet:money-market:config:set-repurchase-reward-model": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MMSetRepurchaseRewardModel", "exec:arbitrum_mainnet:money-market:config:set-risk-manager-ok": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MMSetRiskManagersOk", - "exec:arbitrum_mainnet:money-market-account-manager:deploy": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MoneyMarketAccountManagerDeploy", "exec:arbitrum_mainnet:oracle-medianizer:deploy": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags OracleMedianizerDeploy", "exec:arbitrum_mainnet:fix-fee-model-500-bps:deploy": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MMSetFixedFeeModel500BpsDeploy", "exec:arbitrum_mainnet:pancake-v2-liquidate-ib-strategy:deploy": "hardhat --network arbitrum_mainnet deploy --no-compile --reset --tags MMPancakeswapV2IbTokenLiquidationStrategyDeploy"