From 790195131c2609f578a5616a4ecfa4f043af3f70 Mon Sep 17 00:00:00 2001 From: Rick Date: Mon, 5 Apr 2021 10:59:24 +0100 Subject: [PATCH] Add ops for repaying LUSD and adding coll to deployment script --- .../mainnetDeployment/mainnetDeployment.js | 608 +++++++++--------- .../contracts/mainnetDeployment/output3.txt | 120 ++++ .../contracts/mainnetDeployment/output4.txt | 54 ++ .../contracts/mainnetDeployment/output5.txt | 84 +++ 4 files changed, 569 insertions(+), 297 deletions(-) create mode 100644 packages/contracts/mainnetDeployment/output3.txt create mode 100644 packages/contracts/mainnetDeployment/output4.txt create mode 100644 packages/contracts/mainnetDeployment/output5.txt diff --git a/packages/contracts/mainnetDeployment/mainnetDeployment.js b/packages/contracts/mainnetDeployment/mainnetDeployment.js index bda6e0a0f..b7394d27a 100644 --- a/packages/contracts/mainnetDeployment/mainnetDeployment.js +++ b/packages/contracts/mainnetDeployment/mainnetDeployment.js @@ -135,6 +135,16 @@ async function mainnetDeploy(configParams) { // // --- TESTS AND CHECKS --- + // Deployer repay LUSD + // console.log(`deployer trove debt before repaying: ${await liquityCore.troveManager.getTroveDebt(deployerWallet.address)}`) + // await mdh.sendAndWaitForTransaction(liquityCore.borrowerOperations.repayLUSD(dec(800, 18), th.ZERO_ADDRESS, th.ZERO_ADDRESS, {gasPrice, gasLimit: 1000000})) + // console.log(`deployer trove debt after repaying: ${await liquityCore.troveManager.getTroveDebt(deployerWallet.address)}`) + + // Deployer add coll + // console.log(`deployer trove coll before adding coll: ${await liquityCore.troveManager.getTroveColl(deployerWallet.address)}`) + // await mdh.sendAndWaitForTransaction(liquityCore.borrowerOperations.addColl(th.ZERO_ADDRESS, th.ZERO_ADDRESS, {value: dec(2, 'ether'), gasPrice, gasLimit: 1000000})) + // console.log(`deployer trove coll after addingColl: ${await liquityCore.troveManager.getTroveColl(deployerWallet.address)}`) + // Check chainlink proxy price --- const chainlinkProxy = new ethers.Contract( @@ -152,362 +162,362 @@ async function mainnetDeploy(configParams) { console.log(`current Tellor price: ${tellorPriceResponse[1]}`) console.log(`current Tellor timestamp: ${tellorPriceResponse[2]}`) - // --- Lockup Contracts --- - console.log("LOCKUP CONTRACT CHECKS") - // Check lockup contracts exist for each beneficiary with correct unlock time - for (investor of Object.keys(lockupContracts)) { - const lockupContract = lockupContracts[investor] - const onChainBeneficiary = await lockupContract.beneficiary() - const unlockTime = await lockupContract.unlockTime() - - console.log( - `lockupContract addr: ${th.squeezeAddr(lockupContract.address)}, - beneficiary: ${investor}, - beneficiary addr: ${th.squeezeAddr(configParams.beneficiaries[investor])}, - on-chain beneficiary addr: ${th.squeezeAddr(onChainBeneficiary)} - unlockTime: ${unlockTime} - ` - ) - } - - // --- Check correct addresses set in LQTYToken - console.log("STORED ADDRESSES IN LQTY TOKEN") - const storedMultisigAddress = await LQTYContracts.lqtyToken.multisigAddress() - assert.equal(configParams.liquityAddrs.LQTY_SAFE.toLowerCase(), storedMultisigAddress.toLowerCase()) - console.log(`multi-sig address stored in LQTYToken : ${th.squeezeAddr(storedMultisigAddress)}`) - console.log(`LQTY Safe address: ${th.squeezeAddr(configParams.liquityAddrs.LQTY_SAFE)}`) - - // --- LQTY allowances of different addresses --- - console.log("INITIAL LQTY BALANCES") - // Unipool - const unipoolLQTYBal = await LQTYContracts.lqtyToken.balanceOf(unipool.address) - assert.equal(unipoolLQTYBal.toString(), '1333333333333333333333333') - th.logBN('Unipool LQTY balance ', unipoolLQTYBal) - - // LQTY Safe - const lqtySafeBal = await LQTYContracts.lqtyToken.balanceOf(configParams.liquityAddrs.LQTY_SAFE) - assert.equal(lqtySafeBal.toString(), '64666666666666666666666667') - th.logBN('LQTY Safe balance ', lqtySafeBal) - - // Bounties/hackathons (General Safe) - const generalSafeBal = await LQTYContracts.lqtyToken.balanceOf(configParams.liquityAddrs.GENERAL_SAFE) - assert.equal(generalSafeBal.toString(), '2000000000000000000000000') - th.logBN('General Safe balance ', generalSafeBal) - - // CommunityIssuance contract - const communityIssuanceBal = await LQTYContracts.lqtyToken.balanceOf(LQTYContracts.communityIssuance.address) - assert.equal(communityIssuanceBal.toString(), '32000000000000000000000000') - th.logBN('Community Issuance balance', communityIssuanceBal) - - // --- PriceFeed --- - console.log("PRICEFEED CHECKS") - // Check Pricefeed's status and last good price - const lastGoodPrice = await liquityCore.priceFeed.lastGoodPrice() - const priceFeedInitialStatus = await liquityCore.priceFeed.status() - th.logBN('PriceFeed first stored price', lastGoodPrice) - console.log(`PriceFeed initial status: ${priceFeedInitialStatus}`) - - // Check PriceFeed's & TellorCaller's stored addresses - const priceFeedCLAddress = await liquityCore.priceFeed.priceAggregator() - const priceFeedTellorCallerAddress = await liquityCore.priceFeed.tellorCaller() - assert.equal(priceFeedCLAddress, configParams.externalAddrs.CHAINLINK_ETHUSD_PROXY) - assert.equal(priceFeedTellorCallerAddress, liquityCore.tellorCaller.address) - - // Check Tellor address - const tellorCallerTellorMasterAddress = await liquityCore.tellorCaller.tellor() - assert.equal(tellorCallerTellorMasterAddress, configParams.externalAddrs.TELLOR_MASTER) - - // --- Unipool --- - - // Check Unipool's LUSD-ETH Uniswap Pair address - const unipoolUniswapPairAddr = await unipool.uniToken() - console.log(`Unipool's stored LUSD-ETH Uniswap Pair address: ${unipoolUniswapPairAddr}`) - - console.log("SYSTEM GLOBAL VARS CHECKS") - // --- Sorted Troves --- - - // Check max size - const sortedTrovesMaxSize = (await liquityCore.sortedTroves.data())[2] - assert.equal(sortedTrovesMaxSize, '115792089237316195423570985008687907853269984665640564039457584007913129639935') - - // --- TroveManager --- - - const liqReserve = await liquityCore.troveManager.LUSD_GAS_COMPENSATION() - const minNetDebt = await liquityCore.troveManager.MIN_NET_DEBT() - - th.logBN('system liquidation reserve', liqReserve) - th.logBN('system min net debt ', minNetDebt) - - // --- Make first LUSD-ETH liquidity provision --- - - // Open trove if not yet opened - const troveStatus = await liquityCore.troveManager.getTroveStatus(deployerWallet.address) - if (troveStatus.toString() != '1') { - let _3kLUSDWithdrawal = th.dec(3000, 18) // 3000 LUSD - let _3ETHcoll = th.dec(3, 'ether') // 3 ETH - console.log('Opening trove...') - await mdh.sendAndWaitForTransaction( - liquityCore.borrowerOperations.openTrove( - th._100pct, - _3kLUSDWithdrawal, - th.ZERO_ADDRESS, - th.ZERO_ADDRESS, - { value: _3ETHcoll, gasPrice } - ) - ) - } else { - console.log('Deployer already has an active trove') - } + // // --- Lockup Contracts --- + // console.log("LOCKUP CONTRACT CHECKS") + // // Check lockup contracts exist for each beneficiary with correct unlock time + // for (investor of Object.keys(lockupContracts)) { + // const lockupContract = lockupContracts[investor] + // const onChainBeneficiary = await lockupContract.beneficiary() + // const unlockTime = await lockupContract.unlockTime() + + // console.log( + // `lockupContract addr: ${th.squeezeAddr(lockupContract.address)}, + // beneficiary: ${investor}, + // beneficiary addr: ${th.squeezeAddr(configParams.beneficiaries[investor])}, + // on-chain beneficiary addr: ${th.squeezeAddr(onChainBeneficiary)} + // unlockTime: ${unlockTime} + // ` + // ) + // } + + // // --- Check correct addresses set in LQTYToken + // console.log("STORED ADDRESSES IN LQTY TOKEN") + // const storedMultisigAddress = await LQTYContracts.lqtyToken.multisigAddress() + // assert.equal(configParams.liquityAddrs.LQTY_SAFE.toLowerCase(), storedMultisigAddress.toLowerCase()) + // console.log(`multi-sig address stored in LQTYToken : ${th.squeezeAddr(storedMultisigAddress)}`) + // console.log(`LQTY Safe address: ${th.squeezeAddr(configParams.liquityAddrs.LQTY_SAFE)}`) + + // // --- LQTY allowances of different addresses --- + // console.log("INITIAL LQTY BALANCES") + // // Unipool + // const unipoolLQTYBal = await LQTYContracts.lqtyToken.balanceOf(unipool.address) + // // assert.equal(unipoolLQTYBal.toString(), '1333333333333333333333333') + // th.logBN('Unipool LQTY balance ', unipoolLQTYBal) + + // // LQTY Safe + // const lqtySafeBal = await LQTYContracts.lqtyToken.balanceOf(configParams.liquityAddrs.LQTY_SAFE) + // assert.equal(lqtySafeBal.toString(), '64666666666666666666666667') + // th.logBN('LQTY Safe balance ', lqtySafeBal) + + // // Bounties/hackathons (General Safe) + // const generalSafeBal = await LQTYContracts.lqtyToken.balanceOf(configParams.liquityAddrs.GENERAL_SAFE) + // assert.equal(generalSafeBal.toString(), '2000000000000000000000000') + // th.logBN('General Safe balance ', generalSafeBal) + + // // CommunityIssuance contract + // const communityIssuanceBal = await LQTYContracts.lqtyToken.balanceOf(LQTYContracts.communityIssuance.address) + // // assert.equal(communityIssuanceBal.toString(), '32000000000000000000000000') + // th.logBN('Community Issuance balance', communityIssuanceBal) + + // // --- PriceFeed --- + // console.log("PRICEFEED CHECKS") + // // Check Pricefeed's status and last good price + // const lastGoodPrice = await liquityCore.priceFeed.lastGoodPrice() + // const priceFeedInitialStatus = await liquityCore.priceFeed.status() + // th.logBN('PriceFeed first stored price', lastGoodPrice) + // console.log(`PriceFeed initial status: ${priceFeedInitialStatus}`) + + // // Check PriceFeed's & TellorCaller's stored addresses + // const priceFeedCLAddress = await liquityCore.priceFeed.priceAggregator() + // const priceFeedTellorCallerAddress = await liquityCore.priceFeed.tellorCaller() + // assert.equal(priceFeedCLAddress, configParams.externalAddrs.CHAINLINK_ETHUSD_PROXY) + // assert.equal(priceFeedTellorCallerAddress, liquityCore.tellorCaller.address) + + // // Check Tellor address + // const tellorCallerTellorMasterAddress = await liquityCore.tellorCaller.tellor() + // assert.equal(tellorCallerTellorMasterAddress, configParams.externalAddrs.TELLOR_MASTER) + + // // --- Unipool --- + + // // Check Unipool's LUSD-ETH Uniswap Pair address + // const unipoolUniswapPairAddr = await unipool.uniToken() + // console.log(`Unipool's stored LUSD-ETH Uniswap Pair address: ${unipoolUniswapPairAddr}`) + + // console.log("SYSTEM GLOBAL VARS CHECKS") + // // --- Sorted Troves --- + + // // Check max size + // const sortedTrovesMaxSize = (await liquityCore.sortedTroves.data())[2] + // assert.equal(sortedTrovesMaxSize, '115792089237316195423570985008687907853269984665640564039457584007913129639935') + + // // --- TroveManager --- + + // const liqReserve = await liquityCore.troveManager.LUSD_GAS_COMPENSATION() + // const minNetDebt = await liquityCore.troveManager.MIN_NET_DEBT() + + // th.logBN('system liquidation reserve', liqReserve) + // th.logBN('system min net debt ', minNetDebt) + + // // --- Make first LUSD-ETH liquidity provision --- + + // // Open trove if not yet opened + // const troveStatus = await liquityCore.troveManager.getTroveStatus(deployerWallet.address) + // if (troveStatus.toString() != '1') { + // let _3kLUSDWithdrawal = th.dec(3000, 18) // 3000 LUSD + // let _3ETHcoll = th.dec(3, 'ether') // 3 ETH + // console.log('Opening trove...') + // await mdh.sendAndWaitForTransaction( + // liquityCore.borrowerOperations.openTrove( + // th._100pct, + // _3kLUSDWithdrawal, + // th.ZERO_ADDRESS, + // th.ZERO_ADDRESS, + // { value: _3ETHcoll, gasPrice } + // ) + // ) + // } else { + // console.log('Deployer already has an active trove') + // } - // Check deployer now has an open trove - console.log(`deployer is in sorted list after making trove: ${await liquityCore.sortedTroves.contains(deployerWallet.address)}`) + // // Check deployer now has an open trove + // console.log(`deployer is in sorted list after making trove: ${await liquityCore.sortedTroves.contains(deployerWallet.address)}`) - const deployerTrove = await liquityCore.troveManager.Troves(deployerWallet.address) - th.logBN('deployer debt', deployerTrove[0]) - th.logBN('deployer coll', deployerTrove[1]) - th.logBN('deployer stake', deployerTrove[2]) - console.log(`deployer's trove status: ${deployerTrove[3]}`) + // const deployerTrove = await liquityCore.troveManager.Troves(deployerWallet.address) + // th.logBN('deployer debt', deployerTrove[0]) + // th.logBN('deployer coll', deployerTrove[1]) + // th.logBN('deployer stake', deployerTrove[2]) + // console.log(`deployer's trove status: ${deployerTrove[3]}`) - // Check deployer has LUSD - let deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) - th.logBN("deployer's LUSD balance", deployerLUSDBal) + // // Check deployer has LUSD + // let deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) + // th.logBN("deployer's LUSD balance", deployerLUSDBal) - // Check Uniswap pool has LUSD and WETH tokens + // // Check Uniswap pool has LUSD and WETH tokens const LUSDETHPair = await new ethers.Contract( LUSDWETHPairAddr, UniswapV2Pair.abi, deployerWallet ) - const token0Addr = await LUSDETHPair.token0() - const token1Addr = await LUSDETHPair.token1() - console.log(`LUSD-ETH Pair token 0: ${th.squeezeAddr(token0Addr)}, - LUSDToken contract addr: ${th.squeezeAddr(liquityCore.lusdToken.address)}`) - console.log(`LUSD-ETH Pair token 1: ${th.squeezeAddr(token1Addr)}, - WETH ERC20 contract addr: ${th.squeezeAddr(configParams.externalAddrs.WETH_ERC20)}`) - - // Check initial LUSD-ETH pair reserves before provision - let reserves = await LUSDETHPair.getReserves() - th.logBN("LUSD-ETH Pair's LUSD reserves before provision", reserves[0]) - th.logBN("LUSD-ETH Pair's ETH reserves before provision", reserves[1]) - - // Get the UniswapV2Router contract - const uniswapV2Router02 = new ethers.Contract( - configParams.externalAddrs.UNIWAP_V2_ROUTER02, - UniswapV2Router02.abi, - deployerWallet - ) + // const token0Addr = await LUSDETHPair.token0() + // const token1Addr = await LUSDETHPair.token1() + // console.log(`LUSD-ETH Pair token 0: ${th.squeezeAddr(token0Addr)}, + // LUSDToken contract addr: ${th.squeezeAddr(liquityCore.lusdToken.address)}`) + // console.log(`LUSD-ETH Pair token 1: ${th.squeezeAddr(token1Addr)}, + // WETH ERC20 contract addr: ${th.squeezeAddr(configParams.externalAddrs.WETH_ERC20)}`) + + // // Check initial LUSD-ETH pair reserves before provision + // let reserves = await LUSDETHPair.getReserves() + // th.logBN("LUSD-ETH Pair's LUSD reserves before provision", reserves[0]) + // th.logBN("LUSD-ETH Pair's ETH reserves before provision", reserves[1]) + + // // Get the UniswapV2Router contract + // const uniswapV2Router02 = new ethers.Contract( + // configParams.externalAddrs.UNIWAP_V2_ROUTER02, + // UniswapV2Router02.abi, + // deployerWallet + // ) - // --- Provide liquidity to LUSD-ETH pair if not yet done so --- - let deployerLPTokenBal = await LUSDETHPair.balanceOf(deployerWallet.address) - if (deployerLPTokenBal.toString() == '0') { - console.log('Providing liquidity to Uniswap...') - // Give router an allowance for LUSD - await liquityCore.lusdToken.increaseAllowance(uniswapV2Router02.address, dec(10000, 18)) - - // Check Router's spending allowance - const routerLUSDAllowanceFromDeployer = await liquityCore.lusdToken.allowance(deployerWallet.address, uniswapV2Router02.address) - th.logBN("router's spending allowance for deployer's LUSD", routerLUSDAllowanceFromDeployer) - - // Get amounts for liquidity provision - const LP_ETH = dec(1, 'ether') - - // Convert 8-digit CL price to 18 and multiply by ETH amount - const LUSDAmount = toBigNum(chainlinkPrice) - .mul(toBigNum(dec(1, 10))) - .mul(toBigNum(LP_ETH)) - .div(toBigNum(dec(1, 18))) - - const minLUSDAmount = LUSDAmount.sub(toBigNum(dec(100, 18))) - - latestBlock = await ethers.provider.getBlockNumber() - now = (await ethers.provider.getBlock(latestBlock)).timestamp - let tenMinsFromNow = now + (60 * 60 * 10) - - // Provide liquidity to LUSD-ETH pair - await mdh.sendAndWaitForTransaction( - uniswapV2Router02.addLiquidityETH( - liquityCore.lusdToken.address, // address of LUSD token - LUSDAmount, // LUSD provision - minLUSDAmount, // minimum LUSD provision - LP_ETH, // minimum ETH provision - deployerWallet.address, // address to send LP tokens to - tenMinsFromNow, // deadline for this tx - { - value: dec(1, 'ether'), - gasPrice, - gasLimit: 5000000 // For some reason, ethers can't estimate gas for this tx - } - ) - ) - } else { - console.log('Liquidity already provided to Uniswap') - } - // Check LUSD-ETH reserves after liquidity provision: - reserves = await LUSDETHPair.getReserves() - th.logBN("LUSD-ETH Pair's LUSD reserves after provision", reserves[0]) - th.logBN("LUSD-ETH Pair's ETH reserves after provision", reserves[1]) + // // --- Provide liquidity to LUSD-ETH pair if not yet done so --- + // let deployerLPTokenBal = await LUSDETHPair.balanceOf(deployerWallet.address) + // if (deployerLPTokenBal.toString() == '0') { + // console.log('Providing liquidity to Uniswap...') + // // Give router an allowance for LUSD + // await liquityCore.lusdToken.increaseAllowance(uniswapV2Router02.address, dec(10000, 18)) + // // Check Router's spending allowance + // const routerLUSDAllowanceFromDeployer = await liquityCore.lusdToken.allowance(deployerWallet.address, uniswapV2Router02.address) + // th.logBN("router's spending allowance for deployer's LUSD", routerLUSDAllowanceFromDeployer) + // // Get amounts for liquidity provision + // const LP_ETH = dec(1, 'ether') - // --- Check LP staking --- - console.log("CHECK LP STAKING EARNS LQTY") + // // Convert 8-digit CL price to 18 and multiply by ETH amount + // const LUSDAmount = toBigNum(chainlinkPrice) + // .mul(toBigNum(dec(1, 10))) + // .mul(toBigNum(LP_ETH)) + // .div(toBigNum(dec(1, 18))) - // Check deployer's LP tokens - deployerLPTokenBal = await LUSDETHPair.balanceOf(deployerWallet.address) - th.logBN("deployer's LP token balance", deployerLPTokenBal) + // const minLUSDAmount = LUSDAmount.sub(toBigNum(dec(100, 18))) - // Stake LP tokens in Unipool - console.log(`LUSDETHPair addr: ${LUSDETHPair.address}`) - console.log(`Pair addr stored in Unipool: ${await unipool.uniToken()}`) + // latestBlock = await ethers.provider.getBlockNumber() + // now = (await ethers.provider.getBlock(latestBlock)).timestamp + // let tenMinsFromNow = now + (60 * 60 * 10) + + // // Provide liquidity to LUSD-ETH pair + // await mdh.sendAndWaitForTransaction( + // uniswapV2Router02.addLiquidityETH( + // liquityCore.lusdToken.address, // address of LUSD token + // LUSDAmount, // LUSD provision + // minLUSDAmount, // minimum LUSD provision + // LP_ETH, // minimum ETH provision + // deployerWallet.address, // address to send LP tokens to + // tenMinsFromNow, // deadline for this tx + // { + // value: dec(1, 'ether'), + // gasPrice, + // gasLimit: 5000000 // For some reason, ethers can't estimate gas for this tx + // } + // ) + // ) + // } else { + // console.log('Liquidity already provided to Uniswap') + // } + // // Check LUSD-ETH reserves after liquidity provision: + // reserves = await LUSDETHPair.getReserves() + // th.logBN("LUSD-ETH Pair's LUSD reserves after provision", reserves[0]) + // th.logBN("LUSD-ETH Pair's ETH reserves after provision", reserves[1]) - earnedLQTY = await unipool.earned(deployerWallet.address) - th.logBN("deployer's farmed LQTY before staking LP tokens", earnedLQTY) - const deployerUnipoolStake = await unipool.balanceOf(deployerWallet.address) - if (deployerUnipoolStake.toString() == '0') { - console.log('Staking to Unipool...') - // Deployer approves Unipool - await mdh.sendAndWaitForTransaction( - LUSDETHPair.approve(unipool.address, deployerLPTokenBal, { gasPrice }) - ) - await mdh.sendAndWaitForTransaction(unipool.stake(1, { gasPrice })) - } else { - console.log('Already staked in Unipool') - } + // // --- Check LP staking --- + // console.log("CHECK LP STAKING EARNS LQTY") - console.log("wait 90 seconds before checking earnings... ") - await configParams.waitFunction() + // // Check deployer's LP tokens + // deployerLPTokenBal = await LUSDETHPair.balanceOf(deployerWallet.address) + // th.logBN("deployer's LP token balance", deployerLPTokenBal) - earnedLQTY = await unipool.earned(deployerWallet.address) - th.logBN("deployer's farmed LQTY from Unipool after waiting ~1.5mins", earnedLQTY) + // // Stake LP tokens in Unipool + // console.log(`LUSDETHPair addr: ${LUSDETHPair.address}`) + // console.log(`Pair addr stored in Unipool: ${await unipool.uniToken()}`) - let deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) - th.logBN("deployer LQTY Balance Before SP deposit", deployerLQTYBal) + // earnedLQTY = await unipool.earned(deployerWallet.address) + // th.logBN("deployer's farmed LQTY before staking LP tokens", earnedLQTY) + // const deployerUnipoolStake = await unipool.balanceOf(deployerWallet.address) + // if (deployerUnipoolStake.toString() == '0') { + // console.log('Staking to Unipool...') + // // Deployer approves Unipool + // await mdh.sendAndWaitForTransaction( + // LUSDETHPair.approve(unipool.address, deployerLPTokenBal, { gasPrice }) + // ) + // await mdh.sendAndWaitForTransaction(unipool.stake(1, { gasPrice })) + // } else { + // console.log('Already staked in Unipool') + // } - // --- Make SP deposit and earn LQTY --- - console.log("CHECK DEPLOYER MAKING DEPOSIT AND EARNING LQTY") + // console.log("wait 90 seconds before checking earnings... ") + // await configParams.waitFunction() - let SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) - th.logBN("deployer SP deposit before making deposit", SPDeposit) + // earnedLQTY = await unipool.earned(deployerWallet.address) + // th.logBN("deployer's farmed LQTY from Unipool after waiting ~1.5mins", earnedLQTY) - // Provide to SP - await mdh.sendAndWaitForTransaction(liquityCore.stabilityPool.provideToSP(dec(15, 18), th.ZERO_ADDRESS, { gasPrice, gasLimit: 400000 })) + // let deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) + // th.logBN("deployer LQTY Balance Before SP deposit", deployerLQTYBal) - // Get SP deposit - SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) - th.logBN("deployer SP deposit after depositing 15 LUSD", SPDeposit) - console.log("wait 90 seconds before withdrawing...") - // wait 90 seconds - await configParams.waitFunction() - // Withdraw from SP - await mdh.sendAndWaitForTransaction(liquityCore.stabilityPool.withdrawFromSP(dec(1000, 18), { gasPrice, gasLimit: 400000 })) + // // --- Make SP deposit and earn LQTY --- + // console.log("CHECK DEPLOYER MAKING DEPOSIT AND EARNING LQTY") - SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) - th.logBN("deployer SP deposit after full withdrawal", SPDeposit) + // let SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) + // th.logBN("deployer SP deposit before making deposit", SPDeposit) - deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) - th.logBN("deployer LQTY Balance after SP deposit withdrawal", deployerLQTYBal) + // // Provide to SP + // await mdh.sendAndWaitForTransaction(liquityCore.stabilityPool.provideToSP(dec(15, 18), th.ZERO_ADDRESS, { gasPrice, gasLimit: 400000 })) + // // Get SP deposit + // SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) + // th.logBN("deployer SP deposit after depositing 15 LUSD", SPDeposit) + // console.log("wait 90 seconds before withdrawing...") + // // wait 90 seconds + // await configParams.waitFunction() - // --- Attempt withdrawal from LC --- - console.log("CHECK BENEFICIARY ATTEMPTING WITHDRAWAL FROM LC") + // // Withdraw from SP + // // await mdh.sendAndWaitForTransaction(liquityCore.stabilityPool.withdrawFromSP(dec(1000, 18), { gasPrice, gasLimit: 400000 })) - // connect Acct2 wallet to the LC they are beneficiary of - let account2LockupContract = await lockupContracts["ACCOUNT_2"].connect(account2Wallet) + // // SPDeposit = await liquityCore.stabilityPool.getCompoundedLUSDDeposit(deployerWallet.address) + // // th.logBN("deployer SP deposit after full withdrawal", SPDeposit) - // Deployer funds LC with 10 LQTY - await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyToken.transfer(account2LockupContract.address, dec(10, 18), { gasPrice })) + // // deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) + // // th.logBN("deployer LQTY Balance after SP deposit withdrawal", deployerLQTYBal) - // account2 LQTY bal - let account2bal = await LQTYContracts.lqtyToken.balanceOf(account2Wallet.address) - th.logBN("account2 LQTY bal before withdrawal attempt", account2bal) - // Check LC LQTY bal - let account2LockupContractBal = await LQTYContracts.lqtyToken.balanceOf(account2LockupContract.address) - th.logBN("account2's LC LQTY bal before withdrawal attempt", account2LockupContractBal) - // Acct2 attempts withdrawal from LC - await mdh.sendAndWaitForTransaction(account2LockupContract.withdrawLQTY({ gasPrice, gasLimit: 1000000 })) + // // --- Attempt withdrawal from LC --- + // console.log("CHECK BENEFICIARY ATTEMPTING WITHDRAWAL FROM LC") - // Acct LQTY bal - account2bal = await LQTYContracts.lqtyToken.balanceOf(account2Wallet.address) - th.logBN("account2's LQTY bal after LC withdrawal attempt", account2bal) + // // connect Acct2 wallet to the LC they are beneficiary of + // let account2LockupContract = await lockupContracts["ACCOUNT_2"].connect(account2Wallet) - // Check LC bal - account2LockupContractBal = await LQTYContracts.lqtyToken.balanceOf(account2LockupContract.address) - th.logBN("account2's LC LQTY bal LC withdrawal attempt", account2LockupContractBal) + // // Deployer funds LC with 10 LQTY + // await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyToken.transfer(account2LockupContract.address, dec(10, 18), { gasPrice })) - // --- Stake LQTY --- - console.log("CHECK DEPLOYER STAKING LQTY") + // // account2 LQTY bal + // let account2bal = await LQTYContracts.lqtyToken.balanceOf(account2Wallet.address) + // th.logBN("account2 LQTY bal before withdrawal attempt", account2bal) - // Log deployer LQTY bal and stake before staking - deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) - th.logBN("deployer LQTY bal before staking", deployerLQTYBal) - let deployerLQTYStake = await LQTYContracts.lqtyStaking.stakes(deployerWallet.address) - th.logBN("deployer stake before staking", deployerLQTYStake) + // // Check LC LQTY bal + // let account2LockupContractBal = await LQTYContracts.lqtyToken.balanceOf(account2LockupContract.address) + // th.logBN("account2's LC LQTY bal before withdrawal attempt", account2LockupContractBal) - // stake 13 LQTY - await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyStaking.stake(dec(13, 18), { gasPrice, gasLimit: 1000000 })) + // // Acct2 attempts withdrawal from LC + // await mdh.sendAndWaitForTransaction(account2LockupContract.withdrawLQTY({ gasPrice, gasLimit: 1000000 })) - // Log deployer LQTY bal and stake after staking - deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) - th.logBN("deployer LQTY bal after staking", deployerLQTYBal) - deployerLQTYStake = await LQTYContracts.lqtyStaking.stakes(deployerWallet.address) - th.logBN("deployer stake after staking", deployerLQTYStake) + // // Acct LQTY bal + // account2bal = await LQTYContracts.lqtyToken.balanceOf(account2Wallet.address) + // th.logBN("account2's LQTY bal after LC withdrawal attempt", account2bal) - // Log deployer rev share immediately after staking - let deployerLUSDRevShare = await LQTYContracts.lqtyStaking.getPendingLUSDGain(deployerWallet.address) - th.logBN("deployer pending LUSD revenue share", deployerLUSDRevShare) + // // Check LC bal + // account2LockupContractBal = await LQTYContracts.lqtyToken.balanceOf(account2LockupContract.address) + // th.logBN("account2's LC LQTY bal LC withdrawal attempt", account2LockupContractBal) + // // --- Stake LQTY --- + // console.log("CHECK DEPLOYER STAKING LQTY") + // // Log deployer LQTY bal and stake before staking + // deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) + // th.logBN("deployer LQTY bal before staking", deployerLQTYBal) + // let deployerLQTYStake = await LQTYContracts.lqtyStaking.stakes(deployerWallet.address) + // th.logBN("deployer stake before staking", deployerLQTYStake) - // --- 2nd Account opens trove --- - const trove2Status = await liquityCore.troveManager.getTroveStatus(account2Wallet.address) - if (trove2Status.toString() != '1') { - console.log("Acct 2 opens a trove ...") - let _2kLUSDWithdrawal = th.dec(2000, 18) // 2000 LUSD - let _1pt5_ETHcoll = th.dec(15, 17) // 1.5 ETH - const borrowerOpsEthersFactory = await ethers.getContractFactory("BorrowerOperations", account2Wallet) - const borrowerOpsAcct2 = await new ethers.Contract(liquityCore.borrowerOperations.address, borrowerOpsEthersFactory.interface, account2Wallet) + // // stake 13 LQTY + // await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyStaking.stake(dec(13, 18), { gasPrice, gasLimit: 1000000 })) - await mdh.sendAndWaitForTransaction(borrowerOpsAcct2.openTrove(th._100pct, _2kLUSDWithdrawal, th.ZERO_ADDRESS, th.ZERO_ADDRESS, { value: _1pt5_ETHcoll, gasPrice, gasLimit: 1000000 })) - } else { - console.log('Acct 2 already has an active trove') - } + // // Log deployer LQTY bal and stake after staking + // deployerLQTYBal = await LQTYContracts.lqtyToken.balanceOf(deployerWallet.address) + // th.logBN("deployer LQTY bal after staking", deployerLQTYBal) + // deployerLQTYStake = await LQTYContracts.lqtyStaking.stakes(deployerWallet.address) + // th.logBN("deployer stake after staking", deployerLQTYStake) + + // // Log deployer rev share immediately after staking + // let deployerLUSDRevShare = await LQTYContracts.lqtyStaking.getPendingLUSDGain(deployerWallet.address) + // th.logBN("deployer pending LUSD revenue share", deployerLUSDRevShare) + + + + // // --- 2nd Account opens trove --- + // const trove2Status = await liquityCore.troveManager.getTroveStatus(account2Wallet.address) + // if (trove2Status.toString() != '1') { + // console.log("Acct 2 opens a trove ...") + // let _2kLUSDWithdrawal = th.dec(2000, 18) // 2000 LUSD + // let _1pt5_ETHcoll = th.dec(15, 17) // 1.5 ETH + // const borrowerOpsEthersFactory = await ethers.getContractFactory("BorrowerOperations", account2Wallet) + // const borrowerOpsAcct2 = await new ethers.Contract(liquityCore.borrowerOperations.address, borrowerOpsEthersFactory.interface, account2Wallet) + + // await mdh.sendAndWaitForTransaction(borrowerOpsAcct2.openTrove(th._100pct, _2kLUSDWithdrawal, th.ZERO_ADDRESS, th.ZERO_ADDRESS, { value: _1pt5_ETHcoll, gasPrice, gasLimit: 1000000 })) + // } else { + // console.log('Acct 2 already has an active trove') + // } - const acct2Trove = await liquityCore.troveManager.Troves(account2Wallet.address) - th.logBN('acct2 debt', acct2Trove[0]) - th.logBN('acct2 coll', acct2Trove[1]) - th.logBN('acct2 stake', acct2Trove[2]) - console.log(`acct2 trove status: ${acct2Trove[3]}`) + // const acct2Trove = await liquityCore.troveManager.Troves(account2Wallet.address) + // th.logBN('acct2 debt', acct2Trove[0]) + // th.logBN('acct2 coll', acct2Trove[1]) + // th.logBN('acct2 stake', acct2Trove[2]) + // console.log(`acct2 trove status: ${acct2Trove[3]}`) - // Log deployer's pending LUSD gain - check fees went to staker (deloyer) - deployerLUSDRevShare = await LQTYContracts.lqtyStaking.getPendingLUSDGain(deployerWallet.address) - th.logBN("deployer pending LUSD revenue share from staking, after acct 2 opened trove", deployerLUSDRevShare) + // // Log deployer's pending LUSD gain - check fees went to staker (deloyer) + // deployerLUSDRevShare = await LQTYContracts.lqtyStaking.getPendingLUSDGain(deployerWallet.address) + // th.logBN("deployer pending LUSD revenue share from staking, after acct 2 opened trove", deployerLUSDRevShare) - // --- deployer withdraws staking gains --- - console.log("CHECK DEPLOYER WITHDRAWING STAKING GAINS") + // // --- deployer withdraws staking gains --- + // console.log("CHECK DEPLOYER WITHDRAWING STAKING GAINS") - // check deployer's LUSD balance before withdrawing staking gains - deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) - th.logBN('deployer LUSD bal before withdrawing staking gains', deployerLUSDBal) + // // check deployer's LUSD balance before withdrawing staking gains + // deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) + // th.logBN('deployer LUSD bal before withdrawing staking gains', deployerLUSDBal) - // Deployer withdraws staking gains - await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyStaking.unstake(0, { gasPrice, gasLimit: 1000000 })) + // // Deployer withdraws staking gains + // await mdh.sendAndWaitForTransaction(LQTYContracts.lqtyStaking.unstake(0, { gasPrice, gasLimit: 1000000 })) - // check deployer's LUSD balance after withdrawing staking gains - deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) - th.logBN('deployer LUSD bal after withdrawing staking gains', deployerLUSDBal) + // // check deployer's LUSD balance after withdrawing staking gains + // deployerLUSDBal = await liquityCore.lusdToken.balanceOf(deployerWallet.address) + // th.logBN('deployer LUSD bal after withdrawing staking gains', deployerLUSDBal) - // --- System stats --- + // // --- System stats --- // Uniswap LUSD-ETH pool size reserves = await LUSDETHPair.getReserves() @@ -527,6 +537,10 @@ async function mainnetDeploy(configParams) { const entireSystemColl = await liquityCore.troveManager.getEntireSystemColl() th.logBN("Entire system debt", entireSystemDebt) th.logBN("Entire system coll", entireSystemColl) + + // TCR + const TCR = await liquityCore.troveManager.getTCR(chainlinkPrice) + console.log(`TCR: ${TCR}`) // current borrowing rate const baseRate = await liquityCore.troveManager.baseRate() diff --git a/packages/contracts/mainnetDeployment/output3.txt b/packages/contracts/mainnetDeployment/output3.txt new file mode 100644 index 000000000..49316bff6 --- /dev/null +++ b/packages/contracts/mainnetDeployment/output3.txt @@ -0,0 +1,120 @@ +Mon, 05 Apr 2021 09:20:50 GMT +Loading previous deployment... +deployer address: 0xa850535D3628CD4dFEB528dC85cfA93051Ff2984 +deployerETHBalance before: 5088866300000000000 +Uniswp addr: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f +Uniswap Factory number of pairs: 32197 +deployer's ETH balance before deployments: 5088866300000000000 +Using previously deployed priceFeed contract at address 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +Using previously deployed sortedTroves contract at address 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +Using previously deployed troveManager contract at address 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +Using previously deployed activePool contract at address 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +Using previously deployed stabilityPool contract at address 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +Using previously deployed gasPool contract at address 0x9555b042F969E561855e5F28cB1230819149A8d9 +Using previously deployed defaultPool contract at address 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +Using previously deployed collSurplusPool contract at address 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +Using previously deployed borrowerOperations contract at address 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +Using previously deployed hintHelpers contract at address 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +Using previously deployed tellorCaller contract at address 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed lusdToken contract at address 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +No Etherscan Url defined, skipping verification +Contract objects addresses: +priceFeed: 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +lusdToken: 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +sortedTroves: 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +troveManager: 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +activePool: 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +stabilityPool: 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +gasPool: 0x9555b042F969E561855e5F28cB1230819149A8d9 +defaultPool: 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +collSurplusPool: 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +borrowerOperations: 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +hintHelpers: 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +tellorCaller: 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed unipool contract at address 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +No Etherscan Url defined, skipping verification +Using previously deployed lqtyStaking contract at address 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +Using previously deployed lockupContractFactory contract at address 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +Using previously deployed communityIssuance contract at address 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +Using previously deployed lqtyToken contract at address 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +No Etherscan Url defined, skipping verification +Using previously deployed multiTroveGetter contract at address 0xFc92d0E9Fa35df17E3A6d9F40716ca2cE749922B +No Etherscan Url defined, skipping verification +Contract objects addresses: +lqtyStaking: 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +lockupContractFactory: 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +communityIssuance: 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +lqtyToken: 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +Unipool address: 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +time now: 1617614445 +time oneYearFromNow: 1649150445 +Using previously deployed ACCOUNT_2 lockup contract at address 0xb69e194239169767494c432dD0826ca5c3b1d310 +Using previously deployed ACCOUNT_3 lockup contract at address 0x015f2eB03910dFE31a013f3Bd074daea1DA5Cabf +current Chainlink price: 202834515285 +current Tellor price: 2024450000 +current Tellor timestamp: 1617613316 +LOCKUP CONTRACT CHECKS +lockupContract addr: 0xb69e...d310, + beneficiary: ACCOUNT_2, + beneficiary addr: 0x4BDe...e46c, + on-chain beneficiary addr: 0x4BDe...e46c + unlockTime: 1649148442 + +lockupContract addr: 0x015f...Cabf, + beneficiary: ACCOUNT_3, + beneficiary addr: 0x7AdD...FD6F, + on-chain beneficiary addr: 0x7AdD...FD6F + unlockTime: 1649148442 + +STORED ADDRESSES IN LQTY TOKEN +multi-sig address stored in LQTYToken : 0xb8a9...Ca1C +LQTY Safe address: 0xb8a9...Ca1C +INITIAL LQTY BALANCES +Unipool LQTY balance : 1333333.333333333333333333 +LQTY Safe balance : 64666666.666666666666666667 +General Safe balance : 2000000.000000000000000000 +Community Issuance balance: 31999873.402199592704000000 +PRICEFEED CHECKS +PriceFeed first stored price: 2028.345152850000000000 +PriceFeed initial status: 0 +Unipool's stored LUSD-ETH Uniswap Pair address: 0xF20EF17b889b437C151eB5bA15A47bFc62bfF469 +SYSTEM GLOBAL VARS CHECKS +system liquidation reserve: 200.000000000000000000 +system min net debt : 1800.000000000000000000 +Deployer already has an active trove +deployer is in sorted list after making trove: true +deployer debt: 3215.000000000000000000 +deployer coll: 3.000000000000000000 +deployer stake: 3.000000000000000000 +deployer's trove status: 1 +deployer's LUSD balance: 988.098905929999999990 +LUSD-ETH Pair token 0: 0x5f98...8bA0, + LUSDToken contract addr: 0x5f98...8bA0 +LUSD-ETH Pair token 1: 0xC02a...6Cc2, + WETH ERC20 contract addr: 0xc02a...6cc2 +LUSD-ETH Pair's LUSD reserves before provision: 2021.901094070000000000 +LUSD-ETH Pair's ETH reserves before provision: 1.000000000000000000 +Liquidity already provided to Uniswap +LUSD-ETH Pair's LUSD reserves after provision: 2021.901094070000000000 +LUSD-ETH Pair's ETH reserves after provision: 1.000000000000000000 +CHECK LP STAKING EARNS LQTY +deployer's LP token balance: 44.965554528661157277 +LUSDETHPair addr: 0xF20EF17b889b437C151eB5bA15A47bFc62bfF469 +Pair addr stored in Unipool: 0xF20EF17b889b437C151eB5bA15A47bFc62bfF469 +deployer's farmed LQTY before staking LP tokens: 541.593180482069370908 +Already staked in Unipool +wait 90 seconds before checking earnings... +deployer's farmed LQTY from Unipool after waiting ~1.5mins: 570.987654320987654268 +deployer LQTY Balance Before SP deposit: 103.597800407296000000 +CHECK DEPLOYER MAKING DEPOSIT AND EARNING LQTY +deployer SP deposit before making deposit: .000000000000000000 +deployer SP deposit after depositing 15 LUSD: 15.000000000000000000 +wait 90 seconds before withdrawing... +CHECK BENEFICIARY ATTEMPTING WITHDRAWAL FROM LC +account2 LQTY bal before withdrawal attempt: .000000000000000000 +account2's LC LQTY bal before withdrawal attempt: 20.000000000000000000 +account2's LQTY bal after LC withdrawal attempt: .000000000000000000 +account2's LC LQTY bal LC withdrawal attempt: 20.000000000000000000 +CHECK DEPLOYER STAKING LQTY +deployer LQTY bal before staking: 93.597800407296000000 +deployer stake before staking: 13.000000000000000000 diff --git a/packages/contracts/mainnetDeployment/output4.txt b/packages/contracts/mainnetDeployment/output4.txt new file mode 100644 index 000000000..aa0500d23 --- /dev/null +++ b/packages/contracts/mainnetDeployment/output4.txt @@ -0,0 +1,54 @@ +Mon, 05 Apr 2021 09:36:04 GMT +Loading previous deployment... +deployer address: 0xa850535D3628CD4dFEB528dC85cfA93051Ff2984 +deployerETHBalance before: 5010833150000000000 +Uniswp addr: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f +Uniswap Factory number of pairs: 32197 +deployer's ETH balance before deployments: 5010833150000000000 +Using previously deployed priceFeed contract at address 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +Using previously deployed sortedTroves contract at address 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +Using previously deployed troveManager contract at address 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +Using previously deployed activePool contract at address 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +Using previously deployed stabilityPool contract at address 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +Using previously deployed gasPool contract at address 0x9555b042F969E561855e5F28cB1230819149A8d9 +Using previously deployed defaultPool contract at address 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +Using previously deployed collSurplusPool contract at address 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +Using previously deployed borrowerOperations contract at address 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +Using previously deployed hintHelpers contract at address 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +Using previously deployed tellorCaller contract at address 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed lusdToken contract at address 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +No Etherscan Url defined, skipping verification +Contract objects addresses: +priceFeed: 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +lusdToken: 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +sortedTroves: 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +troveManager: 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +activePool: 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +stabilityPool: 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +gasPool: 0x9555b042F969E561855e5F28cB1230819149A8d9 +defaultPool: 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +collSurplusPool: 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +borrowerOperations: 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +hintHelpers: 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +tellorCaller: 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed unipool contract at address 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +No Etherscan Url defined, skipping verification +Using previously deployed lqtyStaking contract at address 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +Using previously deployed lockupContractFactory contract at address 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +Using previously deployed communityIssuance contract at address 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +Using previously deployed lqtyToken contract at address 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +No Etherscan Url defined, skipping verification +Using previously deployed multiTroveGetter contract at address 0xFc92d0E9Fa35df17E3A6d9F40716ca2cE749922B +No Etherscan Url defined, skipping verification +Contract objects addresses: +lqtyStaking: 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +lockupContractFactory: 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +communityIssuance: 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +lqtyToken: 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +Unipool address: 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +time now: 1617615353 +time oneYearFromNow: 1649151353 +Using previously deployed ACCOUNT_2 lockup contract at address 0xb69e194239169767494c432dD0826ca5c3b1d310 +Using previously deployed ACCOUNT_3 lockup contract at address 0x015f2eB03910dFE31a013f3Bd074daea1DA5Cabf +deployer trove debt before repaying: 3215000000000000000000 +deployer trove debt after repaying: 3215000000000000000000 diff --git a/packages/contracts/mainnetDeployment/output5.txt b/packages/contracts/mainnetDeployment/output5.txt new file mode 100644 index 000000000..38e376011 --- /dev/null +++ b/packages/contracts/mainnetDeployment/output5.txt @@ -0,0 +1,84 @@ +Mon, 05 Apr 2021 09:52:41 GMT +Loading previous deployment... +deployer address: 0xa850535D3628CD4dFEB528dC85cfA93051Ff2984 +deployerETHBalance before: 2935396650000000000 +Uniswp addr: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f +Uniswap Factory number of pairs: 32198 +deployer's ETH balance before deployments: 2935396650000000000 +Using previously deployed priceFeed contract at address 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +Using previously deployed sortedTroves contract at address 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +Using previously deployed troveManager contract at address 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +Using previously deployed activePool contract at address 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +Using previously deployed stabilityPool contract at address 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +Using previously deployed gasPool contract at address 0x9555b042F969E561855e5F28cB1230819149A8d9 +Using previously deployed defaultPool contract at address 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +Using previously deployed collSurplusPool contract at address 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +Using previously deployed borrowerOperations contract at address 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +Using previously deployed hintHelpers contract at address 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +Using previously deployed tellorCaller contract at address 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed lusdToken contract at address 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +No Etherscan Url defined, skipping verification +Contract objects addresses: +priceFeed: 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De +lusdToken: 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0 +sortedTroves: 0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6 +troveManager: 0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2 +activePool: 0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F +stabilityPool: 0x66017D22b0f8556afDd19FC67041899Eb65a21bb +gasPool: 0x9555b042F969E561855e5F28cB1230819149A8d9 +defaultPool: 0x896a3F03176f05CFbb4f006BfCd8723F2B0D741C +collSurplusPool: 0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521 +borrowerOperations: 0x24179CD81c9e782A4096035f7eC97fB8B783e007 +hintHelpers: 0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0 +tellorCaller: 0xAd430500ECDa11E38C9bCB08a702274b94641112 +Using previously deployed unipool contract at address 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +No Etherscan Url defined, skipping verification +Using previously deployed lqtyStaking contract at address 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +Using previously deployed lockupContractFactory contract at address 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +Using previously deployed communityIssuance contract at address 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +Using previously deployed lqtyToken contract at address 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +No Etherscan Url defined, skipping verification +Using previously deployed multiTroveGetter contract at address 0xFc92d0E9Fa35df17E3A6d9F40716ca2cE749922B +No Etherscan Url defined, skipping verification +Contract objects addresses: +lqtyStaking: 0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d +lockupContractFactory: 0x2eBeF24dA09489218Ba2BECb01867F6DaAeDcD4B +communityIssuance: 0xD8c9D9071123a059C6E0A945cF0e0c82b508d816 +lqtyToken: 0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D +Unipool address: 0xd37a77E71ddF3373a79BE2eBB76B6c4808bDF0d5 +time now: 1617616341 +time oneYearFromNow: 1649152341 +Using previously deployed ACCOUNT_2 lockup contract at address 0xb69e194239169767494c432dD0826ca5c3b1d310 +Using previously deployed ACCOUNT_3 lockup contract at address 0x015f2eB03910dFE31a013f3Bd074daea1DA5Cabf +current Chainlink price: 203578000000 +current Tellor price: 2024690000 +current Tellor timestamp: 1617614538 +LUSD-ETH Pair's current LUSD reserves: 2001.941734972325910671 +LUSD-ETH Pair's current ETH reserves: 1.010000000000000000 +number of troves: 2 +Trove list size: 2 +Entire system debt: 4625.000000000000000000 +Entire system coll: 6.500000000000000000 +TCR: 286109621 +Base rate: .000000000000000000 +Current borrowing rate: .005000000000000000 +Total LUSD SP deposits: 34.959359097674089329 +Total LQTY staked: 26.000000000000000000 +Total LP (LUSD-ETH) tokens staked in unipool: .000000000000000001 +TroveManager state variables: +Total trove stakes: 6.500000000000000000 +Snapshot of total trove stakes before last liq. : .000000000000000000 +Snapshot of total trove collateral before last liq. : .000000000000000000 +L_ETH: .000000000000000000 +L_LUSDDebt: .000000000000000000 +StabilityPool state variables: +Product P: 1.000000000000000000 +Current epoch: .000000000000000000 +Current scale: .000000000000000000 +Sum S, at current epoch and scale: .000000000000000000 +Sum G, at current epoch and scale: 28132143341608533333.000000000000000000 +LQTYStaking state variables: +F_LUSD: .769230769230769230 +F_ETH: .000000000000000000 +CommunityIssuance state variables: +Total LQTY issued to depositors / front ends: 2405.351864068448000000