From 65ca57754e5f4c76a2cd660d2a99a280192a6bb7 Mon Sep 17 00:00:00 2001 From: Pierre Bertet Date: Mon, 16 Sep 2024 11:22:36 +0100 Subject: [PATCH] App: update ABIs --- frontend/app/src/abi/ActivePool.ts | 95 ++- frontend/app/src/abi/BorrowerOperations.ts | 288 +++++--- frontend/app/src/abi/CollSurplusPool.ts | 45 +- frontend/app/src/abi/CollateralRegistry.ts | 34 +- frontend/app/src/abi/DefaultPool.ts | 39 +- frontend/app/src/abi/GasPool.ts | 6 +- frontend/app/src/abi/HintHelpers.ts | 60 ++ frontend/app/src/abi/MultiTroveGetter.ts | 24 +- frontend/app/src/abi/PriceFeed.ts | 8 +- frontend/app/src/abi/SortedTroves.ts | 36 +- frontend/app/src/abi/StabilityPool.ts | 83 +-- frontend/app/src/abi/TroveManager.ts | 732 ++++++++------------- 12 files changed, 647 insertions(+), 803 deletions(-) diff --git a/frontend/app/src/abi/ActivePool.ts b/frontend/app/src/abi/ActivePool.ts index 90fb1f7b..a19614d0 100644 --- a/frontend/app/src/abi/ActivePool.ts +++ b/frontend/app/src/abi/ActivePool.ts @@ -3,7 +3,7 @@ export const ActivePool = [ { "type": "constructor", - "inputs": [{ "name": "_collAddress", "type": "address", "internalType": "address" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { @@ -20,6 +20,13 @@ export const ActivePool = [ "outputs": [], "stateMutability": "nonpayable", }, + { + "type": "function", + "name": "aggBatchManagementFees", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", + }, { "type": "function", "name": "aggRecordedDebt", @@ -27,6 +34,13 @@ export const ActivePool = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, + { + "type": "function", + "name": "aggWeightedBatchManagementFeeSum", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", + }, { "type": "function", "name": "aggWeightedDebtSum", @@ -41,6 +55,13 @@ export const ActivePool = [ "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view", }, + { + "type": "function", + "name": "calcPendingAggBatchManagementFee", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", + }, { "type": "function", "name": "calcPendingAggInterest", @@ -100,6 +121,9 @@ export const ActivePool = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], @@ -121,9 +145,9 @@ export const ActivePool = [ }, { "type": "function", - "name": "isOwner", + "name": "lastAggBatchManagementFeesUpdateTime", "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, { @@ -151,17 +175,38 @@ export const ActivePool = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], - }], + }, { "name": "_batchAddress", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable", }, { "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", + "name": "mintBatchManagementFeeAndAccountForChange", + "inputs": [{ + "name": "_troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, { "name": "_batchAddress", "type": "address", "internalType": "address" }], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", @@ -188,21 +233,14 @@ export const ActivePool = [ "outputs": [], "stateMutability": "nonpayable", }, + { "type": "function", "name": "setShutdownFlag", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", - "name": "setAddresses", - "inputs": [ - { "name": "_borrowerOperationsAddress", "type": "address", "internalType": "address" }, - { "name": "_troveManagerAddress", "type": "address", "internalType": "address" }, - { "name": "_stabilityPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_defaultPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_boldTokenAddress", "type": "address", "internalType": "address" }, - { "name": "_interestRouterAddress", "type": "address", "internalType": "address" }, - ], - "outputs": [], - "stateMutability": "nonpayable", + "name": "shutdownTime", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }, - { "type": "function", "name": "setShutdownFlag", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "stabilityPool", @@ -240,6 +278,12 @@ export const ActivePool = [ }], "anonymous": false, }, + { + "type": "event", + "name": "CollTokenAddressChanged", + "inputs": [{ "name": "_newCollTokenAddress", "type": "address", "indexed": false, "internalType": "address" }], + "anonymous": false, + }, { "type": "event", "name": "DefaultPoolAddressChanged", @@ -257,17 +301,6 @@ export const ActivePool = [ }], "anonymous": false, }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, - }, { "type": "event", "name": "StabilityPoolAddressChanged", diff --git a/frontend/app/src/abi/BorrowerOperations.ts b/frontend/app/src/abi/BorrowerOperations.ts index 3e344306..024aeed5 100644 --- a/frontend/app/src/abi/BorrowerOperations.ts +++ b/frontend/app/src/abi/BorrowerOperations.ts @@ -3,11 +3,7 @@ export const BorrowerOperations = [ { "type": "constructor", - "inputs": [{ "name": "_collToken", "type": "address", "internalType": "contract IERC20" }, { - "name": "_troveManager", - "type": "address", - "internalType": "contract ITroveManager", - }, { "name": "_weth", "type": "address", "internalType": "contract IWETH" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { @@ -24,13 +20,6 @@ export const BorrowerOperations = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "NAME", - "inputs": [], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, { "type": "function", "name": "SCR", @@ -38,13 +27,6 @@ export const BorrowerOperations = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "WETH", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IWETH" }], - "stateMutability": "view", - }, { "type": "function", "name": "activePool", @@ -115,7 +97,7 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "applyTroveInterestPermissionless", + "name": "applyPendingDebt", "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }, { "name": "_lowerHint", "type": "uint256", @@ -126,9 +108,9 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "boldToken", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IBoldToken" }], + "name": "checkBatchManagerExists", + "inputs": [{ "name": "_batchManager", "type": "address", "internalType": "address" }], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view", }, { "type": "function", "name": "claimCollateral", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, @@ -136,35 +118,53 @@ export const BorrowerOperations = [ "type": "function", "name": "closeTrove", "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [], "stateMutability": "nonpayable", }, { "type": "function", - "name": "collToken", + "name": "getEntireSystemColl", "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20" }], + "outputs": [{ "name": "entireSystemColl", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, { "type": "function", - "name": "defaultPool", + "name": "getEntireSystemDebt", "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IDefaultPool" }], + "outputs": [{ "name": "entireSystemDebt", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, { "type": "function", - "name": "getEntireSystemColl", - "inputs": [], - "outputs": [{ "name": "entireSystemColl", "type": "uint256", "internalType": "uint256" }], + "name": "getInterestBatchManager", + "inputs": [{ "name": "_account", "type": "address", "internalType": "address" }], + "outputs": [{ + "name": "", + "type": "tuple", + "internalType": "struct IBorrowerOperations.InterestBatchManager", + "components": [{ "name": "minInterestRate", "type": "uint128", "internalType": "uint128" }, { + "name": "maxInterestRate", + "type": "uint128", + "internalType": "uint128", + }, { "name": "minInterestRateChangePeriod", "type": "uint256", "internalType": "uint256" }], + }], "stateMutability": "view", }, { "type": "function", - "name": "getEntireSystemDebt", - "inputs": [], - "outputs": [{ "name": "entireSystemDebt", "type": "uint256", "internalType": "uint256" }], + "name": "getInterestIndividualDelegateOf", + "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ + "name": "", + "type": "tuple", + "internalType": "struct IBorrowerOperations.InterestIndividualDelegate", + "components": [{ "name": "account", "type": "address", "internalType": "address" }, { + "name": "minInterestRate", + "type": "uint128", + "internalType": "uint128", + }, { "name": "maxInterestRate", "type": "uint128", "internalType": "uint128" }], + }], "stateMutability": "view", }, { @@ -176,25 +176,23 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "isOwner", - "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], + "name": "interestBatchManagerOf", + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view", }, { "type": "function", - "name": "openTrove", - "inputs": [ - { "name": "_owner", "type": "address", "internalType": "address" }, - { "name": "_ownerIndex", "type": "uint256", "internalType": "uint256" }, - { "name": "_collAmount", "type": "uint256", "internalType": "uint256" }, - { "name": "_boldAmount", "type": "uint256", "internalType": "uint256" }, - { "name": "_upperHint", "type": "uint256", "internalType": "uint256" }, - { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }, - { "name": "_annualInterestRate", "type": "uint256", "internalType": "uint256" }, - { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, - ], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "name": "lowerBatchManagementFee", + "inputs": [{ "name": "_newAnnualManagementFee", "type": "uint256", "internalType": "uint256" }], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "onLiquidateTrove", + "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], + "outputs": [], "stateMutability": "nonpayable", }, { @@ -218,27 +216,70 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", + "name": "openTroveAndJoinInterestBatchManager", + "inputs": [{ + "name": "_params", + "type": "tuple", + "internalType": "struct IBorrowerOperations.OpenTroveAndJoinInterestBatchManagerParams", + "components": [ + { "name": "owner", "type": "address", "internalType": "address" }, + { "name": "ownerIndex", "type": "uint256", "internalType": "uint256" }, + { "name": "collAmount", "type": "uint256", "internalType": "uint256" }, + { "name": "boldAmount", "type": "uint256", "internalType": "uint256" }, + { "name": "upperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "lowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "interestBatchManager", "type": "address", "internalType": "address" }, + { "name": "maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "addManager", "type": "address", "internalType": "address" }, + { "name": "removeManager", "type": "address", "internalType": "address" }, + { "name": "receiver", "type": "address", "internalType": "address" }, + ], + }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "nonpayable", }, { "type": "function", - "name": "priceFeed", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IPriceFeed" }], - "stateMutability": "view", + "name": "registerBatchManager", + "inputs": [ + { "name": "_minInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_maxInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_currentInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_annualManagementFee", "type": "uint128", "internalType": "uint128" }, + { "name": "_minInterestRateChangePeriod", "type": "uint128", "internalType": "uint128" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "removeFromBatch", + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_newAnnualInterestRate", "type": "uint256", "internalType": "uint256" }, + { "name": "_upperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "removeInterestIndividualDelegate", + "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", "name": "removeManagerReceiverOf", - "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }, { - "name": "", + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "manager", "type": "address", "internalType": "address" }, { + "name": "receiver", "type": "address", "internalType": "address", }], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view", }, { @@ -265,15 +306,41 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "setAddresses", + "name": "setBatchManagerAnnualInterestRate", + "inputs": [ + { "name": "_newAnnualInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_upperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "setInterestBatchManager", + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchManager", "type": "address", "internalType": "address" }, + { "name": "_upperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "setInterestIndividualDelegate", "inputs": [ - { "name": "_activePoolAddress", "type": "address", "internalType": "address" }, - { "name": "_defaultPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_gasPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_collSurplusPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_priceFeedAddress", "type": "address", "internalType": "address" }, - { "name": "_sortedTrovesAddress", "type": "address", "internalType": "address" }, - { "name": "_boldTokenAddress", "type": "address", "internalType": "address" }, + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_delegate", "type": "address", "internalType": "address" }, + { "name": "_minInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_maxInterestRate", "type": "uint128", "internalType": "uint128" }, + { "name": "_newAnnualInterestRate", "type": "uint256", "internalType": "uint256" }, + { "name": "_upperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, ], "outputs": [], "stateMutability": "nonpayable", @@ -291,7 +358,7 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "setRemoveManager", + "name": "setRemoveManagerWithReceiver", "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }, { "name": "_manager", "type": "address", @@ -310,17 +377,18 @@ export const BorrowerOperations = [ }, { "type": "function", - "name": "sortedTroves", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract ISortedTroves" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "troveManager", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract ITroveManager" }], - "stateMutability": "view", + "name": "switchBatchManager", + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_removeUpperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_removeLowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchManager", "type": "address", "internalType": "address" }, + { "name": "_addUpperHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_addLowerHint", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxUpfrontFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", @@ -347,7 +415,7 @@ export const BorrowerOperations = [ { "type": "event", "name": "ActivePoolAddressChanged", - "inputs": [{ "name": "_activePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], + "inputs": [{ "name": "_newActivePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, { @@ -365,7 +433,7 @@ export const BorrowerOperations = [ { "type": "event", "name": "DefaultPoolAddressChanged", - "inputs": [{ "name": "_defaultPoolAddress", "type": "address", "indexed": false, "internalType": "address" }], + "inputs": [{ "name": "_newDefaultPoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, { @@ -374,17 +442,6 @@ export const BorrowerOperations = [ "inputs": [{ "name": "_gasPoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, - }, { "type": "event", "name": "PriceFeedAddressChanged", @@ -415,4 +472,49 @@ export const BorrowerOperations = [ "inputs": [{ "name": "_newTroveManagerAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, + { + "type": "event", + "name": "TroveNFTAddressChanged", + "inputs": [{ "name": "_newTroveNFTAddress", "type": "address", "indexed": false, "internalType": "address" }], + "anonymous": false, + }, + { "type": "error", "name": "AnnualManagementFeeTooHigh", "inputs": [] }, + { "type": "error", "name": "BatchInterestRateChangePeriodNotPassed", "inputs": [] }, + { "type": "error", "name": "BatchManagerExists", "inputs": [] }, + { "type": "error", "name": "BatchManagerNotNew", "inputs": [] }, + { "type": "error", "name": "BelowCriticalThreshold", "inputs": [] }, + { "type": "error", "name": "BorrowingNotPermittedBelowCT", "inputs": [] }, + { "type": "error", "name": "CallerNotPriceFeed", "inputs": [] }, + { "type": "error", "name": "CallerNotTroveManager", "inputs": [] }, + { "type": "error", "name": "CollWithdrawalTooHigh", "inputs": [] }, + { "type": "error", "name": "DebtBelowMin", "inputs": [] }, + { "type": "error", "name": "EmptyManager", "inputs": [] }, + { "type": "error", "name": "ICRBelowMCR", "inputs": [] }, + { "type": "error", "name": "InterestNotInRange", "inputs": [] }, + { "type": "error", "name": "InterestRateNotNew", "inputs": [] }, + { "type": "error", "name": "InterestRateTooHigh", "inputs": [] }, + { "type": "error", "name": "InterestRateTooLow", "inputs": [] }, + { "type": "error", "name": "InvalidInterestBatchManager", "inputs": [] }, + { "type": "error", "name": "IsShutDown", "inputs": [] }, + { "type": "error", "name": "MinGeMax", "inputs": [] }, + { "type": "error", "name": "MinInterestRateChangePeriodTooLow", "inputs": [] }, + { "type": "error", "name": "NewFeeNotLower", "inputs": [] }, + { "type": "error", "name": "NewOracleFailureDetected", "inputs": [] }, + { "type": "error", "name": "NotBorrower", "inputs": [] }, + { "type": "error", "name": "NotEnoughBoldBalance", "inputs": [] }, + { "type": "error", "name": "NotOwnerNorAddManager", "inputs": [] }, + { "type": "error", "name": "NotOwnerNorInterestManager", "inputs": [] }, + { "type": "error", "name": "NotOwnerNorRemoveManager", "inputs": [] }, + { "type": "error", "name": "NotShutDown", "inputs": [] }, + { "type": "error", "name": "RepaymentNotMatchingCollWithdrawal", "inputs": [] }, + { "type": "error", "name": "TCRBelowCCR", "inputs": [] }, + { "type": "error", "name": "TCRNotBelowSCR", "inputs": [] }, + { "type": "error", "name": "TroveInBatch", "inputs": [] }, + { "type": "error", "name": "TroveNotActive", "inputs": [] }, + { "type": "error", "name": "TroveNotInBatch", "inputs": [] }, + { "type": "error", "name": "TroveNotOpen", "inputs": [] }, + { "type": "error", "name": "TroveNotUnredeemable", "inputs": [] }, + { "type": "error", "name": "TroveOpen", "inputs": [] }, + { "type": "error", "name": "UpfrontFeeTooHigh", "inputs": [] }, + { "type": "error", "name": "ZeroAdjustment", "inputs": [] }, ] as const; diff --git a/frontend/app/src/abi/CollSurplusPool.ts b/frontend/app/src/abi/CollSurplusPool.ts index 6e18a7b5..8722915c 100644 --- a/frontend/app/src/abi/CollSurplusPool.ts +++ b/frontend/app/src/abi/CollSurplusPool.ts @@ -2,7 +2,7 @@ // please do not edit it manually export const CollSurplusPool = [{ "type": "constructor", - "inputs": [{ "name": "_collAddress", "type": "address", "internalType": "address" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { "type": "function", @@ -20,12 +20,6 @@ export const CollSurplusPool = [{ }], "outputs": [], "stateMutability": "nonpayable", -}, { - "type": "function", - "name": "activePoolAddress", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", }, { "type": "function", "name": "borrowerOperationsAddress", @@ -56,39 +50,12 @@ export const CollSurplusPool = [{ "inputs": [{ "name": "_account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", -}, { - "type": "function", - "name": "isOwner", - "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", -}, { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", -}, { - "type": "function", - "name": "setAddresses", - "inputs": [{ "name": "_borrowerOperationsAddress", "type": "address", "internalType": "address" }, { - "name": "_troveManagerAddress", - "type": "address", - "internalType": "address", - }, { "name": "_activePoolAddress", "type": "address", "internalType": "address" }], - "outputs": [], - "stateMutability": "nonpayable", }, { "type": "function", "name": "troveManagerAddress", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view", -}, { - "type": "event", - "name": "ActivePoolAddressChanged", - "inputs": [{ "name": "_newActivePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], - "anonymous": false, }, { "type": "event", "name": "BorrowerOperationsAddressChanged", @@ -119,16 +86,6 @@ export const CollSurplusPool = [{ "internalType": "uint256", }], "anonymous": false, -}, { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, }, { "type": "event", "name": "TroveManagerAddressChanged", diff --git a/frontend/app/src/abi/CollateralRegistry.ts b/frontend/app/src/abi/CollateralRegistry.ts index 45a79f56..48878597 100644 --- a/frontend/app/src/abi/CollateralRegistry.ts +++ b/frontend/app/src/abi/CollateralRegistry.ts @@ -5,15 +5,9 @@ export const CollateralRegistry = [{ "inputs": [{ "name": "_boldToken", "type": "address", "internalType": "contract IBoldToken" }, { "name": "_tokens", "type": "address[]", - "internalType": "contract IERC20[]", + "internalType": "contract IERC20Metadata[]", }, { "name": "_troveManagers", "type": "address[]", "internalType": "contract ITroveManager[]" }], "stateMutability": "nonpayable", -}, { - "type": "function", - "name": "activePool", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IActivePool" }], - "stateMutability": "view", }, { "type": "function", "name": "baseRate", @@ -26,30 +20,12 @@ export const CollateralRegistry = [{ "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IBoldToken" }], "stateMutability": "view", -}, { - "type": "function", - "name": "defaultPool", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IDefaultPool" }], - "stateMutability": "view", }, { "type": "function", "name": "getEffectiveRedemptionFeeInBold", "inputs": [{ "name": "_redeemAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", -}, { - "type": "function", - "name": "getEntireSystemColl", - "inputs": [], - "outputs": [{ "name": "entireSystemColl", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", -}, { - "type": "function", - "name": "getEntireSystemDebt", - "inputs": [], - "outputs": [{ "name": "entireSystemDebt", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", }, { "type": "function", "name": "getRedemptionFeeWithDecay", @@ -78,7 +54,7 @@ export const CollateralRegistry = [{ "type": "function", "name": "getToken", "inputs": [{ "name": "_index", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20" }], + "outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20Metadata" }], "stateMutability": "view", }, { "type": "function", @@ -92,12 +68,6 @@ export const CollateralRegistry = [{ "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", -}, { - "type": "function", - "name": "priceFeed", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IPriceFeed" }], - "stateMutability": "view", }, { "type": "function", "name": "redeemCollateral", diff --git a/frontend/app/src/abi/DefaultPool.ts b/frontend/app/src/abi/DefaultPool.ts index 88ca8cbb..7981c4dd 100644 --- a/frontend/app/src/abi/DefaultPool.ts +++ b/frontend/app/src/abi/DefaultPool.ts @@ -2,7 +2,7 @@ // please do not edit it manually export const DefaultPool = [{ "type": "constructor", - "inputs": [{ "name": "_collAddress", "type": "address", "internalType": "address" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { "type": "function", @@ -46,18 +46,6 @@ export const DefaultPool = [{ "inputs": [{ "name": "_amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable", -}, { - "type": "function", - "name": "isOwner", - "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", -}, { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", }, { "type": "function", "name": "receiveColl", @@ -70,16 +58,6 @@ export const DefaultPool = [{ "inputs": [{ "name": "_amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable", -}, { - "type": "function", - "name": "setAddresses", - "inputs": [{ "name": "_troveManagerAddress", "type": "address", "internalType": "address" }, { - "name": "_activePoolAddress", - "type": "address", - "internalType": "address", - }], - "outputs": [], - "stateMutability": "nonpayable", }, { "type": "function", "name": "troveManagerAddress", @@ -91,6 +69,11 @@ export const DefaultPool = [{ "name": "ActivePoolAddressChanged", "inputs": [{ "name": "_newActivePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, +}, { + "type": "event", + "name": "CollTokenAddressChanged", + "inputs": [{ "name": "_newCollTokenAddress", "type": "address", "indexed": false, "internalType": "address" }], + "anonymous": false, }, { "type": "event", "name": "DefaultPoolBoldDebtUpdated", @@ -111,16 +94,6 @@ export const DefaultPool = [{ "internalType": "uint256", }], "anonymous": false, -}, { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, }, { "type": "event", "name": "TroveManagerAddressChanged", diff --git a/frontend/app/src/abi/GasPool.ts b/frontend/app/src/abi/GasPool.ts index 1a2c5c7f..8dce711c 100644 --- a/frontend/app/src/abi/GasPool.ts +++ b/frontend/app/src/abi/GasPool.ts @@ -2,10 +2,6 @@ // please do not edit it manually export const GasPool = [{ "type": "constructor", - "inputs": [{ "name": "_weth", "type": "address", "internalType": "contract IWETH" }, { - "name": "_borrowerOperations", - "type": "address", - "internalType": "contract IBorrowerOperations", - }, { "name": "_troveManager", "type": "address", "internalType": "contract ITroveManager" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }] as const; diff --git a/frontend/app/src/abi/HintHelpers.ts b/frontend/app/src/abi/HintHelpers.ts index e2871223..d3482cc2 100644 --- a/frontend/app/src/abi/HintHelpers.ts +++ b/frontend/app/src/abi/HintHelpers.ts @@ -16,6 +16,26 @@ export const HintHelpers = [{ "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract ICollateralRegistry" }], "stateMutability": "view", +}, { + "type": "function", + "name": "forcePredictAdjustInterestRateUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_troveId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_newInterestRate", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "forcePredictJoinBatchInterestRateUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_troveId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_batchAddress", "type": "address", "internalType": "address" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }, { "type": "function", "name": "getApproxHint", @@ -31,6 +51,16 @@ export const HintHelpers = [{ "internalType": "uint256", }, { "name": "latestRandomSeed", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", +}, { + "type": "function", + "name": "predictAdjustBatchInterestRateUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_batchAddress", + "type": "address", + "internalType": "address", + }, { "name": "_newInterestRate", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }, { "type": "function", "name": "predictAdjustInterestRateUpfrontFee", @@ -51,6 +81,26 @@ export const HintHelpers = [{ }, { "name": "_debtIncrease", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", +}, { + "type": "function", + "name": "predictJoinBatchInterestRateUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_troveId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_batchAddress", "type": "address", "internalType": "address" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "predictOpenTroveAndJoinBatchUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_borrowedAmount", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_batchAddress", "type": "address", "internalType": "address" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }, { "type": "function", "name": "predictOpenTroveUpfrontFee", @@ -61,4 +111,14 @@ export const HintHelpers = [{ }, { "name": "_interestRate", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", +}, { + "type": "function", + "name": "predictRemoveFromBatchUpfrontFee", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_troveId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_newInterestRate", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }] as const; diff --git a/frontend/app/src/abi/MultiTroveGetter.ts b/frontend/app/src/abi/MultiTroveGetter.ts index ff1d9e0c..cff5bace 100644 --- a/frontend/app/src/abi/MultiTroveGetter.ts +++ b/frontend/app/src/abi/MultiTroveGetter.ts @@ -10,6 +10,25 @@ export const MultiTroveGetter = [{ "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract ICollateralRegistry" }], "stateMutability": "view", +}, { + "type": "function", + "name": "getDebtPerInterestRateAscending", + "inputs": [{ "name": "_collIndex", "type": "uint256", "internalType": "uint256" }, { + "name": "_startId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_maxIterations", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ + "name": "data", + "type": "tuple[]", + "internalType": "struct IMultiTroveGetter.DebtPerInterestRate[]", + "components": [{ "name": "interestBatchManager", "type": "address", "internalType": "address" }, { + "name": "interestRate", + "type": "uint256", + "internalType": "uint256", + }, { "name": "debt", "type": "uint256", "internalType": "uint256" }], + }, { "name": "currId", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", }, { "type": "function", "name": "getMultipleSortedTroves", @@ -21,7 +40,7 @@ export const MultiTroveGetter = [{ "outputs": [{ "name": "_troves", "type": "tuple[]", - "internalType": "struct MultiTroveGetter.CombinedTroveData[]", + "internalType": "struct IMultiTroveGetter.CombinedTroveData[]", "components": [ { "name": "id", "type": "uint256", "internalType": "uint256" }, { "name": "debt", "type": "uint256", "internalType": "uint256" }, @@ -30,6 +49,9 @@ export const MultiTroveGetter = [{ { "name": "annualInterestRate", "type": "uint256", "internalType": "uint256" }, { "name": "lastDebtUpdateTime", "type": "uint256", "internalType": "uint256" }, { "name": "lastInterestRateAdjTime", "type": "uint256", "internalType": "uint256" }, + { "name": "interestBatchManager", "type": "address", "internalType": "address" }, + { "name": "batchDebtShares", "type": "uint256", "internalType": "uint256" }, + { "name": "batchCollShares", "type": "uint256", "internalType": "uint256" }, { "name": "snapshotETH", "type": "uint256", "internalType": "uint256" }, { "name": "snapshotBoldDebt", "type": "uint256", "internalType": "uint256" }, ], diff --git a/frontend/app/src/abi/PriceFeed.ts b/frontend/app/src/abi/PriceFeed.ts index e4494715..e6983ba0 100644 --- a/frontend/app/src/abi/PriceFeed.ts +++ b/frontend/app/src/abi/PriceFeed.ts @@ -4,14 +4,18 @@ export const PriceFeed = [{ "type": "function", "name": "fetchPrice", "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }, { + "name": "", + "type": "bool", + "internalType": "bool", + }], "stateMutability": "view", }, { "type": "function", "name": "getEthUsdStalenessThreshold", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", + "stateMutability": "pure", }, { "type": "function", "name": "getPrice", diff --git a/frontend/app/src/abi/SortedTroves.ts b/frontend/app/src/abi/SortedTroves.ts index 7c91bf9e..05a192b2 100644 --- a/frontend/app/src/abi/SortedTroves.ts +++ b/frontend/app/src/abi/SortedTroves.ts @@ -1,6 +1,10 @@ // this file was generated by scripts/update-liquity-abis.ts // please do not edit it manually -export const SortedTroves = [{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" }, { +export const SortedTroves = [{ + "type": "constructor", + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], + "stateMutability": "nonpayable", +}, { "type": "function", "name": "NAME", "inputs": [], @@ -109,8 +113,8 @@ export const SortedTroves = [{ "type": "constructor", "inputs": [], "stateMutabi "stateMutability": "view", }, { "type": "function", - "name": "isOwner", - "inputs": [], + "name": "isEmptyBatch", + "inputs": [{ "name": "_id", "type": "address", "internalType": "BatchId" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view", }, { @@ -124,12 +128,6 @@ export const SortedTroves = [{ "type": "constructor", "inputs": [], "stateMutabi { "name": "exists", "type": "bool", "internalType": "bool" }, ], "stateMutability": "view", -}, { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", }, { "type": "function", "name": "reInsert", @@ -164,16 +162,6 @@ export const SortedTroves = [{ "type": "constructor", "inputs": [], "stateMutabi "inputs": [{ "name": "_id", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable", -}, { - "type": "function", - "name": "setAddresses", - "inputs": [{ "name": "_troveManagerAddress", "type": "address", "internalType": "address" }, { - "name": "_borrowerOperationsAddress", - "type": "address", - "internalType": "address", - }], - "outputs": [], - "stateMutability": "nonpayable", }, { "type": "function", "name": "size", @@ -201,16 +189,6 @@ export const SortedTroves = [{ "type": "constructor", "inputs": [], "stateMutabi "name": "BorrowerOperationsAddressChanged", "inputs": [{ "name": "_borrowerOperationsAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, -}, { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, }, { "type": "event", "name": "TroveManagerAddressChanged", diff --git a/frontend/app/src/abi/StabilityPool.ts b/frontend/app/src/abi/StabilityPool.ts index caebe3c2..dda481ab 100644 --- a/frontend/app/src/abi/StabilityPool.ts +++ b/frontend/app/src/abi/StabilityPool.ts @@ -3,7 +3,7 @@ export const StabilityPool = [ { "type": "constructor", - "inputs": [{ "name": "_collAddress", "type": "address", "internalType": "address" }], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { @@ -41,13 +41,6 @@ export const StabilityPool = [ "outputs": [{ "name": "", "type": "address", "internalType": "contract IBoldToken" }], "stateMutability": "view", }, - { - "type": "function", - "name": "borrowerOperations", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IBorrowerOperations" }], - "stateMutability": "view", - }, { "type": "function", "name": "claimAllCollGains", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", @@ -70,13 +63,6 @@ export const StabilityPool = [ "outputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }], "stateMutability": "view", }, - { - "type": "function", - "name": "defaultPool", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IDefaultPool" }], - "stateMutability": "view", - }, { "type": "function", "name": "depositSnapshots", @@ -184,9 +170,9 @@ export const StabilityPool = [ }, { "type": "function", - "name": "isOwner", + "name": "getYieldGainsPending", "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, { @@ -221,20 +207,6 @@ export const StabilityPool = [ "outputs": [], "stateMutability": "nonpayable", }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "priceFeed", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IPriceFeed" }], - "stateMutability": "view", - }, { "type": "function", "name": "provideToSP", @@ -246,27 +218,6 @@ export const StabilityPool = [ "outputs": [], "stateMutability": "nonpayable", }, - { - "type": "function", - "name": "setAddresses", - "inputs": [ - { "name": "_borrowerOperationsAddress", "type": "address", "internalType": "address" }, - { "name": "_troveManagerAddress", "type": "address", "internalType": "address" }, - { "name": "_activePoolAddress", "type": "address", "internalType": "address" }, - { "name": "_boldTokenAddress", "type": "address", "internalType": "address" }, - { "name": "_sortedTrovesAddress", "type": "address", "internalType": "address" }, - { "name": "_priceFeedAddress", "type": "address", "internalType": "address" }, - ], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "sortedTroves", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract ISortedTroves" }], - "stateMutability": "view", - }, { "type": "function", "name": "stashedColl", @@ -322,17 +273,6 @@ export const StabilityPool = [ "inputs": [{ "name": "_newBoldTokenAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, - { - "type": "event", - "name": "BorrowerOperationsAddressChanged", - "inputs": [{ - "name": "_newBorrowerOperationsAddress", - "type": "address", - "indexed": false, - "internalType": "address", - }], - "anonymous": false, - }, { "type": "event", "name": "DefaultPoolAddressChanged", @@ -391,17 +331,6 @@ export const StabilityPool = [ }], "anonymous": false, }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, - }, { "type": "event", "name": "P_Updated", @@ -431,12 +360,6 @@ export const StabilityPool = [ "inputs": [{ "name": "_currentScale", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false, }, - { - "type": "event", - "name": "SortedTrovesAddressChanged", - "inputs": [{ "name": "_newSortedTrovesAddress", "type": "address", "indexed": false, "internalType": "address" }], - "anonymous": false, - }, { "type": "event", "name": "StabilityPoolBoldBalanceUpdated", diff --git a/frontend/app/src/abi/TroveManager.ts b/frontend/app/src/abi/TroveManager.ts index 8d16db2b..b301fdcd 100644 --- a/frontend/app/src/abi/TroveManager.ts +++ b/frontend/app/src/abi/TroveManager.ts @@ -3,14 +3,7 @@ export const TroveManager = [ { "type": "constructor", - "inputs": [ - { "name": "_ccr", "type": "uint256", "internalType": "uint256" }, - { "name": "_mcr", "type": "uint256", "internalType": "uint256" }, - { "name": "_scr", "type": "uint256", "internalType": "uint256" }, - { "name": "_liquidationPenaltySP", "type": "uint256", "internalType": "uint256" }, - { "name": "_liquidationPenaltyRedistribution", "type": "uint256", "internalType": "uint256" }, - { "name": "_weth", "type": "address", "internalType": "contract IWETH" }, - ], + "inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }], "stateMutability": "nonpayable", }, { @@ -20,69 +13,6 @@ export const TroveManager = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "LIQUIDATION_PENALTY_REDISTRIBUTION", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "LIQUIDATION_PENALTY_SP", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "L_boldDebt", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "L_coll", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "MCR", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "NAME", - "inputs": [], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "SCR", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "SYMBOL", - "inputs": [], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "TroveIds", - "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, { "type": "function", "name": "Troves", @@ -96,16 +26,11 @@ export const TroveManager = [ { "name": "lastDebtUpdateTime", "type": "uint64", "internalType": "uint64" }, { "name": "lastInterestRateAdjTime", "type": "uint64", "internalType": "uint64" }, { "name": "annualInterestRate", "type": "uint256", "internalType": "uint256" }, + { "name": "interestBatchManager", "type": "address", "internalType": "address" }, + { "name": "batchDebtShares", "type": "uint256", "internalType": "uint256" }, ], "stateMutability": "view", }, - { - "type": "function", - "name": "WETH", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IWETH" }], - "stateMutability": "view", - }, { "type": "function", "name": "activePool", @@ -115,20 +40,9 @@ export const TroveManager = [ }, { "type": "function", - "name": "approve", - "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256", - }], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "balanceOf", - "inputs": [{ "name": "owner", "type": "address", "internalType": "address" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "name": "batchIds", + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view", }, { @@ -140,72 +54,9 @@ export const TroveManager = [ }, { "type": "function", - "name": "boldToken", + "name": "borrowerOperations", "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IBoldToken" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "borrowerOperationsAddress", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "calcTroveAccruedInterest", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "checkBelowCriticalThreshold", - "inputs": [{ "name": "_price", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "checkTroveIsActive", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "checkTroveIsOpen", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "checkTroveIsUnredeemable", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "collateralRegistryAddress", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "defaultPool", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IDefaultPool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getApproved", - "inputs": [{ "name": "tokenId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], + "outputs": [{ "name": "", "type": "address", "internalType": "contract IBorrowerOperations" }], "stateMutability": "view", }, { @@ -219,19 +70,6 @@ export const TroveManager = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "getEntireDebtAndColl", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [ - { "name": "entireDebt", "type": "uint256", "internalType": "uint256" }, - { "name": "entireColl", "type": "uint256", "internalType": "uint256" }, - { "name": "pendingBoldDebtReward", "type": "uint256", "internalType": "uint256" }, - { "name": "pendingCollReward", "type": "uint256", "internalType": "uint256" }, - { "name": "accruedTroveInterest", "type": "uint256", "internalType": "uint256" }, - ], - "stateMutability": "view", - }, { "type": "function", "name": "getEntireSystemColl", @@ -246,6 +84,30 @@ export const TroveManager = [ "outputs": [{ "name": "entireSystemDebt", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, + { + "type": "function", + "name": "getLatestBatchData", + "inputs": [{ "name": "_batchAddress", "type": "address", "internalType": "address" }], + "outputs": [{ + "name": "batch", + "type": "tuple", + "internalType": "struct LatestBatchData", + "components": [ + { "name": "entireDebtWithoutRedistribution", "type": "uint256", "internalType": "uint256" }, + { "name": "entireCollWithoutRedistribution", "type": "uint256", "internalType": "uint256" }, + { "name": "accruedInterest", "type": "uint256", "internalType": "uint256" }, + { "name": "recordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "annualInterestRate", "type": "uint256", "internalType": "uint256" }, + { "name": "weightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "annualManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "accruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "weightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "lastDebtUpdateTime", "type": "uint256", "internalType": "uint256" }, + { "name": "lastInterestRateAdjTime", "type": "uint256", "internalType": "uint256" }, + ], + }], + "stateMutability": "view", + }, { "type": "function", "name": "getLatestTroveData", @@ -263,32 +125,12 @@ export const TroveManager = [ { "name": "recordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "annualInterestRate", "type": "uint256", "internalType": "uint256" }, { "name": "weightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "accruedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, { "name": "lastInterestRateAdjTime", "type": "uint256", "internalType": "uint256" }, ], }], "stateMutability": "view", }, - { - "type": "function", - "name": "getPendingBoldDebtReward", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "redistBoldDebtGain", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getPendingCollReward", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "redistCollGain", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getTCR", - "inputs": [{ "name": "_price", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, { "type": "function", "name": "getTroveAnnualInterestRate", @@ -296,34 +138,6 @@ export const TroveManager = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "getTroveColl", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getTroveDebt", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getTroveEntireColl", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getTroveEntireDebt", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, { "type": "function", "name": "getTroveFromTroveIdsArray", @@ -338,20 +152,6 @@ export const TroveManager = [ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view", }, - { - "type": "function", - "name": "getTroveLastDebtUpdateTime", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "getTroveStake", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, { "type": "function", "name": "getTroveStatus", @@ -359,13 +159,6 @@ export const TroveManager = [ "outputs": [{ "name": "", "type": "uint8", "internalType": "enum ITroveManager.Status" }], "stateMutability": "view", }, - { - "type": "function", - "name": "getTroveWeightedRecordedDebt", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, { "type": "function", "name": "getUnbackedPortionPriceAndRedeemability", @@ -379,64 +172,40 @@ export const TroveManager = [ }, { "type": "function", - "name": "hasRedistributionGains", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "isApprovedForAll", - "inputs": [{ "name": "owner", "type": "address", "internalType": "address" }, { - "name": "operator", - "type": "address", - "internalType": "address", - }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "isOwner", - "inputs": [], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "lastBoldDebtError_Redistribution", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "lastCollError_Redistribution", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "liquidate", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }], + "name": "onAdjustTrove", + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_newColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newDebt", "type": "uint256", "internalType": "uint256" }, + { + "name": "_troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, + ], "outputs": [], "stateMutability": "nonpayable", }, { "type": "function", - "name": "name", - "inputs": [], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "onAdjustTrove", + "name": "onAdjustTroveInsideBatch", "inputs": [ { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, - { "name": "_newColl", "type": "uint256", "internalType": "uint256" }, - { "name": "_newDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_newTroveColl", "type": "uint256", "internalType": "uint256" }, { "name": "_troveChange", "type": "tuple", @@ -451,8 +220,14 @@ export const TroveManager = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], }, + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newBatchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchDebt", "type": "uint256", "internalType": "uint256" }, ], "outputs": [], "stateMutability": "nonpayable", @@ -479,6 +254,9 @@ export const TroveManager = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], }, ], @@ -490,8 +268,11 @@ export const TroveManager = [ "name": "onApplyTroveInterest", "inputs": [ { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, - { "name": "_newColl", "type": "uint256", "internalType": "uint256" }, - { "name": "_newDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_newTroveColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newTroveDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newBatchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchDebt", "type": "uint256", "internalType": "uint256" }, { "name": "_troveChange", "type": "tuple", @@ -506,6 +287,9 @@ export const TroveManager = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], }, ], @@ -515,7 +299,54 @@ export const TroveManager = [ { "type": "function", "name": "onCloseTrove", - "inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }, { + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { + "name": "_troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newBatchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchDebt", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "onLowerBatchManagerAnnualFee", + "inputs": [ + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_newAnnualManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "onOpenTrove", + "inputs": [{ "name": "_owner", "type": "address", "internalType": "address" }, { + "name": "_troveId", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_troveChange", "type": "tuple", "internalType": "struct TroveChange", @@ -529,45 +360,141 @@ export const TroveManager = [ { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, ], - }], + }, { "name": "_annualInterestRate", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable", }, { "type": "function", - "name": "onOpenTrove", + "name": "onOpenTroveAndJoinBatch", "inputs": [ { "name": "_owner", "type": "address", "internalType": "address" }, { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, - { "name": "_coll", "type": "uint256", "internalType": "uint256" }, - { "name": "_debt", "type": "uint256", "internalType": "uint256" }, - { "name": "_annualInterestRate", "type": "uint256", "internalType": "uint256" }, - { "name": "_upfrontFee", "type": "uint256", "internalType": "uint256" }, + { + "name": "_troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_batchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_batchDebt", "type": "uint256", "internalType": "uint256" }, ], "outputs": [], "stateMutability": "nonpayable", }, { "type": "function", - "name": "owner", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", + "name": "onRegisterBatchManager", + "inputs": [{ "name": "_account", "type": "address", "internalType": "address" }, { + "name": "_annualInterestRate", + "type": "uint256", + "internalType": "uint256", + }, { "name": "_annualManagementFee", "type": "uint256", "internalType": "uint256" }], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", - "name": "ownerOf", - "inputs": [{ "name": "tokenId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "address", "internalType": "address" }], - "stateMutability": "view", + "name": "onRemoveFromBatch", + "inputs": [ + { "name": "_troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "_newTroveColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newTroveDebt", "type": "uint256", "internalType": "uint256" }, + { + "name": "_troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newBatchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newBatchDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_newAnnualInterestRate", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", - "name": "priceFeed", - "inputs": [], - "outputs": [{ "name": "", "type": "address", "internalType": "contract IPriceFeed" }], - "stateMutability": "view", + "name": "onSetBatchManagerAnnualInterestRate", + "inputs": [ + { "name": "_batchAddress", "type": "address", "internalType": "address" }, + { "name": "_newColl", "type": "uint256", "internalType": "uint256" }, + { "name": "_newDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "_newAnnualInterestRate", "type": "uint256", "internalType": "uint256" }, + { "name": "_upfrontFee", "type": "uint256", "internalType": "uint256" }, + ], + "outputs": [], + "stateMutability": "nonpayable", + }, + { + "type": "function", + "name": "onSetInterestBatchManager", + "inputs": [{ + "name": "_params", + "type": "tuple", + "internalType": "struct ITroveManager.OnSetInterestBatchManagerParams", + "components": [ + { "name": "troveId", "type": "uint256", "internalType": "uint256" }, + { "name": "troveColl", "type": "uint256", "internalType": "uint256" }, + { "name": "troveDebt", "type": "uint256", "internalType": "uint256" }, + { + "name": "troveChange", + "type": "tuple", + "internalType": "struct TroveChange", + "components": [ + { "name": "appliedRedistBoldDebtGain", "type": "uint256", "internalType": "uint256" }, + { "name": "appliedRedistCollGain", "type": "uint256", "internalType": "uint256" }, + { "name": "collIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "collDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtIncrease", "type": "uint256", "internalType": "uint256" }, + { "name": "debtDecrease", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedDebt", "type": "uint256", "internalType": "uint256" }, + { "name": "upfrontFee", "type": "uint256", "internalType": "uint256" }, + { "name": "batchAccruedManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "newWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + { "name": "oldWeightedRecordedBatchManagementFee", "type": "uint256", "internalType": "uint256" }, + ], + }, + { "name": "newBatchAddress", "type": "address", "internalType": "address" }, + { "name": "newBatchColl", "type": "uint256", "internalType": "uint256" }, + { "name": "newBatchDebt", "type": "uint256", "internalType": "uint256" }, + ], + }], + "outputs": [], + "stateMutability": "nonpayable", }, { "type": "function", @@ -593,64 +520,6 @@ export const TroveManager = [ }], "stateMutability": "view", }, - { - "type": "function", - "name": "safeTransferFrom", - "inputs": [{ "name": "from", "type": "address", "internalType": "address" }, { - "name": "to", - "type": "address", - "internalType": "address", - }, { "name": "tokenId", "type": "uint256", "internalType": "uint256" }], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "safeTransferFrom", - "inputs": [ - { "name": "from", "type": "address", "internalType": "address" }, - { "name": "to", "type": "address", "internalType": "address" }, - { "name": "tokenId", "type": "uint256", "internalType": "uint256" }, - { "name": "data", "type": "bytes", "internalType": "bytes" }, - ], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "setAddresses", - "inputs": [ - { "name": "_borrowerOperationsAddress", "type": "address", "internalType": "address" }, - { "name": "_activePoolAddress", "type": "address", "internalType": "address" }, - { "name": "_defaultPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_stabilityPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_gasPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_collSurplusPoolAddress", "type": "address", "internalType": "address" }, - { "name": "_priceFeedAddress", "type": "address", "internalType": "address" }, - { "name": "_boldTokenAddress", "type": "address", "internalType": "address" }, - { "name": "_sortedTrovesAddress", "type": "address", "internalType": "address" }, - ], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "setApprovalForAll", - "inputs": [{ "name": "operator", "type": "address", "internalType": "address" }, { - "name": "approved", - "type": "bool", - "internalType": "bool", - }], - "outputs": [], - "stateMutability": "nonpayable", - }, - { - "type": "function", - "name": "setCollateralRegistry", - "inputs": [{ "name": "_collateralRegistryAddress", "type": "address", "internalType": "address" }], - "outputs": [], - "stateMutability": "nonpayable", - }, { "type": "function", "name": "setTroveStatusToActive", @@ -682,57 +551,11 @@ export const TroveManager = [ }, { "type": "function", - "name": "supportsInterface", - "inputs": [{ "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" }], - "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "symbol", - "inputs": [], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "tokenURI", - "inputs": [{ "name": "tokenId", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "string", "internalType": "string" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "totalCollateralSnapshot", + "name": "troveNFT", "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "address", "internalType": "contract ITroveNFT" }], "stateMutability": "view", }, - { - "type": "function", - "name": "totalStakes", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "totalStakesSnapshot", - "inputs": [], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], - "stateMutability": "view", - }, - { - "type": "function", - "name": "transferFrom", - "inputs": [{ "name": "from", "type": "address", "internalType": "address" }, { - "name": "to", - "type": "address", - "internalType": "address", - }, { "name": "tokenId", "type": "uint256", "internalType": "uint256" }], - "outputs": [], - "stateMutability": "nonpayable", - }, { "type": "function", "name": "urgentRedemption", @@ -747,29 +570,36 @@ export const TroveManager = [ { "type": "event", "name": "ActivePoolAddressChanged", - "inputs": [{ "name": "_activePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], + "inputs": [{ "name": "_newActivePoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, { "type": "event", - "name": "Approval", - "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "approved", - "type": "address", - "indexed": true, - "internalType": "address", - }, { "name": "tokenId", "type": "uint256", "indexed": true, "internalType": "uint256" }], + "name": "BatchUpdated", + "inputs": [ + { "name": "_interestBatchManager", "type": "address", "indexed": true, "internalType": "address" }, + { "name": "_operation", "type": "uint8", "indexed": false, "internalType": "enum ITroveEvents.BatchOperation" }, + { "name": "_debt", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_coll", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_annualInterestRate", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_annualManagementFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_totalDebtShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_debtIncreaseFromUpfrontFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, + ], "anonymous": false, }, { "type": "event", - "name": "ApprovalForAll", - "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "operator", - "type": "address", - "indexed": true, - "internalType": "address", - }, { "name": "approved", "type": "bool", "indexed": false, "internalType": "bool" }], + "name": "BatchedTroveUpdated", + "inputs": [ + { "name": "_troveId", "type": "uint256", "indexed": true, "internalType": "uint256" }, + { "name": "_interestBatchManager", "type": "address", "indexed": false, "internalType": "address" }, + { "name": "_batchDebtShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_coll", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_stake", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_snapshotOfTotalCollRedist", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_snapshotOfTotalDebtRedist", "type": "uint256", "indexed": false, "internalType": "uint256" }, + ], "anonymous": false, }, { @@ -809,7 +639,7 @@ export const TroveManager = [ { "type": "event", "name": "DefaultPoolAddressChanged", - "inputs": [{ "name": "_defaultPoolAddress", "type": "address", "indexed": false, "internalType": "address" }], + "inputs": [{ "name": "_newDefaultPoolAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, { @@ -835,17 +665,6 @@ export const TroveManager = [ ], "anonymous": false, }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [{ "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address", - }], - "anonymous": false, - }, { "type": "event", "name": "PriceFeedAddressChanged", @@ -889,13 +708,8 @@ export const TroveManager = [ }, { "type": "event", - "name": "Transfer", - "inputs": [{ "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address", - }, { "name": "tokenId", "type": "uint256", "indexed": true, "internalType": "uint256" }], + "name": "TroveNFTAddressChanged", + "inputs": [{ "name": "_newTroveNFTAddress", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false, }, { @@ -922,9 +736,21 @@ export const TroveManager = [ { "name": "_coll", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "_stake", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "_annualInterestRate", "type": "uint256", "indexed": false, "internalType": "uint256" }, - { "name": "_snapshotOfTotalDebtRedist", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "_snapshotOfTotalCollRedist", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "_snapshotOfTotalDebtRedist", "type": "uint256", "indexed": false, "internalType": "uint256" }, ], "anonymous": false, }, + { "type": "error", "name": "CallerNotBorrowerOperations", "inputs": [] }, + { "type": "error", "name": "CallerNotCollateralRegistry", "inputs": [] }, + { "type": "error", "name": "EmptyData", "inputs": [] }, + { + "type": "error", + "name": "MinCollNotReached", + "inputs": [{ "name": "_coll", "type": "uint256", "internalType": "uint256" }], + }, + { "type": "error", "name": "NotEnoughBoldBalance", "inputs": [] }, + { "type": "error", "name": "NotShutDown", "inputs": [] }, + { "type": "error", "name": "NothingToLiquidate", "inputs": [] }, + { "type": "error", "name": "OnlyOneTroveLeft", "inputs": [] }, ] as const;