Skip to content

Commit

Permalink
renaming LUSD to THUSD in js files
Browse files Browse the repository at this point in the history
  • Loading branch information
benlongstaff committed Aug 8, 2022
1 parent 3238a5b commit 5b06c74
Show file tree
Hide file tree
Showing 44 changed files with 4,695 additions and 4,900 deletions.
350 changes: 175 additions & 175 deletions packages/contracts/errorAccumulationTest/errorAccumulationTest.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions packages/contracts/fuzzTests/echidna_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { TestHelper: { dec } } = require("../utils/testHelpers.js")

const EchidnaTester = artifacts.require('EchidnaTester')
const TroveManager = artifacts.require('TroveManager')
const LUSDToken = artifacts.require('LUSDToken')
const THUSDToken = artifacts.require('THUSDToken')
const ActivePool = artifacts.require('ActivePool')
const DefaultPool = artifacts.require('DefaultPool')
const StabilityPool = artifacts.require('StabilityPool')
Expand All @@ -13,7 +13,7 @@ const StabilityPool = artifacts.require('StabilityPool')
contract('Echidna debugger', async accounts => {
let echidnaTester
let troveManager
let lusdToken
let thusdToken
let activePool
let defaultPool
let stabilityPool
Expand All @@ -22,7 +22,7 @@ contract('Echidna debugger', async accounts => {
before(async () => {
echidnaTester = await EchidnaTester.new({ value: dec(11, 25) })
troveManager = await TroveManager.at(await echidnaTester.troveManager())
lusdToken = await LUSDToken.at(await echidnaTester.lusdToken())
thusdToken = await THUSDToken.at(await echidnaTester.thusdToken())
activePool = await ActivePool.at(await echidnaTester.activePool())
defaultPool = await DefaultPool.at(await echidnaTester.defaultPool())
stabilityPool = await StabilityPool.at(await echidnaTester.stabilityPool())
Expand Down Expand Up @@ -65,16 +65,16 @@ contract('Echidna debugger', async accounts => {
console.log('Trove 2', icr2_after_price, icr2_after_price.toString())
})

it.only('LUSD balance', async () => {
it.only('THUSD balance', async () => {
await echidnaTester.openTroveExt('0', '0', '4210965169908805439447313562489173090')

const totalSupply = await lusdToken.totalSupply();
const gasPoolBalance = await lusdToken.balanceOf(GAS_POOL_ADDRESS);
const activePoolBalance = await activePool.getLUSDDebt();
const defaultPoolBalance = await defaultPool.getLUSDDebt();
const stabilityPoolBalance = await stabilityPool.getTotalLUSDDeposits();
const totalSupply = await thusdToken.totalSupply();
const gasPoolBalance = await thusdToken.balanceOf(GAS_POOL_ADDRESS);
const activePoolBalance = await activePool.getTHUSDDebt();
const defaultPoolBalance = await defaultPool.getTHUSDDebt();
const stabilityPoolBalance = await stabilityPool.getTotalTHUSDDeposits();
const currentTrove = await echidnaTester.echidnaProxies(0);
const troveBalance = lusdToken.balanceOf(currentTrove);
const troveBalance = thusdToken.balanceOf(currentTrove);

console.log('totalSupply', totalSupply.toString());
console.log('gasPoolBalance', gasPoolBalance.toString());
Expand Down
530 changes: 265 additions & 265 deletions packages/contracts/gasTest/gasCalc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contracts/gasTest/gasCalc_Math.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract('Gas costs for math functions', async accounts => {
contracts = await deploymentHelper.deployLiquityCore(accounts)

priceFeed = contracts.priceFeedTestnet
lusdToken = contracts.lusdToken
thusdToken = contracts.thusdToken
sortedTroves = contracts.sortedTroves
troveManager = contracts.troveManager
activePool = contracts.activePool
Expand Down
250 changes: 125 additions & 125 deletions packages/contracts/gasTest/gasCalc_liquidateTroves.js

Large diffs are not rendered by default.

518 changes: 259 additions & 259 deletions packages/contracts/gasTest/gasCalc_liquidateTroves_RecoveryMode.js

Large diffs are not rendered by default.

This file was deleted.

182 changes: 0 additions & 182 deletions packages/contracts/mainnetDeployment/balancerPoolDeployment.js

This file was deleted.

46 changes: 23 additions & 23 deletions packages/contracts/mainnetDeployment/mainnetDeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ async function mainnetDeploy(configParams) {

// // --- TESTS AND CHECKS ---

// Deployer repay LUSD
// Deployer repay THUSD
// console.log(`deployer trove debt before repaying: ${await contracts.troveManager.getTroveDebt(deployerWallet.address)}`)
// await mdh.sendAndWaitForTransaction(contracts.borrowerOperations.repayLUSD(dec(800, 18), th.ZERO_ADDRESS, th.ZERO_ADDRESS, {gasPrice, gasLimit: 1000000}))
// await mdh.sendAndWaitForTransaction(contracts.borrowerOperations.repayTHUSD(dec(800, 18), th.ZERO_ADDRESS, th.ZERO_ADDRESS, {gasPrice, gasLimit: 1000000}))
// console.log(`deployer trove debt after repaying: ${await contracts.troveManager.getTroveDebt(deployerWallet.address)}`)

// Deployer add coll
Expand Down Expand Up @@ -89,24 +89,24 @@ async function mainnetDeploy(configParams) {

// // --- TroveManager ---

// const liqReserve = await contracts.troveManager.LUSD_GAS_COMPENSATION()
// const liqReserve = await contracts.troveManager.THUSD_GAS_COMPENSATION()
// const minNetDebt = await contracts.troveManager.MIN_NET_DEBT()

// th.logBN('system liquidation reserve', liqReserve)
// th.logBN('system min net debt ', minNetDebt)

// // --- Make first LUSD-ETH liquidity provision ---
// // --- Make first THUSD-ETH liquidity provision ---

// // Open trove if not yet opened
// const troveStatus = await contracts.troveManager.getTroveStatus(deployerWallet.address)
// if (troveStatus.toString() != '1') {
// let _3kLUSDWithdrawal = th.dec(3000, 18) // 3000 LUSD
// let _3kTHUSDWithdrawal = th.dec(3000, 18) // 3000 THUSD
// let _3ETHcoll = th.dec(3, 'ether') // 3 ETH
// console.log('Opening trove...')
// await mdh.sendAndWaitForTransaction(
// contracts.borrowerOperations.openTrove(
// th._100pct,
// _3kLUSDWithdrawal,
// _3kTHUSDWithdrawal,
// th.ZERO_ADDRESS,
// th.ZERO_ADDRESS,
// { value: _3ETHcoll, gasPrice }
Expand All @@ -125,20 +125,20 @@ async function mainnetDeploy(configParams) {
// th.logBN('deployer stake', deployerTrove[2])
// console.log(`deployer's trove status: ${deployerTrove[3]}`)

// // Check deployer has LUSD
// let deployerLUSDBal = await contracts.lusdToken.balanceOf(deployerWallet.address)
// th.logBN("deployer's LUSD balance", deployerLUSDBal)
// // Check deployer has THUSD
// let deployerTHUSDBal = await contracts.thusdToken.balanceOf(deployerWallet.address)
// th.logBN("deployer's THUSD balance", deployerTHUSDBal)

// // --- 2nd Account opens trove ---
// const trove2Status = await contracts.troveManager.getTroveStatus(account2Wallet.address)
// if (trove2Status.toString() != '1') {
// console.log("Acct 2 opens a trove ...")
// let _2kLUSDWithdrawal = th.dec(2000, 18) // 2000 LUSD
// let _2kTHUSDWithdrawal = th.dec(2000, 18) // 2000 THUSD
// let _1pt5_ETHcoll = th.dec(15, 17) // 1.5 ETH
// const borrowerOpsEthersFactory = await ethers.getContractFactory("BorrowerOperations", account2Wallet)
// const borrowerOpsAcct2 = await new ethers.Contract(contracts.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 }))
// await mdh.sendAndWaitForTransaction(borrowerOpsAcct2.openTrove(th._100pct, _2kTHUSDWithdrawal, th.ZERO_ADDRESS, th.ZERO_ADDRESS, { value: _1pt5_ETHcoll, gasPrice, gasLimit: 1000000 }))
// } else {
// console.log('Acct 2 already has an active trove')
// }
Expand All @@ -152,13 +152,13 @@ async function mainnetDeploy(configParams) {
// // --- deployer withdraws staking gains ---
// console.log("CHECK DEPLOYER WITHDRAWING STAKING GAINS")

// // check deployer's LUSD balance before withdrawing staking gains
// deployerLUSDBal = await contracts.lusdToken.balanceOf(deployerWallet.address)
// th.logBN('deployer LUSD bal before withdrawing staking gains', deployerLUSDBal)
// // check deployer's THUSD balance before withdrawing staking gains
// deployerTHUSDBal = await contracts.thusdToken.balanceOf(deployerWallet.address)
// th.logBN('deployer THUSD bal before withdrawing staking gains', deployerTHUSDBal)

// // check deployer's LUSD balance after withdrawing staking gains
// deployerLUSDBal = await contracts.lusdToken.balanceOf(deployerWallet.address)
// th.logBN('deployer LUSD bal after withdrawing staking gains', deployerLUSDBal)
// // check deployer's THUSD balance after withdrawing staking gains
// deployerTHUSDBal = await contracts.thusdToken.balanceOf(deployerWallet.address)
// th.logBN('deployer THUSD bal after withdrawing staking gains', deployerTHUSDBal)


// // --- System stats ---
Expand Down Expand Up @@ -187,8 +187,8 @@ async function mainnetDeploy(configParams) {
th.logBN("Current borrowing rate", currentBorrowingRate)

// total SP deposits
const totalSPDeposits = await contracts.stabilityPool.getTotalLUSDDeposits()
th.logBN("Total LUSD SP deposits", totalSPDeposits)
const totalSPDeposits = await contracts.stabilityPool.getTotalTHUSDDeposits()
th.logBN("Total THUSD SP deposits", totalSPDeposits)

// --- State variables ---

Expand All @@ -202,9 +202,9 @@ async function mainnetDeploy(configParams) {
th.logBN("Snapshot of total trove collateral before last liq. ", totalCollateralSnapshot)

const L_ETH = await contracts.troveManager.L_ETH()
const L_LUSDDebt = await contracts.troveManager.L_LUSDDebt()
const L_THUSDDebt = await contracts.troveManager.L_THUSDDebt()
th.logBN("L_ETH", L_ETH)
th.logBN("L_LUSDDebt", L_LUSDDebt)
th.logBN("L_THUSDDebt", L_THUSDDebt)

// StabilityPool
console.log("StabilityPool state variables:")
Expand All @@ -219,9 +219,9 @@ async function mainnetDeploy(configParams) {

// PCV
console.log("PCV state variables:")
const F_LUSD = await contracts.pcv.F_LUSD()
const F_THUSD = await contracts.pcv.F_THUSD()
const F_ETH = await contracts.pcv.F_ETH()
th.logBN("F_LUSD", F_LUSD)
th.logBN("F_THUSD", F_THUSD)
th.logBN("F_ETH", F_ETH)

}
Expand Down
Loading

0 comments on commit 5b06c74

Please sign in to comment.