From da9e59a33535c85d50c6428ddb76b7b8b6e42b82 Mon Sep 17 00:00:00 2001 From: Mike Hathaway Date: Wed, 20 Dec 2023 15:15:23 -0500 Subject: [PATCH] RC9 Updates (#81) * wip rc9 updates * update abis * update borrowerInfo interface; update comments and tests * fix test issues * add latest rc9 updates; fix tests --------- Co-authored-by: Mike --- .gitignore | 3 +- abis/AjnaToken.json | 448 +++- abis/ERC20.json | 278 +-- abis/ERC20Pool.json | 3482 +++++++++++++------------- abis/ERC20PoolFactory.json | 240 +- abis/ERC721.json | 396 ++- abis/ERC721Pool.json | 3620 ++++++++++++++-------------- abis/ERC721PoolFactory.json | 300 +-- abis/GrantFund.json | 5 - abis/PoolInfoUtils.json | 721 +++--- abis/PositionManager.json | 1211 +++++----- copy-abis.sh | 10 +- schema.graphql | 5 + src/mappings/erc-20-pool.ts | 10 +- src/mappings/erc-721-pool.ts | 18 +- src/utils/pool/liquidation.ts | 24 +- src/utils/pool/loan.ts | 25 +- subgraph.yaml | 4 +- tests/erc-20-pool.test.ts | 45 +- tests/erc-721-pool.test.ts | 47 +- tests/utils/mock-contract-calls.ts | 29 +- 21 files changed, 5805 insertions(+), 5116 deletions(-) diff --git a/.gitignore b/.gitignore index e85605d..65d1ea4 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,5 @@ data/ # matchstick test files tests/.bin/ -tests/.latest.json \ No newline at end of file +tests/.latest.json +tests/.docker/ \ No newline at end of file diff --git a/abis/AjnaToken.json b/abis/AjnaToken.json index ce4a58c..b23d1e4 100644 --- a/abis/AjnaToken.json +++ b/abis/AjnaToken.json @@ -1,7 +1,11 @@ [ { "inputs": [ - { "internalType": "address", "name": "tokenReceiver_", "type": "address" } + { + "internalType": "address", + "name": "tokenReceiver_", + "type": "address" + } ], "stateMutability": "nonpayable", "type": "constructor" @@ -28,7 +32,7 @@ "type": "uint256" } ], - "name": "AjnaTokenApproval", + "name": "Approval", "type": "event" }, { @@ -103,48 +107,96 @@ "type": "uint256" } ], - "name": "AjnaTokenTransfer", + "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } ], "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "burn", "outputs": [], @@ -153,8 +205,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "burnFrom", "outputs": [], @@ -163,15 +223,31 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint32", "name": "pos", "type": "uint32" } + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint32", + "name": "pos", + "type": "uint32" + } ], "name": "checkpoints", "outputs": [ { "components": [ - { "internalType": "uint32", "name": "fromBlock", "type": "uint32" }, - { "internalType": "uint224", "name": "votes", "type": "uint224" } + { + "internalType": "uint32", + "name": "fromBlock", + "type": "uint32" + }, + { + "internalType": "uint224", + "name": "votes", + "type": "uint224" + } ], "internalType": "struct ERC20Votes.Checkpoint", "name": "", @@ -184,13 +260,23 @@ { "inputs": [], "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, { "internalType": "uint256", "name": "subtractedValue", @@ -198,13 +284,23 @@ } ], "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "delegatee", "type": "address" } + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } ], "name": "delegate", "outputs": [], @@ -213,12 +309,36 @@ }, { "inputs": [ - { "internalType": "address", "name": "delegatee", "type": "address" }, - { "internalType": "uint256", "name": "nonce", "type": "uint256" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "delegateBySig", "outputs": [], @@ -227,85 +347,197 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "delegates", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "blockNumber", "type": "uint256" } + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } ], "name": "getPastTotalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "blockNumber", "type": "uint256" } + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } ], "name": "getPastVotes", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "getVotes", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } ], "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + } ], "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "numCheckpoints", - "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "permit", "outputs": [], @@ -315,48 +547,124 @@ { "inputs": [], "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "from_", "type": "address" }, - { "internalType": "address", "name": "to_", "type": "address" }, - { "internalType": "address", "name": "spender_", "type": "address" }, - { "internalType": "uint256", "name": "value_", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline_", "type": "uint256" }, - { "internalType": "uint8", "name": "v_", "type": "uint8" }, - { "internalType": "bytes32", "name": "r_", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s_", "type": "bytes32" } + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline_", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v_", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r_", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s_", + "type": "bytes32" + } ], "name": "transferFromWithPermit", "outputs": [], diff --git a/abis/ERC20.json b/abis/ERC20.json index e1f61ef..d1bf1cf 100644 --- a/abis/ERC20.json +++ b/abis/ERC20.json @@ -1,288 +1,288 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "string", "name": "name_", - "type": "string" + "type": "string", + "internalType": "string" }, { - "internalType": "string", "name": "symbol_", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "allowance", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "spender", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "allowance", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "approve", "inputs": [ { - "internalType": "address", "name": "spender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "approve", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "balanceOf", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "balanceOf", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "decimals", + "inputs": [], "outputs": [ { - "internalType": "uint8", "name": "", - "type": "uint8" + "type": "uint8", + "internalType": "uint8" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "decreaseAllowance", "inputs": [ { - "internalType": "address", "name": "spender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "subtractedValue", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "decreaseAllowance", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "increaseAllowance", "inputs": [ { - "internalType": "address", "name": "spender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "addedValue", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "increaseAllowance", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "name", + "inputs": [], "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "symbol", + "inputs": [], "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "totalSupply", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "transfer", "inputs": [ { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "transfer", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "transferFrom", "inputs": [ { - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "transferFrom", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false } ] diff --git a/abis/ERC20Pool.json b/abis/ERC20Pool.json index 3a99e08..bd0adbf 100644 --- a/abis/ERC20Pool.json +++ b/abis/ERC20Pool.json @@ -1,2444 +1,2472 @@ [ { - "inputs": [], - "name": "AllowanceAlreadySet", - "type": "error" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [], - "name": "AmountLTMinDebt", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionActive", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotClearable", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotCleared", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotCleared", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotTakeable", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionPriceGtBucketPrice", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerNotSender", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerOk", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerUnderCollateralized", - "type": "error" - }, - { - "inputs": [], - "name": "BucketBankruptcyBlock", - "type": "error" - }, - { - "inputs": [], - "name": "BucketIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [], - "name": "CannotMergeToHigherPrice", - "type": "error" - }, - { - "inputs": [], - "name": "DustAmountNotExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanCallbackFailed", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanIncorrectBalance", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanUnavailableForToken", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientCollateral", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientLP", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientLiquidity", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAllowancesInput", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidIndex", - "type": "error" - }, - { - "inputs": [], - "name": "LUPBelowHTP", - "type": "error" - }, - { - "inputs": [], - "name": "LUPGreaterThanTP", - "type": "error" - }, - { - "inputs": [], - "name": "LimitIndexExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "MoveToSameIndex", - "type": "error" - }, - { - "inputs": [], - "name": "NoAllowance", - "type": "error" - }, - { - "inputs": [], - "name": "NoAuction", - "type": "error" - }, - { - "inputs": [], - "name": "NoClaim", - "type": "error" - }, - { - "inputs": [], - "name": "NoDebt", - "type": "error" - }, - { - "inputs": [], - "name": "NoReserves", - "type": "error" - }, - { - "inputs": [], - "name": "NoReservesAuction", - "type": "error" - }, - { - "inputs": [], - "name": "PRBMathSD59x18__DivInputTooSmall", - "type": "error" - }, - { + "type": "function", + "name": "addCollateral", "inputs": [ { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" + "name": "amountToAdd_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__DivOverflow", - "type": "error" + "outputs": [ + { + "name": "bucketLP_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "addQuoteToken", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "amount_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__Exp2InputTooBig", - "type": "error" + "outputs": [ + { + "name": "bucketLP_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "addedAmount_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "approveLPTransferors", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "transferors_", + "type": "address[]", + "internalType": "address[]" } ], - "name": "PRBMathSD59x18__FromIntOverflow", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "approvedTransferors", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__FromIntUnderflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "auctionInfo", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "borrower_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__LogInputTooSmall", - "type": "error" - }, - { - "inputs": [], - "name": "PRBMathSD59x18__MulInputTooSmall", - "type": "error" + "outputs": [ + { + "name": "kicker_", + "type": "address", + "internalType": "address" + }, + { + "name": "bondFactor_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bondSize_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kickTime_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referencePrice_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "neutralPrice_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "debtToCollateral_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "head_", + "type": "address", + "internalType": "address" + }, + { + "name": "next_", + "type": "address", + "internalType": "address" + }, + { + "name": "prev_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "borrowerInfo", "inputs": [ { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" + "name": "borrower_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__MulOverflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "bucketCollateralDust", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "bucketIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__SqrtNegativeInput", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "pure" }, { + "type": "function", + "name": "bucketExchangeRate", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__SqrtOverflow", - "type": "error" + "outputs": [ + { + "name": "exchangeRate_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "bucketInfo", "inputs": [ { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMath__MulDivFixedPointOverflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "bucketTake", "inputs": [ { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "denominator", - "type": "uint256" + "name": "depositTake_", + "type": "bool", + "internalType": "bool" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMath__MulDivOverflow", - "type": "error" - }, - { - "inputs": [], - "name": "PoolUnderCollateralized", - "type": "error" - }, - { - "inputs": [], - "name": "PriceBelowLUP", - "type": "error" - }, - { - "inputs": [], - "name": "RemoveDepositLockedByAuctionDebt", - "type": "error" - }, - { - "inputs": [], - "name": "RemoveDepositLockedByAuctionDebt", - "type": "error" - }, - { - "inputs": [], - "name": "ReserveAuctionTooSoon", - "type": "error" - }, - { - "inputs": [], - "name": "TransactionExpired", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "TransactionExpired", - "type": "error" + "type": "function", + "name": "burnInfo", + "inputs": [ + { + "name": "burnEventEpoch_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "collateralAddress", "inputs": [], - "name": "TransferToSameOwner", - "type": "error" + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "pure" }, { + "type": "function", + "name": "collateralScale", "inputs": [], - "name": "TransferorNotApproved", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "pure" }, { + "type": "function", + "name": "currentBurnEpoch", "inputs": [], - "name": "ZeroThresholdPrice", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ + "type": "function", + "name": "debtInfo", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "actor", - "type": "address" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwarded", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AddCollateral", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "decreaseLPAllowance", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwarded", - "type": "uint256" + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "amounts_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "AddQuoteToken", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "depositIndex", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, + "name": "debt_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "address[]", - "name": "transferors", - "type": "address[]" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ApproveLPTransferors", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "depositScale", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lp", - "type": "uint256" - }, + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AuctionNFTSettle", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, + "type": "function", + "name": "depositSize", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AuctionSettle", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "depositUpToIndex", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "kicker", - "type": "address" - }, + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "reciever", - "type": "address" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "depositUtilization", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "BondWithdrawn", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "drawDebt", "inputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpForfeited", - "type": "uint256" + "name": "amountToBorrow_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "limitIndex_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "collateralToPledge_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "BucketBankruptcy", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ + "type": "function", + "name": "emasInfo", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "flashFee", + "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "bondChange", - "type": "uint256" + "name": "token_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "bool", - "name": "isReward", - "type": "bool" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "BucketTake", - "type": "event" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "flashLoan", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "taker", - "type": "address" + "name": "receiver_", + "type": "address", + "internalType": "contract IERC3156FlashBorrower" }, { - "indexed": true, - "internalType": "address", - "name": "kicker", - "type": "address" + "name": "token_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedTaker", - "type": "uint256" + "name": "amount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedKicker", - "type": "uint256" + "name": "data_", + "type": "bytes", + "internalType": "bytes" } ], - "name": "BucketTakeLPAwarded", - "type": "event" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "increaseLPAllowance", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" + "name": "spender_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" + "name": "amounts_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "DecreaseLPAllowance", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ + "type": "function", + "name": "inflatorInfo", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "amountBorrowed", - "type": "uint256" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateralPledged", - "type": "uint256" + "name": "rate_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "interestRateInfo", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "DrawDebt", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "kick", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" + "name": "borrower_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "npLimitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Flashloan", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "kickReserveAuction", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "kickerInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, + "name": "kicker_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "IncreaseLPAllowance", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "lenderInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, + "name": "lender_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "lpBalance_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "bond", - "type": "uint256" + "name": "depositTime_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Kick", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "lenderKick", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "claimableReservesRemaining", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "auctionPrice", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "currentBurnEpoch", - "type": "uint256" + "name": "npLimitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "KickReserveAuction", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "loanInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "loanId_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "LoanStamped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "from", - "type": "uint256" - }, + "outputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "to", - "type": "uint256" + "name": "", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "loansInfo", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemedFrom", - "type": "uint256" + "name": "", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedTo", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "MoveQuoteToken", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "lpAllowance", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "claimer", - "type": "address" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, + "name": "owner_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemed", - "type": "uint256" + "name": "allowance_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RemoveCollateral", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "maxFlashLoan", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemed", - "type": "uint256" - }, + "name": "token_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "maxLoan_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RemoveQuoteToken", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "moveQuoteToken", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "quoteRepaid", - "type": "uint256" + "name": "fromIndex_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "collateralPulled", - "type": "uint256" + "name": "toIndex_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RepayDebt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "claimableReservesRemaining", - "type": "uint256" + "name": "fromBucketLP_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "auctionPrice", - "type": "uint256" + "name": "toBucketLP_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "currentBurnEpoch", - "type": "uint256" + "name": "movedAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ReserveAuction", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "multicall", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "oldRate", - "type": "uint256" - }, + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "newRate", - "type": "uint256" + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" } ], - "name": "ResetInterestRate", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, + "type": "function", + "name": "pledgedCollateral", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RevokeLPAllowance", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, + "type": "function", + "name": "poolType", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "address[]", - "name": "transferors", - "type": "address[]" + "name": "", + "type": "uint8", + "internalType": "uint8" } ], - "name": "RevokeLPTransferors", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, + "type": "function", + "name": "quoteTokenAddress", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "settledDebt", - "type": "uint256" + "name": "", + "type": "address", + "internalType": "address" } ], - "name": "Settle", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "bondChange", - "type": "uint256" - }, + "type": "function", + "name": "quoteTokenScale", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "bool", - "name": "isReward", - "type": "bool" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Take", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, + "type": "function", + "name": "removeCollateral", "inputs": [ { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - }, + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "removedAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lp", - "type": "uint256" + "name": "redeemedLP_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "TransferLP", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "removeQuoteToken", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "oldRate", - "type": "uint256" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "newRate", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "UpdateInterestRate", - "type": "event" + "outputs": [ + { + "name": "removedAmount_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "redeemedLP_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "repayDebt", "inputs": [ { - "internalType": "uint256", - "name": "amountToAdd_", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "maxQuoteTokenAmountToRepay_", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "collateralAmountToPull_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "collateralReceiver_", + "type": "address", + "internalType": "address" + }, + { + "name": "limitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "addCollateral", "outputs": [ { - "internalType": "uint256", - "name": "bucketLP_", - "type": "uint256" + "name": "amountRepaid_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [ + "type": "function", + "name": "reservesInfo", + "inputs": [], + "outputs": [ { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bool", - "name": "revertIfBelowLup_", - "type": "bool" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "addQuoteToken", - "outputs": [ + "stateMutability": "view" + }, + { + "type": "function", + "name": "revokeLPAllowance", + "inputs": [ { - "internalType": "uint256", - "name": "bucketLP_", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" + }, + { + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "revokeLPTransferors", "inputs": [ { - "internalType": "address[]", "name": "transferors_", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "approveLPTransferors", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "settle", "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "address", - "name": "", - "type": "address" + "name": "maxDepth_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "approvedTransferors", "outputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "name": "collateralSettled_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isBorrowerSettled_", + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "stampLoan", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "take", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" - } - ], - "name": "auctionInfo", - "outputs": [ - { - "internalType": "address", - "name": "kicker_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "bondFactor_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bondSize_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "kickTime_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "referencePrice_", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "neutralPrice_", - "type": "uint256" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", - "name": "head_", - "type": "address" + "name": "callee_", + "type": "address", + "internalType": "address" }, { - "internalType": "address", - "name": "next_", - "type": "address" - }, + "name": "data_", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ { - "internalType": "address", - "name": "prev_", - "type": "address" + "name": "collateralTaken_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "takeReserves", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "borrowerInfo", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "bucketIndex_", - "type": "uint256" - } - ], - "name": "bucketCollateralDust", + "type": "function", + "name": "totalAuctionsInPool", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "view" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "bucketExchangeRate", + "type": "function", + "name": "totalT0Debt", + "inputs": [], "outputs": [ { - "internalType": "uint256", - "name": "exchangeRate_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "bucketInfo", + "type": "function", + "name": "totalT0DebtInAuction", + "inputs": [], "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "transferLP", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" + "name": "owner_", + "type": "address", + "internalType": "address" }, { - "internalType": "bool", - "name": "depositTake_", - "type": "bool" + "name": "newOwner_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "bucketTake", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateInterest", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "withdrawBonds", "inputs": [ { - "internalType": "uint256", - "name": "burnEventEpoch_", - "type": "uint256" - } - ], - "name": "burnInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "recipient_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "collateralAddress", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "withdrawnAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "collateralScale", - "outputs": [ + "type": "event", + "name": "AddCollateral", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "actor", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwarded", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "currentBurnEpoch", - "outputs": [ + "type": "event", + "name": "AddQuoteToken", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwarded", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "debtInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, + "type": "event", + "name": "ApproveLPTransferors", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "transferors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "AuctionNFTSettle", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256[]", - "name": "amounts_", - "type": "uint256[]" + "name": "lp", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "index", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "decreaseLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "AuctionSettle", "inputs": [ { - "internalType": "uint256", - "name": "debt_", - "type": "uint256" - } - ], - "name": "depositIndex", - "outputs": [ + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BondWithdrawn", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "depositScale", - "outputs": [ + "name": "kicker", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "reciever", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "depositSize", - "outputs": [ + "type": "event", + "name": "BucketBankruptcy", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "lpForfeited", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BucketTake", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "depositUpToIndex", - "outputs": [ + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "index", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "bondChange", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "isReward", + "type": "bool", + "indexed": false, + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "depositUtilization", - "outputs": [ + "type": "event", + "name": "BucketTakeLPAwarded", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "taker", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "kicker", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "lpAwardedTaker", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwardedKicker", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "DecreaseLPAllowance", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "amountToBorrow_", - "type": "uint256" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "limitIndex_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "uint256", - "name": "collateralToPledge_", - "type": "uint256" + "name": "amounts", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "name": "drawDebt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "emasInfo", - "outputs": [ + "type": "event", + "name": "DrawDebt", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amountBorrowed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateralPledged", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Flashloan", "inputs": [ { - "internalType": "address", - "name": "token_", - "type": "address" + "name": "receiver", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "flashFee", - "outputs": [ + "name": "token", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "IncreaseLPAllowance", "inputs": [ { - "internalType": "contract IERC3156FlashBorrower", - "name": "receiver_", - "type": "address" + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "address", - "name": "token_", - "type": "address" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "name": "flashLoan", - "outputs": [ - { - "internalType": "bool", - "name": "success_", - "type": "bool" + "name": "amounts", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false + }, + { + "type": "event", + "name": "InterestUpdateFailure", + "inputs": [], + "anonymous": false }, { + "type": "event", + "name": "Kick", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "debt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256[]", - "name": "amounts_", - "type": "uint256[]" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "bond", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "increaseLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "inflatorInfo", - "outputs": [ + "type": "event", + "name": "KickReserveAuction", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "claimableReservesRemaining", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "auctionPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "currentBurnEpoch", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "LoanStamped", "inputs": [ { - "internalType": "uint256", - "name": "rate_", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "interestRateInfo", - "outputs": [ + "type": "event", + "name": "MoveQuoteToken", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "from", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "to", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpRedeemedFrom", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwardedTo", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RemoveCollateral", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" + "name": "claimer", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "npLimitIndex_", - "type": "uint256" + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpRedeemed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "kick", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "kickReserveAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RemoveQuoteToken", "inputs": [ { - "internalType": "address", - "name": "kicker_", - "type": "address" - } - ], - "name": "kickerInfo", - "outputs": [ + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpRedeemed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RepayDebt", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "address", - "name": "lender_", - "type": "address" - } - ], - "name": "lenderInfo", - "outputs": [ + "name": "quoteRepaid", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "lpBalance_", - "type": "uint256" + "name": "collateralPulled", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "depositTime_", - "type": "uint256" + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "ReserveAuction", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "claimableReservesRemaining", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "npLimitIndex_", - "type": "uint256" + "name": "auctionPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "currentBurnEpoch", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "lenderKick", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "ResetInterestRate", "inputs": [ { - "internalType": "uint256", - "name": "loanId_", - "type": "uint256" - } - ], - "name": "loanInfo", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" + "name": "oldRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "newRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "loansInfo", - "outputs": [ + "type": "event", + "name": "RevokeLPAllowance", + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RevokeLPTransferors", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "address", - "name": "owner_", - "type": "address" - } - ], - "name": "lpAllowance", - "outputs": [ - { - "internalType": "uint256", - "name": "allowance_", - "type": "uint256" + "name": "transferors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Settle", "inputs": [ { - "internalType": "address", - "name": "token_", - "type": "address" - } - ], - "name": "maxFlashLoan", - "outputs": [ + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "maxLoan_", - "type": "uint256" + "name": "settledDebt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Take", "inputs": [ { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "fromIndex_", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "toIndex_", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "bondChange", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "bool", - "name": "revertIfBelowLup_", - "type": "bool" + "name": "isReward", + "type": "bool", + "indexed": false, + "internalType": "bool" } ], - "name": "moveQuoteToken", - "outputs": [ + "anonymous": false + }, + { + "type": "event", + "name": "TransferLP", + "inputs": [ { - "internalType": "uint256", - "name": "fromBucketLP_", - "type": "uint256" + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" }, { - "internalType": "uint256", - "name": "toBucketLP_", - "type": "uint256" + "name": "newOwner", + "type": "address", + "indexed": false, + "internalType": "address" }, { - "internalType": "uint256", - "name": "movedAmount_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + }, + { + "name": "lp", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "UpdateInterestRate", + "inputs": [ + { + "name": "oldRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false + }, + { + "type": "error", + "name": "AddAboveAuctionPrice", + "inputs": [] + }, + { + "type": "error", + "name": "AddAboveAuctionPrice", + "inputs": [] + }, + { + "type": "error", + "name": "AlreadyInitialized", + "inputs": [] + }, + { + "type": "error", + "name": "AmountLTMinDebt", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionActive", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionActive", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotClearable", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotCleared", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotCleared", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotTakeable", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionPriceGtBucketPrice", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerNotSender", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerOk", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerUnderCollateralized", + "inputs": [] + }, + { + "type": "error", + "name": "BucketBankruptcyBlock", + "inputs": [] + }, + { + "type": "error", + "name": "BucketIndexOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "CannotMergeToHigherPrice", + "inputs": [] + }, + { + "type": "error", + "name": "DustAmountNotExceeded", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanCallbackFailed", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanIncorrectBalance", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanUnavailableForToken", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientCollateral", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientLP", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientLiquidity", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAllowancesInput", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidIndex", + "inputs": [] }, { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "LUPBelowHTP", + "inputs": [] }, { - "inputs": [], - "name": "pledgedCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "LimitIndexExceeded", + "inputs": [] }, { - "inputs": [], - "name": "poolType", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "MoveToSameIndex", + "inputs": [] }, { - "inputs": [], - "name": "quoteTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "NoAllowance", + "inputs": [] }, { - "inputs": [], - "name": "quoteTokenScale", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "NoAuction", + "inputs": [] + }, + { + "type": "error", + "name": "NoClaim", + "inputs": [] + }, + { + "type": "error", + "name": "NoDebt", + "inputs": [] + }, + { + "type": "error", + "name": "NoReserves", + "inputs": [] + }, + { + "type": "error", + "name": "NoReservesAuction", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__DivInputTooSmall", + "inputs": [] }, { + "type": "error", + "name": "PRBMathSD59x18__DivOverflow", "inputs": [ { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" } - ], - "name": "removeCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "removedAmount_", - "type": "uint256" - }, + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__Exp2InputTooBig", + "inputs": [ { - "internalType": "uint256", - "name": "redeemedLP_", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__FromIntOverflow", "inputs": [ { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "removeQuoteToken", - "outputs": [ - { - "internalType": "uint256", - "name": "removedAmount_", - "type": "uint256" - }, + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__FromIntUnderflow", + "inputs": [ { - "internalType": "uint256", - "name": "redeemedLP_", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__LogInputTooSmall", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxQuoteTokenAmountToRepay_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmountToPull_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "collateralReceiver_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "limitIndex_", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "repayDebt", - "outputs": [ + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulInputTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulOverflow", + "inputs": [ { - "internalType": "uint256", - "name": "amountRepaid_", - "type": "uint256" + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" + ] }, { - "inputs": [], - "name": "reservesInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, + "type": "error", + "name": "PRBMathSD59x18__SqrtNegativeInput", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "stateMutability": "view", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__SqrtOverflow", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "revokeLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMath__MulDivFixedPointOverflow", "inputs": [ { - "internalType": "address[]", - "name": "transferors_", - "type": "address[]" + "name": "prod1", + "type": "uint256", + "internalType": "uint256" } - ], - "name": "revokeLPTransferors", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMath__MulDivOverflow", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" + "name": "prod1", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "maxDepth_", - "type": "uint256" + "name": "denominator", + "type": "uint256", + "internalType": "uint256" } - ], - "name": "settle", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { - "inputs": [], - "name": "stampLoan", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "PriceBelowLUP", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "callee_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "name": "take", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralTaken_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "RemoveDepositLockedByAuctionDebt", + "inputs": [] }, { - "inputs": [ - { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - } - ], - "name": "takeReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "RemoveDepositLockedByAuctionDebt", + "inputs": [] }, { - "inputs": [], - "name": "totalAuctionsInPool", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "ReserveAuctionTooSoon", + "inputs": [] }, { - "inputs": [], - "name": "totalT0Debt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "TransactionExpired", + "inputs": [] }, { - "inputs": [], - "name": "totalT0DebtInAuction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "TransactionExpired", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "owner_", - "type": "address" - }, - { - "internalType": "address", - "name": "newOwner_", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" - } - ], - "name": "transferLP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "TransferToSameOwner", + "inputs": [] }, { - "inputs": [], - "name": "updateInterest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "TransferorNotApproved", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "recipient_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - } - ], - "name": "withdrawBonds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "ZeroDebtToCollateral", + "inputs": [] } ] diff --git a/abis/ERC20PoolFactory.json b/abis/ERC20PoolFactory.json index a4032d0..6958753 100644 --- a/abis/ERC20PoolFactory.json +++ b/abis/ERC20PoolFactory.json @@ -1,230 +1,236 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "address", "name": "ajna_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "CreateFail", - "type": "error" - }, - { - "inputs": [], - "name": "DecimalsNotCompliant", - "type": "error" - }, - { - "inputs": [], - "name": "DeployQuoteCollateralSameToken", - "type": "error" - }, - { - "inputs": [], - "name": "DeployWithZeroAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool_", - "type": "address" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "PoolInterestRateInvalid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "pool_", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "inputs": [], + "type": "function", "name": "ERC20_NON_SUBSET_HASH", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "MAX_RATE", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "MIN_RATE", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "ajna", + "inputs": [], "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "deployPool", "inputs": [ { - "internalType": "address", "name": "collateral_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "quote_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "interestRate_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "deployPool", "outputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "deployedPools", "inputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "deployedPools", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "deployedPoolsList", "inputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "deployedPoolsList", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "getDeployedPoolsList", + "inputs": [], "outputs": [ { - "internalType": "address[]", "name": "", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "getNumberOfDeployedPools", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "implementation", + "inputs": [], "outputs": [ { - "internalType": "contract ERC20Pool", "name": "", - "type": "address" + "type": "address", + "internalType": "contract ERC20Pool" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "PoolCreated", + "inputs": [ + { + "name": "pool_", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "subsetHash_", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false + }, + { + "type": "error", + "name": "CreateFail", + "inputs": [] + }, + { + "type": "error", + "name": "DecimalsNotCompliant", + "inputs": [] + }, + { + "type": "error", + "name": "DeployQuoteCollateralSameToken", + "inputs": [] + }, + { + "type": "error", + "name": "DeployWithZeroAddress", + "inputs": [] + }, + { + "type": "error", + "name": "PoolAlreadyExists", + "inputs": [ + { + "name": "pool_", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "PoolInterestRateInvalid", + "inputs": [] } ] diff --git a/abis/ERC721.json b/abis/ERC721.json index 616eeb5..152eb74 100644 --- a/abis/ERC721.json +++ b/abis/ERC721.json @@ -1,208 +1,348 @@ [ { + "type": "constructor", "inputs": [ - { "internalType": "string", "name": "name_", "type": "string" }, - { "internalType": "string", "name": "symbol_", "type": "string" } + { + "name": "name_", + "type": "string", + "internalType": "string" + }, + { + "name": "symbol_", + "type": "string", + "internalType": "string" + } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "approve", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" + "name": "to", + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "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" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getApproved", + "inputs": [ { - "indexed": true, - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" } ], - "name": "ERC721Approval", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "isApprovedForAll", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "operator", - "type": "address" - }, + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" + "name": "", + "type": "bool", + "internalType": "bool" } ], - "name": "ERC721ApprovalForAll", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ownerOf", + "inputs": [ + { + "name": "tokenId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "safeTransferFrom", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "ERC721Transfer", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "safeTransferFrom", "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } ], - "name": "approve", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "setApprovalForAll", "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } + { + "name": "operator", + "type": "address", + "internalType": "address" + }, + { + "name": "approved", + "type": "bool", + "internalType": "bool" + } ], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "supportsInterface", "inputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } ], - "name": "getApproved", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "operator", "type": "address" } + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } ], - "name": "isApprovedForAll", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "symbol", "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } ], - "name": "ownerOf", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "tokenURI", "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + { + "name": "tokenId", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "transferFrom", "inputs": [ - { "internalType": "address", "name": "operator", "type": "address" }, - { "internalType": "bool", "name": "approved", "type": "bool" } + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "setApprovalForAll", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "event", + "name": "Approval", "inputs": [ - { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } + { + "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": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "ApprovalForAll", "inputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + { + "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": "tokenURI", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Transfer", "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + { + "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": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false } ] diff --git a/abis/ERC721Pool.json b/abis/ERC721Pool.json index 34ae7d6..27f244e 100644 --- a/abis/ERC721Pool.json +++ b/abis/ERC721Pool.json @@ -1,2534 +1,2562 @@ [ { - "inputs": [], - "name": "AllowanceAlreadySet", - "type": "error" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [], - "name": "AmountLTMinDebt", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionActive", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotClearable", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotCleared", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotCleared", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionNotTakeable", - "type": "error" - }, - { - "inputs": [], - "name": "AuctionPriceGtBucketPrice", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerNotSender", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerOk", - "type": "error" - }, - { - "inputs": [], - "name": "BorrowerUnderCollateralized", - "type": "error" - }, - { - "inputs": [], - "name": "BucketBankruptcyBlock", - "type": "error" - }, - { - "inputs": [], - "name": "BucketIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [], - "name": "CannotMergeToHigherPrice", - "type": "error" - }, - { - "inputs": [], - "name": "DustAmountNotExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanCallbackFailed", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanIncorrectBalance", - "type": "error" - }, - { - "inputs": [], - "name": "FlashloanUnavailableForToken", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientCollateral", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientLP", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientLiquidity", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAllowancesInput", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidIndex", - "type": "error" - }, - { - "inputs": [], - "name": "LUPBelowHTP", - "type": "error" - }, - { - "inputs": [], - "name": "LUPGreaterThanTP", - "type": "error" - }, - { - "inputs": [], - "name": "LimitIndexExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "MoveToSameIndex", - "type": "error" - }, - { - "inputs": [], - "name": "NoAllowance", - "type": "error" - }, - { - "inputs": [], - "name": "NoAuction", - "type": "error" - }, - { - "inputs": [], - "name": "NoClaim", - "type": "error" - }, - { - "inputs": [], - "name": "NoDebt", - "type": "error" + "type": "function", + "name": "addCollateral", + "inputs": [ + { + "name": "tokenIds_", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "bucketLP_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "NoReserves", - "type": "error" + "type": "function", + "name": "addQuoteToken", + "inputs": [ + { + "name": "amount_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "bucketLP_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "addedAmount_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "NoReservesAuction", - "type": "error" + "type": "function", + "name": "approveLPTransferors", + "inputs": [ + { + "name": "transferors_", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "OnlySubset", - "type": "error" + "type": "function", + "name": "approvedTransferors", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "auctionInfo", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "borrower_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__Exp2InputTooBig", - "type": "error" + "outputs": [ + { + "name": "kicker_", + "type": "address", + "internalType": "address" + }, + { + "name": "bondFactor_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bondSize_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kickTime_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referencePrice_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "neutralPrice_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "debtToCollateral_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "head_", + "type": "address", + "internalType": "address" + }, + { + "name": "next_", + "type": "address", + "internalType": "address" + }, + { + "name": "prev_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "borrowerInfo", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "borrower_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__FromIntOverflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "borrowerTokenIds", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__FromIntUnderflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "bucketExchangeRate", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__LogInputTooSmall", - "type": "error" + "outputs": [ + { + "name": "exchangeRate_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "inputs": [], - "name": "PRBMathSD59x18__MulInputTooSmall", - "type": "error" + "type": "function", + "name": "bucketInfo", + "inputs": [ + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "bucketTake", "inputs": [ { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" + }, + { + "name": "depositTake_", + "type": "bool", + "internalType": "bool" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMathSD59x18__MulOverflow", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "bucketTokenIds", "inputs": [ { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "PRBMath__MulDivFixedPointOverflow", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "inputs": [], - "name": "PoolUnderCollateralized", - "type": "error" + "type": "function", + "name": "burnInfo", + "inputs": [ + { + "name": "burnEventEpoch_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "collateralAddress", "inputs": [], - "name": "PriceBelowLUP", - "type": "error" + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "pure" }, { + "type": "function", + "name": "currentBurnEpoch", "inputs": [], - "name": "RemoveDepositLockedByAuctionDebt", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "debtInfo", "inputs": [], - "name": "RemoveDepositLockedByAuctionDebt", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "inputs": [], - "name": "ReserveAuctionTooSoon", - "type": "error" + "type": "function", + "name": "decreaseLPAllowance", + "inputs": [ + { + "name": "spender_", + "type": "address", + "internalType": "address" + }, + { + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "amounts_", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "TransactionExpired", - "type": "error" + "type": "function", + "name": "depositIndex", + "inputs": [ + { + "name": "debt_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "inputs": [], - "name": "TransactionExpired", - "type": "error" + "type": "function", + "name": "depositScale", + "inputs": [ + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "depositSize", "inputs": [], - "name": "TransferToSameOwner", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "inputs": [], - "name": "TransferorNotApproved", - "type": "error" + "type": "function", + "name": "depositUpToIndex", + "inputs": [ + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "depositUtilization", "inputs": [], - "name": "ZeroThresholdPrice", - "type": "error" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "drawDebt", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "actor", - "type": "address" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "amountToBorrow_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "tokenIds", - "type": "uint256[]" + "name": "limitIndex_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwarded", - "type": "uint256" + "name": "tokenIdsToPledge_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "AddCollateralNFT", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, + "type": "function", + "name": "emasInfo", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwarded", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AddQuoteToken", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "flashFee", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" + "name": "token_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "address[]", - "name": "transferors", - "type": "address[]" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ApproveLPTransferors", - "type": "event" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "flashLoan", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "receiver_", + "type": "address", + "internalType": "contract IERC3156FlashBorrower" }, { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "token_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lp", - "type": "uint256" + "name": "amount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "data_", + "type": "bytes", + "internalType": "bytes" } ], - "name": "AuctionNFTSettle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "", + "type": "bool", + "internalType": "bool" } ], - "name": "AuctionSettle", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "getBorrowerTokenIds", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "kicker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "reciever", - "type": "address" - }, + "name": "borrower_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "BondWithdrawn", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, + "type": "function", + "name": "getBucketTokenIds", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpForfeited", - "type": "uint256" + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "BucketBankruptcy", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "increaseLPAllowance", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "bondChange", - "type": "uint256" + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "indexed": false, - "internalType": "bool", - "name": "isReward", - "type": "bool" + "name": "amounts_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "BucketTake", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "taker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "kicker", - "type": "address" - }, + "type": "function", + "name": "inflatorInfo", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedTaker", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedKicker", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "BucketTakeLPAwarded", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "initialize", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "tokenIds_", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" + "name": "rate_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "DecreaseLPAllowance", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, + "type": "function", + "name": "interestRateInfo", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "amountBorrowed", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256[]", - "name": "tokenIdsPledged", - "type": "uint256[]" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isSubset", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "", + "type": "bool", + "internalType": "bool" } ], - "name": "DrawDebtNFT", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, + "type": "function", + "name": "kick", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" + "name": "borrower_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "npLimitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Flashloan", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "kickReserveAuction", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "kickerInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, + "name": "kicker_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "", + "type": "uint256", + "internalType": "uint256" }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" + { + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "IncreaseLPAllowance", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "lenderInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, + "name": "lender_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" + "name": "lpBalance_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "bond", - "type": "uint256" + "name": "depositTime_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Kick", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "lenderKick", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "claimableReservesRemaining", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "auctionPrice", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "currentBurnEpoch", - "type": "uint256" + "name": "npLimitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "KickReserveAuction", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "loanInfo", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "loanId_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "LoanStamped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "actor", - "type": "address" - }, + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "collateralMerged", - "type": "uint256" + "name": "", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "toIndexLps", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "MergeOrRemoveCollateralNFT", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ + "type": "function", + "name": "loansInfo", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" + "name": "", + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "uint256", - "name": "from", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": true, - "internalType": "uint256", - "name": "to", - "type": "uint256" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lpAllowance", + "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemedFrom", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedTo", - "type": "uint256" - }, + "name": "owner_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "allowance_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "MoveQuoteToken", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "maxFlashLoan", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, + "name": "token_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemed", - "type": "uint256" + "name": "maxLoan_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RemoveCollateral", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "mergeOrRemoveCollateral", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" + "name": "removalIndexes_", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "indexed": true, - "internalType": "uint256", - "name": "index", - "type": "uint256" + "name": "noOfNFTsToRemove_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, + "name": "toIndex_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemed", - "type": "uint256" + "name": "collateralMerged_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "bucketLP_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RemoveQuoteToken", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "moveQuoteToken", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "quoteRepaid", - "type": "uint256" + "name": "fromIndex_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "collateralPulled", - "type": "uint256" + "name": "toIndex_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lup", - "type": "uint256" + "name": "expiry_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RepayDebt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "claimableReservesRemaining", - "type": "uint256" + "name": "fromBucketLP_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "auctionPrice", - "type": "uint256" + "name": "toBucketLP_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "currentBurnEpoch", - "type": "uint256" + "name": "movedAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ReserveAuction", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "multicall", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "oldRate", - "type": "uint256" - }, + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "newRate", - "type": "uint256" + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" } ], - "name": "ResetInterestRate", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, + "type": "function", + "name": "pledgedCollateral", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "RevokeLPAllowance", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, + "type": "function", + "name": "poolType", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "address[]", - "name": "transferors", - "type": "address[]" + "name": "", + "type": "uint8", + "internalType": "uint8" } ], - "name": "RevokeLPTransferors", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, - "inputs": [ + "type": "function", + "name": "quoteTokenAddress", + "inputs": [], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "quoteTokenScale", + "inputs": [], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "settledDebt", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Settle", - "type": "event" + "stateMutability": "pure" }, { - "anonymous": false, + "type": "function", + "name": "removeCollateral", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "name": "noOfNFTsToRemove_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, + "name": "index_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "bondChange", - "type": "uint256" + "name": "removedAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "bool", - "name": "isReward", - "type": "bool" + "name": "redeemedLP_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "Take", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "removeQuoteToken", "inputs": [ { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "lp", - "type": "uint256" + "name": "index_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "TransferLP", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "oldRate", - "type": "uint256" + "name": "removedAmount_", + "type": "uint256", + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "newRate", - "type": "uint256" + "name": "redeemedLP_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "UpdateInterestRate", - "type": "event" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "repayDebt", "inputs": [ { - "internalType": "uint256[]", - "name": "tokenIds_", - "type": "uint256[]" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "maxQuoteTokenAmountToRepay_", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "noOfNFTsToPull_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "collateralReceiver_", + "type": "address", + "internalType": "address" + }, + { + "name": "limitIndex_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "addCollateral", "outputs": [ { - "internalType": "uint256", - "name": "bucketLP_", - "type": "uint256" + "name": "amountRepaid_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [ + "type": "function", + "name": "reservesInfo", + "inputs": [], + "outputs": [ { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bool", - "name": "revertIfBelowLup_", - "type": "bool" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "addQuoteToken", - "outputs": [ + "stateMutability": "view" + }, + { + "type": "function", + "name": "revokeLPAllowance", + "inputs": [ { - "internalType": "uint256", - "name": "bucketLP_", - "type": "uint256" + "name": "spender_", + "type": "address", + "internalType": "address" + }, + { + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "revokeLPTransferors", "inputs": [ { - "internalType": "address[]", "name": "transferors_", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "approveLPTransferors", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "settle", "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "address", - "name": "", - "type": "address" + "name": "maxDepth_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "approvedTransferors", "outputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "name": "collateralSettled_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isBorrowerSettled_", + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "stampLoan", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "take", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" - } - ], - "name": "auctionInfo", - "outputs": [ - { - "internalType": "address", - "name": "kicker_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "bondFactor_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bondSize_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "kickTime_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "referencePrice_", - "type": "uint256" + "name": "borrowerAddress_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "neutralPrice_", - "type": "uint256" + "name": "collateral_", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", - "name": "head_", - "type": "address" + "name": "callee_", + "type": "address", + "internalType": "address" }, { - "internalType": "address", - "name": "next_", - "type": "address" - }, + "name": "data_", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ { - "internalType": "address", - "name": "prev_", - "type": "address" + "name": "collateralTaken_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "takeReserves", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "borrowerInfo", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "tokenIdsAllowed", "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "tokenId_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "borrowerTokenIds", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "bucketExchangeRate", + "type": "function", + "name": "totalAuctionsInPool", + "inputs": [], "outputs": [ { - "internalType": "uint256", - "name": "exchangeRate_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [ + "type": "function", + "name": "totalT0Debt", + "inputs": [], + "outputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "bucketInfo", + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalT0DebtInAuction", + "inputs": [], "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "transferLP", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" + "name": "owner_", + "type": "address", + "internalType": "address" }, { - "internalType": "bool", - "name": "depositTake_", - "type": "bool" + "name": "newOwner_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "indexes_", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "bucketTake", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateInterest", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "withdrawBonds", "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "recipient_", + "type": "address", + "internalType": "address" + }, + { + "name": "maxAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "name": "bucketTokenIds", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "withdrawnAmount_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "event", + "name": "AddCollateralNFT", "inputs": [ { - "internalType": "uint256", - "name": "burnEventEpoch_", - "type": "uint256" - } - ], - "name": "burnInfo", - "outputs": [ + "name": "actor", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "tokenIds", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lpAwarded", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "collateralAddress", - "outputs": [ + "type": "event", + "name": "AddQuoteToken", + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwarded", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "currentBurnEpoch", - "outputs": [ + "type": "event", + "name": "ApproveLPTransferors", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "transferors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "debtInfo", - "outputs": [ + "type": "event", + "name": "AuctionNFTSettle", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lp", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "index", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AuctionSettle", + "inputs": [ + { + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BondWithdrawn", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "kicker", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "reciever", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256[]", - "name": "amounts_", - "type": "uint256[]" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "decreaseLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BucketBankruptcy", "inputs": [ { - "internalType": "uint256", - "name": "debt_", - "type": "uint256" - } - ], - "name": "depositIndex", - "outputs": [ + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lpForfeited", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BucketTake", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "depositScale", - "outputs": [ + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositSize", - "outputs": [ + "name": "index", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "bondChange", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "isReward", + "type": "bool", + "indexed": false, + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BucketTakeLPAwarded", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "depositUpToIndex", - "outputs": [ + "name": "taker", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositUtilization", - "outputs": [ + "name": "kicker", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lpAwardedTaker", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwardedKicker", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "DecreaseLPAllowance", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "amountToBorrow_", - "type": "uint256" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "limitIndex_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "uint256[]", - "name": "tokenIdsToPledge_", - "type": "uint256[]" + "name": "amounts", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "name": "drawDebt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "emasInfo", - "outputs": [ + "type": "event", + "name": "DrawDebtNFT", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amountBorrowed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "tokenIdsPledged", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Flashloan", "inputs": [ { - "internalType": "address", - "name": "token_", - "type": "address" + "name": "receiver", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "flashFee", - "outputs": [ + "name": "token", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "IncreaseLPAllowance", "inputs": [ { - "internalType": "contract IERC3156FlashBorrower", - "name": "receiver_", - "type": "address" + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "address", - "name": "token_", - "type": "address" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" }, { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "name": "flashLoan", - "outputs": [ - { - "internalType": "bool", - "name": "success_", - "type": "bool" + "name": "amounts", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false + }, + { + "type": "event", + "name": "InterestUpdateFailure", + "inputs": [], + "anonymous": false }, { + "type": "event", + "name": "Kick", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "debt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256[]", - "name": "amounts_", - "type": "uint256[]" - } - ], - "name": "increaseLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "inflatorInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "bond", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "KickReserveAuction", "inputs": [ { - "internalType": "uint256[]", - "name": "tokenIds_", - "type": "uint256[]" + "name": "claimableReservesRemaining", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "rate_", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "interestRateInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "auctionPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "currentBurnEpoch", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "isSubset", - "outputs": [ + "type": "event", + "name": "LoanStamped", + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "stateMutability": "pure", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "MergeOrRemoveCollateralNFT", "inputs": [ { - "internalType": "address", - "name": "borrower_", - "type": "address" + "name": "actor", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "npLimitIndex_", - "type": "uint256" + "name": "collateralMerged", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "toIndexLps", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "kick", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "kickReserveAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "MoveQuoteToken", "inputs": [ { - "internalType": "address", - "name": "kicker_", - "type": "address" - } - ], - "name": "kickerInfo", - "outputs": [ + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "from", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "to", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpRedeemedFrom", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwardedTo", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RemoveCollateral", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "claimer", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "address", - "name": "lender_", - "type": "address" - } - ], - "name": "lenderInfo", - "outputs": [ + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "lpBalance_", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "depositTime_", - "type": "uint256" + "name": "lpRedeemed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RemoveQuoteToken", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "npLimitIndex_", - "type": "uint256" - } - ], - "name": "lenderKick", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + "name": "index", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "loanId_", - "type": "uint256" - } - ], - "name": "loanInfo", - "outputs": [ + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, { - "internalType": "address", - "name": "", - "type": "address" + "name": "lpRedeemed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { - "inputs": [], - "name": "loansInfo", - "outputs": [ + "type": "event", + "name": "RepayDebt", + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "quoteRepaid", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "collateralPulled", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "ReserveAuction", "inputs": [ { - "internalType": "uint256", - "name": "index_", - "type": "uint256" + "name": "claimableReservesRemaining", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "address", - "name": "spender_", - "type": "address" + "name": "auctionPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "address", - "name": "owner_", - "type": "address" + "name": "currentBurnEpoch", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "lpAllowance", - "outputs": [ + "anonymous": false + }, + { + "type": "event", + "name": "ResetInterestRate", + "inputs": [ { - "internalType": "uint256", - "name": "allowance_", - "type": "uint256" + "name": "oldRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RevokeLPAllowance", "inputs": [ { - "internalType": "address", - "name": "token_", - "type": "address" - } - ], - "name": "maxFlashLoan", - "outputs": [ + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - "internalType": "uint256", - "name": "maxLoan_", - "type": "uint256" + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "RevokeLPTransferors", "inputs": [ { - "internalType": "uint256[]", - "name": "removalIndexes_", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "noOfNFTsToRemove_", - "type": "uint256" + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "toIndex_", - "type": "uint256" + "name": "transferors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" } ], - "name": "mergeOrRemoveCollateral", - "outputs": [ + "anonymous": false + }, + { + "type": "event", + "name": "Settle", + "inputs": [ { - "internalType": "uint256", - "name": "collateralMerged_", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "bucketLP_", - "type": "uint256" + "name": "settledDebt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Take", "inputs": [ { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" + "name": "borrower", + "type": "address", + "indexed": true, + "internalType": "address" }, { - "internalType": "uint256", - "name": "fromIndex_", - "type": "uint256" + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "toIndex_", - "type": "uint256" + "name": "collateral", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "expiry_", - "type": "uint256" + "name": "bondChange", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "internalType": "bool", - "name": "revertIfBelowLup_", - "type": "bool" + "name": "isReward", + "type": "bool", + "indexed": false, + "internalType": "bool" } ], - "name": "moveQuoteToken", - "outputs": [ + "anonymous": false + }, + { + "type": "event", + "name": "TransferLP", + "inputs": [ { - "internalType": "uint256", - "name": "fromBucketLP_", - "type": "uint256" + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" }, { - "internalType": "uint256", - "name": "toBucketLP_", - "type": "uint256" + "name": "newOwner", + "type": "address", + "indexed": false, + "internalType": "address" }, { - "internalType": "uint256", - "name": "movedAmount_", - "type": "uint256" + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + }, + { + "name": "lp", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "UpdateInterestRate", "inputs": [ { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ + "name": "oldRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" + "name": "newRate", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false + }, + { + "type": "error", + "name": "AddAboveAuctionPrice", + "inputs": [] + }, + { + "type": "error", + "name": "AddAboveAuctionPrice", + "inputs": [] + }, + { + "type": "error", + "name": "AlreadyInitialized", + "inputs": [] + }, + { + "type": "error", + "name": "AmountLTMinDebt", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionActive", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionActive", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotClearable", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotCleared", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotCleared", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionNotTakeable", + "inputs": [] + }, + { + "type": "error", + "name": "AuctionPriceGtBucketPrice", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerNotSender", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerOk", + "inputs": [] + }, + { + "type": "error", + "name": "BorrowerUnderCollateralized", + "inputs": [] + }, + { + "type": "error", + "name": "BucketBankruptcyBlock", + "inputs": [] + }, + { + "type": "error", + "name": "BucketIndexOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "CannotMergeToHigherPrice", + "inputs": [] + }, + { + "type": "error", + "name": "DustAmountNotExceeded", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanCallbackFailed", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanIncorrectBalance", + "inputs": [] + }, + { + "type": "error", + "name": "FlashloanUnavailableForToken", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientCollateral", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientLP", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientLiquidity", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAllowancesInput", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidIndex", + "inputs": [] + }, + { + "type": "error", + "name": "LUPBelowHTP", + "inputs": [] }, { - "inputs": [], - "name": "pledgedCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "LimitIndexExceeded", + "inputs": [] }, { - "inputs": [], - "name": "poolType", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "MoveToSameIndex", + "inputs": [] }, { - "inputs": [], - "name": "quoteTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "NoAllowance", + "inputs": [] }, { - "inputs": [], - "name": "quoteTokenScale", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" + "type": "error", + "name": "NoAuction", + "inputs": [] }, { - "inputs": [ - { - "internalType": "uint256", - "name": "noOfNFTsToRemove_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "removeCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "removedAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "redeemedLP_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "NoClaim", + "inputs": [] }, { - "inputs": [ - { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index_", - "type": "uint256" - } - ], - "name": "removeQuoteToken", - "outputs": [ - { - "internalType": "uint256", - "name": "removedAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "redeemedLP_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "NoDebt", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxQuoteTokenAmountToRepay_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "noOfNFTsToPull_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "collateralReceiver_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "limitIndex_", - "type": "uint256" - } - ], - "name": "repayDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "amountRepaid_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "NoReserves", + "inputs": [] }, { - "inputs": [], - "name": "reservesInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, + "type": "error", + "name": "NoReservesAuction", + "inputs": [] + }, + { + "type": "error", + "name": "OnlySubset", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__Exp2InputTooBig", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "stateMutability": "view", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__FromIntOverflow", "inputs": [ { - "internalType": "address", - "name": "spender_", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "revokeLPAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__FromIntUnderflow", "inputs": [ { - "internalType": "address[]", - "name": "transferors_", - "type": "address[]" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "revokeLPTransferors", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMathSD59x18__LogInputTooSmall", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxDepth_", - "type": "uint256" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "settle", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { - "inputs": [], - "name": "stampLoan", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "PRBMathSD59x18__MulInputTooSmall", + "inputs": [] }, { + "type": "error", + "name": "PRBMathSD59x18__MulOverflow", "inputs": [ { - "internalType": "address", - "name": "borrowerAddress_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collateral_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "callee_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "name": "take", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralTaken_", - "type": "uint256" + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "PRBMath__MulDivFixedPointOverflow", "inputs": [ { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - } - ], - "name": "takeReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" + "name": "prod1", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" + ] }, { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId_", - "type": "uint256" - } - ], - "name": "tokenIdsAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "PriceBelowLUP", + "inputs": [] }, { - "inputs": [], - "name": "totalAuctionsInPool", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "RemoveDepositLockedByAuctionDebt", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "borrower_", - "type": "address" - } - ], - "name": "totalBorrowerTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "RemoveDepositLockedByAuctionDebt", + "inputs": [] }, { - "inputs": [], - "name": "totalBucketTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "ReserveAuctionTooSoon", + "inputs": [] }, { - "inputs": [], - "name": "totalT0Debt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "TransactionExpired", + "inputs": [] }, { - "inputs": [], - "name": "totalT0DebtInAuction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "TransactionExpired", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "owner_", - "type": "address" - }, - { - "internalType": "address", - "name": "newOwner_", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "indexes_", - "type": "uint256[]" - } - ], - "name": "transferLP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "TransferToSameOwner", + "inputs": [] }, { - "inputs": [], - "name": "updateInterest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "TransferorNotApproved", + "inputs": [] }, { - "inputs": [ - { - "internalType": "address", - "name": "recipient_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxAmount_", - "type": "uint256" - } - ], - "name": "withdrawBonds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "type": "error", + "name": "ZeroDebtToCollateral", + "inputs": [] } -] \ No newline at end of file +] diff --git a/abis/ERC721PoolFactory.json b/abis/ERC721PoolFactory.json index 4cb105a..553b41b 100644 --- a/abis/ERC721PoolFactory.json +++ b/abis/ERC721PoolFactory.json @@ -1,293 +1,299 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "address", "name": "ajna_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "CreateFail", - "type": "error" - }, - { - "inputs": [], - "name": "DecimalsNotCompliant", - "type": "error" - }, - { - "inputs": [], - "name": "DeployQuoteCollateralSameToken", - "type": "error" - }, - { - "inputs": [], - "name": "DeployWithZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "NFTNotSupported", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool_", - "type": "address" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "PoolInterestRateInvalid", - "type": "error" - }, - { - "inputs": [], - "name": "TokenIdSubsetInvalid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "pool_", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "inputs": [], + "type": "function", "name": "ERC721_NON_SUBSET_HASH", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "MAX_RATE", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "MIN_RATE", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "ajna", + "inputs": [], "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "deployPool", "inputs": [ { - "internalType": "address", "name": "collateral_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "quote_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "interestRate_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "deployPool", "outputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "deployPool", "inputs": [ { - "internalType": "address", "name": "collateral_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "quote_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256[]", "name": "tokenIds_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "uint256", "name": "interestRate_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "deployPool", "outputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "deployedPools", "inputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "deployedPools", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "deployedPoolsList", "inputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "deployedPoolsList", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "getDeployedPoolsList", + "inputs": [], "outputs": [ { - "internalType": "address[]", "name": "", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getNFTSubsetHash", "inputs": [ { - "internalType": "uint256[]", "name": "tokenIds_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "getNFTSubsetHash", "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { - "inputs": [], + "type": "function", "name": "getNumberOfDeployedPools", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "implementation", + "inputs": [], "outputs": [ { - "internalType": "contract ERC721Pool", "name": "", - "type": "address" + "type": "address", + "internalType": "contract ERC721Pool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" + }, + { + "type": "event", + "name": "PoolCreated", + "inputs": [ + { + "name": "pool_", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "subsetHash_", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "CreateFail", + "inputs": [] + }, + { + "type": "error", + "name": "DecimalsNotCompliant", + "inputs": [] + }, + { + "type": "error", + "name": "DeployQuoteCollateralSameToken", + "inputs": [] + }, + { + "type": "error", + "name": "DeployWithZeroAddress", + "inputs": [] + }, + { + "type": "error", + "name": "NFTNotSupported", + "inputs": [] + }, + { + "type": "error", + "name": "PoolAlreadyExists", + "inputs": [ + { + "name": "pool_", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "PoolInterestRateInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "TokenIdSubsetInvalid", + "inputs": [] } ] diff --git a/abis/GrantFund.json b/abis/GrantFund.json index e4ea4b7..ba6636f 100644 --- a/abis/GrantFund.json +++ b/abis/GrantFund.json @@ -10,11 +10,6 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "inputs": [], - "name": "AlreadyVoted", - "type": "error" - }, { "inputs": [], "name": "DelegateRewardInvalid", diff --git a/abis/PoolInfoUtils.json b/abis/PoolInfoUtils.json index f4792e6..f3c9baf 100644 --- a/abis/PoolInfoUtils.json +++ b/abis/PoolInfoUtils.json @@ -1,681 +1,770 @@ [ { - "inputs": [], - "name": "BucketIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [], - "name": "BucketPriceOutOfBounds", - "type": "error" - }, - { + "type": "function", + "name": "auctionInfo", "inputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__CeilOverflow", - "type": "error" - }, - { - "inputs": [], - "name": "PRBMathSD59x18__DivInputTooSmall", - "type": "error" - }, - { - "inputs": [ + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + }, { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" + "name": "borrower_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMathSD59x18__DivOverflow", - "type": "error" - }, - { - "inputs": [ + "outputs": [ { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__Exp2InputTooBig", - "type": "error" - }, - { - "inputs": [ + "name": "kicker_", + "type": "address", + "internalType": "address" + }, { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__FromIntOverflow", - "type": "error" - }, - { - "inputs": [ + "name": "bondFactor_", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__FromIntUnderflow", - "type": "error" - }, - { - "inputs": [ + "name": "bondSize_", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__LogInputTooSmall", - "type": "error" - }, - { - "inputs": [], - "name": "PRBMathSD59x18__MulInputTooSmall", - "type": "error" - }, - { - "inputs": [ + "name": "kickTime_", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" - } - ], - "name": "PRBMathSD59x18__MulOverflow", - "type": "error" - }, - { - "inputs": [ + "name": "referencePrice_", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" - } - ], - "name": "PRBMath__MulDivFixedPointOverflow", - "type": "error" - }, - { - "inputs": [ + "name": "neutralPrice_", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" + "name": "debtToCollateral_", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "denominator", - "type": "uint256" + "name": "head_", + "type": "address", + "internalType": "address" + }, + { + "name": "next_", + "type": "address", + "internalType": "address" + }, + { + "name": "prev_", + "type": "address", + "internalType": "address" } ], - "name": "PRBMath__MulDivOverflow", - "type": "error" + "stateMutability": "view" }, { + "type": "function", + "name": "auctionStatus", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "borrower_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "auctionStatus", "outputs": [ { - "internalType": "uint256", "name": "kickTime_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "collateral_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "debtToCover_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bool", "name": "isCollateralized_", - "type": "bool" + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", "name": "price_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "neutralPrice_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referencePrice_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "debtToCollateral_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bondFactor_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "availableQuoteTokenAmount", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "availableQuoteTokenAmount", "outputs": [ { - "internalType": "uint256", "name": "amount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "borrowFeeRate", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "borrowFeeRate", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "borrowerInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "borrower_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "borrowerInfo", "outputs": [ { - "internalType": "uint256", "name": "debt_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "collateral_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "t0Np_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "thresholdPrice_", + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "bucketInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "bucketInfo", "outputs": [ { - "internalType": "uint256", "name": "price_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "quoteTokens_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "collateral_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "bucketLP_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "scale_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "exchangeRate_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "hpb", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "hpb", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "hpbIndex", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "hpbIndex", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "htp", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "htp", "outputs": [ { - "internalType": "uint256", "name": "htp_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "indexToPrice", "inputs": [ { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "indexToPrice", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "lenderInterestMargin", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "lenderInterestMargin", "outputs": [ { - "internalType": "uint256", "name": "lenderInterestMargin_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "lpToCollateral", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "lp_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "lpToCollateral", "outputs": [ { - "internalType": "uint256", "name": "collateralAmount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "lpToQuoteTokens", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "lp_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "lpToQuoteTokens", "outputs": [ { - "internalType": "uint256", "name": "quoteAmount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "lup", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "lup", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "lupIndex", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "lupIndex", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolLoansInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolLoansInfo", "outputs": [ { - "internalType": "uint256", "name": "poolSize_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "loansCount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "maxBorrower_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "pendingInflator_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "pendingInterestFactor_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolPricesInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolPricesInfo", "outputs": [ { - "internalType": "uint256", "name": "hpb_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "hpbIndex_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "htp_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "htpIndex_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lup_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lupIndex_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolReservesInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolReservesInfo", "outputs": [ { - "internalType": "uint256", "name": "reserves_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "claimableReserves_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "claimableReservesRemaining_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "auctionPrice_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "timeRemaining_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolUtilizationInfo", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolUtilizationInfo", "outputs": [ { - "internalType": "uint256", "name": "poolMinDebtAmount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "poolCollateralization_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "poolActualUtilization_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "poolTargetUtilization_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "priceToIndex", "inputs": [ { - "internalType": "uint256", "name": "price_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "priceToIndex", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "unutilizedDepositFeeRate", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "unutilizedDepositFeeRate", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" + }, + { + "type": "error", + "name": "BucketIndexOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "BucketPriceOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__CeilOverflow", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__DivInputTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__DivOverflow", + "inputs": [ + { + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__Exp2InputTooBig", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__FromIntOverflow", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__FromIntUnderflow", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__LogInputTooSmall", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulInputTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulOverflow", + "inputs": [ + { + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PRBMath__MulDivFixedPointOverflow", + "inputs": [ + { + "name": "prod1", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PRBMath__MulDivOverflow", + "inputs": [ + { + "name": "prod1", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "internalType": "uint256" + } + ] } ] diff --git a/abis/PositionManager.json b/abis/PositionManager.json index 2f71269..160201f 100644 --- a/abis/PositionManager.json +++ b/abis/PositionManager.json @@ -1,1026 +1,1021 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "contract ERC20PoolFactory", "name": "erc20Factory_", - "type": "address" + "type": "address", + "internalType": "contract ERC20PoolFactory" }, { - "internalType": "contract ERC721PoolFactory", "name": "erc721Factory_", - "type": "address" + "type": "address", + "internalType": "contract ERC721PoolFactory" } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "AllowanceTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "BucketBankrupt", - "type": "error" - }, - { - "inputs": [], - "name": "BucketIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [], - "name": "DeployWithZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "LiquidityNotRemoved", - "type": "error" - }, - { - "inputs": [], - "name": "NoAuth", - "type": "error" - }, - { - "inputs": [], - "name": "NoToken", - "type": "error" - }, - { - "inputs": [], - "name": "NonExistentToken", - "type": "error" - }, - { - "inputs": [], - "name": "NotAjnaPool", - "type": "error" - }, - { - "inputs": [], - "name": "NotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__Exp2InputTooBig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__FromIntOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__FromIntUnderflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "x", - "type": "int256" - } - ], - "name": "PRBMathSD59x18__LogInputTooSmall", - "type": "error" - }, - { - "inputs": [], - "name": "PRBMathSD59x18__MulInputTooSmall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "rAbs", - "type": "uint256" - } - ], - "name": "PRBMathSD59x18__MulOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "prod1", - "type": "uint256" - } - ], - "name": "PRBMath__MulDivFixedPointOverflow", - "type": "error" - }, - { - "inputs": [], - "name": "PermitExpired", - "type": "error" - }, - { - "inputs": [], - "name": "RemovePositionFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WrongPool", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Burn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" - } - ], - "name": "MemorializePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Mint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fromIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "toIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lpRedeemedFrom", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lpAwardedTo", - "type": "uint256" - } - ], - "name": "MoveLiquidity", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "indexes", - "type": "uint256[]" - } - ], - "name": "RedeemPosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], + "type": "function", "name": "DOMAIN_SEPARATOR", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "PERMIT_TYPEHASH", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "approve", "inputs": [ { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "approve", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "balanceOf", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "balanceOf", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "burn", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "burn", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "getApproved", "inputs": [ { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getApproved", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getLP", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getLP", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getPositionIndexes", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getPositionIndexes", "outputs": [ { - "internalType": "uint256[]", "name": "", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getPositionIndexesFiltered", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getPositionIndexesFiltered", "outputs": [ { - "internalType": "uint256[]", "name": "filteredIndexes_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getPositionInfo", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getPositionInfo", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "isAjnaPool", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "bytes32", "name": "subsetHash_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "isAjnaPool", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "isApprovedForAll", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "isApprovedForAll", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "isIndexInPosition", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "isIndexInPosition", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "isPositionBucketBankrupt", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "isPositionBucketBankrupt", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "memorializePositions", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256[]", "name": "indexes_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "memorializePositions", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "mint", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "bytes32", "name": "poolSubsetHash_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "mint", "outputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "moveLiquidity", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "fromIndex_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "toIndex_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "expiry_", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "revertIfBelowLup_", - "type": "bool" + "type": "uint256", + "internalType": "uint256" } ], - "name": "moveLiquidity", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "multicall", "inputs": [ { - "internalType": "bytes[]", "name": "data", - "type": "bytes[]" + "type": "bytes[]", + "internalType": "bytes[]" } ], - "name": "multicall", "outputs": [ { - "internalType": "bytes[]", "name": "results", - "type": "bytes[]" + "type": "bytes[]", + "internalType": "bytes[]" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "name", + "inputs": [], "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "nonces", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "nonces", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "ownerOf", "inputs": [ { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "ownerOf", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "permit", "inputs": [ { - "internalType": "address", "name": "spender_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "deadline_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "signature_", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" } ], - "name": "permit", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "poolKey", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "poolKey", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "redeemPositions", "inputs": [ { - "internalType": "address", "name": "pool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256[]", "name": "indexes_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "redeemPositions", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "safeTransferFrom", "inputs": [ { - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "safeTransferFrom", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "safeTransferFrom", "inputs": [ { - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "data", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" } ], - "name": "safeTransferFrom", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "setApprovalForAll", "inputs": [ { - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "bool", "name": "approved", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "name": "setApprovalForAll", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "supportsInterface", "inputs": [ { - "internalType": "bytes4", "name": "interfaceId", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "name": "supportsInterface", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "symbol", + "inputs": [], "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "tokenURI", "inputs": [ { - "internalType": "uint256", "name": "tokenId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "tokenURI", "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "string", + "internalType": "string" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "transferFrom", "inputs": [ { - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "to", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "tokenId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "transferFrom", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "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" + } + ], + "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" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Burn", + "inputs": [ + { + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MemorializePosition", + "inputs": [ + { + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Mint", + "inputs": [ + { + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "pool", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MoveLiquidity", + "inputs": [ + { + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "fromIndex", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "toIndex", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpRedeemedFrom", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "lpAwardedTo", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RedeemPosition", + "inputs": [ + { + "name": "lender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "indexes", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + } + ], + "anonymous": false + }, + { + "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" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AllowanceTooLow", + "inputs": [] + }, + { + "type": "error", + "name": "BucketBankrupt", + "inputs": [] + }, + { + "type": "error", + "name": "BucketIndexOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "DeployWithZeroAddress", + "inputs": [] + }, + { + "type": "error", + "name": "LiquidityNotRemoved", + "inputs": [] + }, + { + "type": "error", + "name": "NoAuth", + "inputs": [] + }, + { + "type": "error", + "name": "NoToken", + "inputs": [] + }, + { + "type": "error", + "name": "NonExistentToken", + "inputs": [] + }, + { + "type": "error", + "name": "NotAjnaPool", + "inputs": [] + }, + { + "type": "error", + "name": "NotAuthorized", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__Exp2InputTooBig", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__FromIntOverflow", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__FromIntUnderflow", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__LogInputTooSmall", + "inputs": [ + { + "name": "x", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulInputTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__MulOverflow", + "inputs": [ + { + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PRBMath__MulDivFixedPointOverflow", + "inputs": [ + { + "name": "prod1", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PermitExpired", + "inputs": [] + }, + { + "type": "error", + "name": "RemovePositionFailed", + "inputs": [] + }, + { + "type": "error", + "name": "WrongPool", + "inputs": [] } ] diff --git a/copy-abis.sh b/copy-abis.sh index d0db902..5475459 100755 --- a/copy-abis.sh +++ b/copy-abis.sh @@ -11,9 +11,15 @@ rm abis/* jq '.abi' "${ABI_PATH_CONTRACTS}/ERC20.sol/ERC20.json" > abis/ERC20.json jq '.abi' "${ABI_PATH_CONTRACTS}/ERC20Pool.sol/ERC20Pool.json" > abis/ERC20Pool.json jq '.abi' "${ABI_PATH_CONTRACTS}/ERC20PoolFactory.sol/ERC20PoolFactory.json" > abis/ERC20PoolFactory.json +jq '.abi' "${ABI_PATH_CONTRACTS}/ERC721.sol/ERC721.json" > abis/ERC721.json +jq '.abi' "${ABI_PATH_CONTRACTS}/ERC721Pool.sol/ERC721Pool.json" > abis/ERC721Pool.json jq '.abi' "${ABI_PATH_CONTRACTS}/ERC721PoolFactory.sol/ERC721PoolFactory.json" > abis/ERC721PoolFactory.json jq '.abi' "${ABI_PATH_CONTRACTS}/PoolInfoUtils.sol/PoolInfoUtils.json" > abis/PoolInfoUtils.json +jq '.abi' "${ABI_PATH_CONTRACTS}/PoolInfoUtilsMulticall.sol/PoolInfoUtilsMulticall.json" > abis/PoolInfoUtilsMulticall.json + jq '.abi' "${ABI_PATH_CONTRACTS}/PositionManager.sol/PositionManager.json" > abis/PositionManager.json -jq '.abi' "${ABI_PATH_CONTRACTS}/RewardsManager.sol/RewardsManager.json" > abis/RewardsManager.json -jq '.abi' "${ABI_PATH_GRANTS}/GrantFund.sol/GrantFund.json" > abis/GrantFund.json \ No newline at end of file +jq '.abi' "${ABI_PATH_GRANTS}/GrantFund.sol/GrantFund.json" > abis/GrantFund.json +jq '.abi' "${ABI_PATH_GRANTS}/AjnaToken.sol/AjnaToken.json" > abis/AjnaToken.json + +# Note this removes the needed BurnWrappedAjna ABI diff --git a/schema.graphql b/schema.graphql index d45cec4..c0cc99f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -193,10 +193,14 @@ type Loan @entity { liquidationAuction: LiquidationAuction # collateral tokens deposited in a pool by the borrower collateralPledged: BigDecimal! + # borrower's threshold price + thresholdPrice: BigDecimal! # list of tokenIds pledged by the borrower tokenIdsPledged: [BigInt!]! # debt in T0 terms, useful when the caller knows the pending inflator t0debt: BigDecimal! + # borrowers t0 neutral price + t0Np: BigDecimal! } type Account @entity { @@ -264,6 +268,7 @@ type LiquidationAuction @entity { bondFactor: BigDecimal! # bond factor determining the reward or penalty for the kicker neutralPrice: BigDecimal! # price at which kicker will have their bond returned without penalty or reward referencePrice: BigDecimal! # max(HTP, NP) used in auction price curve + thresholdPrice: BigDecimal! # Threshold price stamped on the liquidation at time of kick } # tracks the reserve auction process across multiple takes in a single auction diff --git a/src/mappings/erc-20-pool.ts b/src/mappings/erc-20-pool.ts index c31faf9..12eacf5 100644 --- a/src/mappings/erc-20-pool.ts +++ b/src/mappings/erc-20-pool.ts @@ -46,7 +46,7 @@ import { } from "../../generated/schema" import { ZERO_BD, ONE_BI } from "../utils/constants" -import { addressToBytes, wadToDecimal } from "../utils/convert" +import { addressToBytes, wadToDecimal } from '../utils/convert'; import { loadOrCreateAccount, updateAccountLends, updateAccountLoans, updateAccountPools, updateAccountKicks, updateAccountTakes, updateAccountSettles } from "../utils/account" import { getBucketId, getBucketInfo, loadOrCreateBucket, updateBucketLends } from "../utils/pool/bucket" import { getLendId, loadOrCreateLend, saveOrRemoveLend } from "../utils/pool/lend" @@ -97,6 +97,8 @@ export function handleDrawDebt(event: DrawDebtEvent): void { const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // update account's list of pools and loans if necessary updateAccountPools(account, pool) @@ -149,6 +151,8 @@ export function handleRepayDebt(event: RepayDebtEvent): void { const borrowerInfo = getBorrowerInfo(accountId, pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // update account loans if necessary updateAccountLoans(account, loan) @@ -437,6 +441,8 @@ export function handleBucketTake(event: BucketTakeEvent): void { const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // retrieve auction information on the take's auction const auctionInfo = getAuctionInfoERC20Pool(bucketTake.borrower, pool) @@ -550,6 +556,8 @@ export function handleTake(event: TakeEvent): void { const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // update liquidation auction state const auctionId = loan.liquidationAuction! diff --git a/src/mappings/erc-721-pool.ts b/src/mappings/erc-721-pool.ts index 49eaf87..7ed6261 100644 --- a/src/mappings/erc-721-pool.ts +++ b/src/mappings/erc-721-pool.ts @@ -52,7 +52,7 @@ import { getBucketId, getBucketInfo, loadOrCreateBucket, updateBucketLends } fro import { addressToBytes, decimalToWad, wadToDecimal } from "../utils/convert" import { ZERO_BD, ONE_BI, ONE_WAD_BI } from "../utils/constants" import { getLendId, loadOrCreateLend, saveOrRemoveLend } from "../utils/pool/lend" -import { getBorrowerInfoERC721Pool, getLoanId, loadOrCreateLoan, saveOrRemoveLoan } from "../utils/pool/loan" +import { getBorrowerInfo, getLoanId, loadOrCreateLoan, saveOrRemoveLoan } from "../utils/pool/loan" import { getLiquidationAuctionId, loadOrCreateLiquidationAuction, updateLiquidationAuction, getAuctionStatus, loadOrCreateBucketTake, getAuctionInfoERC721Pool } from "../utils/pool/liquidation" import { updatePool, addLiquidationToPool, getLenderInfoERC721Pool } from "../utils/pool/pool" import { lpbValueInQuote } from "../utils/pool/lend" @@ -92,9 +92,11 @@ export function handleDrawDebtNFT(event: DrawDebtNFTEvent): void { // update loan state const loanId = getLoanId(pool.id, accountId) const loan = loadOrCreateLoan(loanId, pool.id, drawDebtNFT.borrower) - const borrowerInfo = getBorrowerInfoERC721Pool(addressToBytes(event.params.borrower), pool.id) + const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) loan.tokenIdsPledged = loan.tokenIdsPledged.concat(event.params.tokenIdsPledged) // update account's list of pools and loans if necessary @@ -139,9 +141,11 @@ export function handleRepayDebt(event: RepayDebtEvent): void { const loanId = getLoanId(pool.id, accountId) const loan = loadOrCreateLoan(loanId, pool.id, repayDebt.borrower) - const borrowerInfo = getBorrowerInfoERC721Pool(accountId, pool.id) + const borrowerInfo = getBorrowerInfo(accountId, pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // retrieve the tokenIdsPledged that were pulled in this event const numberOfTokensPulled = event.params.collateralPulled.div(ONE_WAD_BI).toI32() @@ -622,9 +626,11 @@ export function handleBucketTake(event: BucketTakeEvent): void { // update loan state const loanId = getLoanId(pool.id, addressToBytes(event.params.borrower)) const loan = loadOrCreateLoan(loanId, pool.id, addressToBytes(event.params.borrower)) - const borrowerInfo = getBorrowerInfoERC721Pool(addressToBytes(event.params.borrower), pool.id) + const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // unique to ERC721Pools // remove collateral taken from loan and pool @@ -748,9 +754,11 @@ export function handleTake(event: TakeEvent): void { // update loan state const loanId = getLoanId(pool.id, addressToBytes(event.params.borrower)) const loan = Loan.load(loanId)! - const borrowerInfo = getBorrowerInfoERC721Pool(addressToBytes(event.params.borrower), pool.id) + const borrowerInfo = getBorrowerInfo(addressToBytes(event.params.borrower), pool.id) loan.collateralPledged = wadToDecimal(borrowerInfo.collateral) loan.t0debt = wadToDecimal(borrowerInfo.t0debt) + loan.t0Np = wadToDecimal(borrowerInfo.t0Np) + loan.thresholdPrice = wadToDecimal(borrowerInfo.thresholdPrice) // remove tokenIdsTaken from loan and pool tokenIdsPledged const numberOfTokensToTake = getWadCollateralFloorTokens(event.params.collateral).toI32() diff --git a/src/utils/pool/liquidation.ts b/src/utils/pool/liquidation.ts index 44c9346..e56d5b9 100644 --- a/src/utils/pool/liquidation.ts +++ b/src/utils/pool/liquidation.ts @@ -82,6 +82,7 @@ export function updateLiquidationAuction( liquidationAuction.kickTime = auctionInfo.kickTime liquidationAuction.neutralPrice = wadToDecimal(auctionInfo.neutralPrice) liquidationAuction.referencePrice = wadToDecimal(auctionInfo.referencePrice) + liquidationAuction.thresholdPrice = wadToDecimal(auctionInfo.thresholdPrice) } // update remaining quantities even if auction was settled and they are 0 @@ -99,16 +100,18 @@ export class AuctionInfo { kickTime: BigInt referencePrice: BigInt neutralPrice: BigInt + thresholdPrice: BigInt head: Address next: Address prev: Address - constructor(kicker: Address, bondFactor: BigInt, bondSize: BigInt, kickTime: BigInt, referencePrice: BigInt, neutralPrice: BigInt, head: Address, next: Address, prev: Address) { + constructor(kicker: Address, bondFactor: BigInt, bondSize: BigInt, kickTime: BigInt, referencePrice: BigInt, neutralPrice: BigInt, thresholdPrice: BigInt, head: Address, next: Address, prev: Address) { this.kicker = kicker this.bondFactor = bondFactor this.bondSize = bondSize this.kickTime = kickTime this.referencePrice = referencePrice this.neutralPrice = neutralPrice + this.thresholdPrice = thresholdPrice this.head = head this.next = next this.prev = prev @@ -126,7 +129,8 @@ export function getAuctionInfoERC20Pool(borrower: Bytes, pool: Pool): AuctionInf auctionInfoResult.value5, auctionInfoResult.value6, auctionInfoResult.value7, - auctionInfoResult.value8 + auctionInfoResult.value8, + auctionInfoResult.value9 ) return auctionInfo } @@ -142,7 +146,8 @@ export function getAuctionInfoERC721Pool(borrower: Bytes, pool: Pool): AuctionIn auctionInfoResult.value5, auctionInfoResult.value6, auctionInfoResult.value7, - auctionInfoResult.value8 + auctionInfoResult.value8, + auctionInfoResult.value9 ) return auctionInfo } @@ -154,13 +159,19 @@ export class AuctionStatus { isCollateralized: bool price: BigInt neutralPrice: BigInt - constructor(kickTime: BigInt, collateral: BigInt, debtToCover: BigInt, isCollateralized: bool, price: BigInt, neutralPrice: BigInt) { + referencePrice: BigInt + thresholdPrice: BigInt + bondFactor: BigInt + constructor(kickTime: BigInt, collateral: BigInt, debtToCover: BigInt, isCollateralized: bool, price: BigInt, neutralPrice: BigInt, referencePrice: BigInt, thresholdPrice: BigInt, bondFactor: BigInt) { this.kickTime = kickTime this.collateral = collateral this.debtToCover = debtToCover this.isCollateralized = isCollateralized this.price = price this.neutralPrice = neutralPrice + this.referencePrice = referencePrice + this.thresholdPrice = thresholdPrice + this.bondFactor = bondFactor } } export function getAuctionStatus(pool: Pool, borrower: Address): AuctionStatus { @@ -173,6 +184,9 @@ export function getAuctionStatus(pool: Pool, borrower: Address): AuctionStatus { result.value2, result.value3, result.value4, - result.value5 + result.value5, + result.value6, + result.value7, + result.value8 ) } diff --git a/src/utils/pool/loan.ts b/src/utils/pool/loan.ts index 4d10e35..5792d89 100644 --- a/src/utils/pool/loan.ts +++ b/src/utils/pool/loan.ts @@ -21,6 +21,8 @@ export function loadOrCreateLoan(loanId: Bytes, poolId: Bytes, borrower: Bytes): loan.poolAddress = poolId.toHexString() loan.collateralPledged = ZERO_BD loan.t0debt = ZERO_BD + loan.t0Np = ZERO_BD + loan.thresholdPrice = ZERO_BD loan.inLiquidation = false loan.liquidationAuction = null loan.tokenIdsPledged = [] @@ -46,31 +48,24 @@ export class BorrowerInfo { t0debt: BigInt collateral: BigInt t0Np: BigInt - constructor(t0debt: BigInt, collateral: BigInt, t0Np: BigInt) { + thresholdPrice: BigInt + constructor(t0debt: BigInt, collateral: BigInt, t0Np: BigInt, thresholdPrice: BigInt) { this.t0debt = t0debt this.collateral = collateral this.t0Np = t0Np + this.thresholdPrice = thresholdPrice } } export function getBorrowerInfo(borrower: Bytes, poolId: Bytes): BorrowerInfo { - const poolContract = ERC20Pool.bind(Address.fromBytes(poolId)) - const borrowerInfoResult = poolContract.borrowerInfo(Address.fromBytes(borrower)) + const poolInfoUtilsAddress = poolInfoUtilsAddressTable.get(dataSource.network())! + const poolInfoUtilsContract = PoolInfoUtils.bind(poolInfoUtilsAddress) + const borrowerInfoResult = poolInfoUtilsContract.borrowerInfo(Address.fromBytes(poolId), Address.fromBytes(borrower)) return new BorrowerInfo( borrowerInfoResult.value0, borrowerInfoResult.value1, - borrowerInfoResult.value2 - ) -} - -export function getBorrowerInfoERC721Pool(borrower: Bytes, poolId: Bytes): BorrowerInfo { - const poolContract = ERC721Pool.bind(Address.fromBytes(poolId)) - const borrowerInfoResult = poolContract.borrowerInfo(Address.fromBytes(borrower)) - - return new BorrowerInfo( - borrowerInfoResult.value0, - borrowerInfoResult.value1, - borrowerInfoResult.value2 + borrowerInfoResult.value2, + borrowerInfoResult.value3 ) } diff --git a/subgraph.yaml b/subgraph.yaml index e6bc1ce..16b0fc3 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -69,7 +69,7 @@ dataSources: - name: PoolInfoUtils file: ./abis/PoolInfoUtils.json eventHandlers: - - event: PoolCreated(address) + - event: PoolCreated(address,bytes32) handler: handlePoolCreated file: ./src/mappings/erc-20-pool-factory.ts network: goerli @@ -97,7 +97,7 @@ dataSources: - name: PoolInfoUtils file: ./abis/PoolInfoUtils.json eventHandlers: - - event: PoolCreated(address) + - event: PoolCreated(address,bytes32) handler: handlePoolCreated file: ./src/mappings/erc-721-pool-factory.ts network: goerli diff --git a/tests/erc-20-pool.test.ts b/tests/erc-20-pool.test.ts index 6bd7df7..77202a7 100644 --- a/tests/erc-20-pool.test.ts +++ b/tests/erc-20-pool.test.ts @@ -24,7 +24,7 @@ import { addressToBytes, wadToDecimal } from "../src/utils/convert" import { FIVE_PERCENT_BI, MAX_PRICE, MAX_PRICE_BI, MAX_PRICE_INDEX, ONE_BI, ONE_PERCENT_BI, ONE_WAD_BI, TWO_BI, ZERO_ADDRESS, ZERO_BD, ZERO_BI } from '../src/utils/constants'; import { Account, Lend, Loan, Pool } from "../generated/schema" import { getLendId } from "../src/utils/pool/lend" -import { BorrowerInfo, getLoanId } from "../src/utils/pool/loan" +import { BorrowerInfo, getLoanId, thresholdPrice } from '../src/utils/pool/loan'; import { AuctionInfo, AuctionStatus, getLiquidationAuctionId } from "../src/utils/pool/liquidation" import { BurnInfo, DebtInfo } from "../src/utils/pool/pool" import { getReserveAuctionId } from "../src/utils/pool/reserve-auction" @@ -468,8 +468,8 @@ describe("ERC20Pool assertions", () => { const collateralPledged = BigInt.fromI32(1067) const lup = BigInt.fromString("9529276179422528643") // 9.529276179422528643 * 1e18 const index = BigInt.fromI32(234) - const inflator = BigInt.fromString("1002804000000000000") + const thresholdPrice = amountBorrowed.div(collateralPledged) mockPoolInfoUtilsPoolUpdateCalls(poolAddress, { poolSize: ZERO_BI, @@ -498,7 +498,9 @@ describe("ERC20Pool assertions", () => { const expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), collateralPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // mock drawDebt event @@ -597,8 +599,10 @@ describe("ERC20Pool assertions", () => { const quoteRepaid = BigInt.fromString("567111000000000000000") // 567.111 * 1e18 const collateralPulled = BigInt.fromString("13400500000000000000") // 13.4005 * 1e18 const lup = BigInt.fromString("63480000000000000000") // 63.48 * 1e18 + const thresholdPrice = quoteRepaid.div(collateralPulled) - const expectedBorrowerInfo = new BorrowerInfo(quoteRepaid, collateralPulled, BigInt.fromString("501250000000000000")) + // TODO: fix mismatch between using pre-repay and post-repay update returns + const expectedBorrowerInfo = new BorrowerInfo(quoteRepaid, collateralPulled, BigInt.fromString("501250000000000000"), thresholdPrice) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) const newRepayDebtEvent = createRepayDebtEvent( @@ -654,6 +658,7 @@ describe("ERC20Pool assertions", () => { const kickTime = BigInt.fromI32(123) const neutralPrice = BigInt.fromI32(456) const referencePrice = BigInt.fromI32(456) + const thresholdPrice = debt.div(collateral) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -665,6 +670,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -676,7 +682,10 @@ describe("ERC20Pool assertions", () => { debt, false, startPrice, - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) @@ -836,6 +845,7 @@ describe("ERC20Pool assertions", () => { const kickTime = BigInt.fromI32(123) const referencePrice = BigInt.fromI32(456) const neutralPrice = BigInt.fromI32(456) + const thresholdPrice = debt.div(collateral) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -847,6 +857,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -857,7 +868,9 @@ describe("ERC20Pool assertions", () => { let expectedBorrowerInfo = new BorrowerInfo( wdiv(debt, inflator), collateral, - wdiv(neutralPrice, inflator)) + wdiv(neutralPrice, inflator), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // mock kick event @@ -883,6 +896,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -894,13 +908,18 @@ describe("ERC20Pool assertions", () => { debt, false, wmul(neutralPrice, BigInt.fromString("970000000000000000")), // take price = neutral price * 0.97 - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) expectedBorrowerInfo = new BorrowerInfo( wdiv(debt, inflator), collateral.minus(amountToTake), - wdiv(neutralPrice, inflator)) + wdiv(neutralPrice, inflator), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // mock take event @@ -1024,6 +1043,7 @@ describe("ERC20Pool assertions", () => { const kickTime = BigInt.fromI32(123) const referencePrice = BigInt.fromI32(456) const neutralPrice = BigInt.fromI32(456) + const thresholdPrice = debt.div(collateral) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -1034,6 +1054,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1063,6 +1084,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1074,7 +1096,10 @@ describe("ERC20Pool assertions", () => { debt, false, wmul(neutralPrice, BigInt.fromString("1020000000000000000")), // take price = neutral price * 1.02 - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) @@ -1216,6 +1241,7 @@ describe("ERC20Pool assertions", () => { const kickTime = BigInt.fromI32(123) const referencePrice = BigInt.fromI32(456) const neutralPrice = BigInt.fromI32(456) + const thresholdPrice = debt.div(collateral) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -1226,6 +1252,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev diff --git a/tests/erc-721-pool.test.ts b/tests/erc-721-pool.test.ts index 817d70d..66b8666 100644 --- a/tests/erc-721-pool.test.ts +++ b/tests/erc-721-pool.test.ts @@ -20,7 +20,7 @@ import { mockGetAuctionInfo, mockGetAuctionStatus, mockGetBorrowerInfo, mockGetB import { BucketInfo, getBucketId } from "../src/utils/pool/bucket" import { addressToBytes, wadToDecimal } from "../src/utils/convert" import { DebtInfo } from "../src/utils/pool/pool" -import { BorrowerInfo, getLoanId } from "../src/utils/pool/loan" +import { BorrowerInfo, getLoanId, thresholdPrice } from '../src/utils/pool/loan'; import { wdiv, wmul } from "../src/utils/math" import { getLendId } from "../src/utils/pool/lend" import { AuctionInfo, AuctionStatus, getLiquidationAuctionId } from "../src/utils/pool/liquidation" @@ -257,8 +257,8 @@ describe("Describe entity assertions", () => { const amountPledged = BigInt.fromString("2000000000000000000") const lup = BigInt.fromString("9529276179422528643") // 9.529276179422528643 * 1e18 const index = BigInt.fromI32(123) - const inflator = BigInt.fromString("1002804000000000000") + const thresholdPrice = amountBorrowed.div(amountPledged) mockPoolInfoUtilsPoolUpdateCalls(poolAddress, { poolSize: ZERO_BI, @@ -287,7 +287,9 @@ describe("Describe entity assertions", () => { const expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) const newDrawDebtEvent = createDrawDebtNFTEvent( @@ -404,6 +406,7 @@ describe("Describe entity assertions", () => { const tokenIdsPledged = [BigInt.fromI32(234), BigInt.fromI32(345)] const amountPledged = BigInt.fromString("2000000000000000000") let lup = BigInt.fromString("9529276179422528643") // 9.529276179422528643 * 1e18 + const thresholdPrice = amountBorrowed.div(amountPledged) // mock required contract calls const expectedPoolDebtInfo = new DebtInfo(amountBorrowed, ZERO_BI, ZERO_BI, ZERO_BI) @@ -413,7 +416,9 @@ describe("Describe entity assertions", () => { let expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) const newDrawDebtEvent = createDrawDebtNFTEvent( @@ -456,7 +461,7 @@ describe("Describe entity assertions", () => { const quoteRepaid = BigInt.fromString("567111000000000000000") // 567.111 * 1e18 const collateralPulled = BigInt.fromString("1000000000000000000") // 1 * 1e18 - expectedBorrowerInfo = new BorrowerInfo(quoteRepaid, collateralPulled, BigInt.fromString("501250000000000000")) + expectedBorrowerInfo = new BorrowerInfo(quoteRepaid, collateralPulled, BigInt.fromString("501250000000000000"), thresholdPrice) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) const newRepayDebtEvent = createRepayDebtEvent( @@ -759,6 +764,7 @@ describe("Describe entity assertions", () => { const tokenIdsPledged = [BigInt.fromI32(234), BigInt.fromI32(345), BigInt.fromI32(456), BigInt.fromI32(567), BigInt.fromI32(789)] const amountPledged = BigInt.fromString("5000000000000000000") // 5 * 1e18 const lup = BigInt.fromString("9529276179422528643") // 9.529276179422528643 * 1e18 + let thresholdPrice = amountBorrowed.div(amountPledged) // mock required contract calls const expectedPoolDebtInfo = new DebtInfo(amountBorrowed, ZERO_BI, ZERO_BI, ZERO_BI) @@ -768,7 +774,9 @@ describe("Describe entity assertions", () => { let expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // create and handle DrawDebt event @@ -818,6 +826,7 @@ describe("Describe entity assertions", () => { const kickTime = BigInt.fromI32(123) const referencePrice = BigInt.fromI32(456) const neutralPrice = BigInt.fromI32(456) + thresholdPrice = debt.div(amountPledged) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -830,6 +839,7 @@ describe("Describe entity assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -842,7 +852,10 @@ describe("Describe entity assertions", () => { debt, false, wmul(neutralPrice, BigInt.fromString("1020000000000000000")), // take price = neutral price * 1.02 - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) @@ -872,7 +885,9 @@ describe("Describe entity assertions", () => { expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged.minus(collateralToTake), - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // create and handle Take event @@ -1152,6 +1167,7 @@ describe("Describe entity assertions", () => { const amountBorrowed = BigInt.fromString("567529276179422528643") // 567.529276179422528643 * 1e18 const tokenIdsPledged = [BigInt.fromI32(234), BigInt.fromI32(345), BigInt.fromI32(456), BigInt.fromI32(567), BigInt.fromI32(789)] const amountPledged = BigInt.fromString("5000000000000000000") // 5 * 1e18 + let thresholdPrice = amountBorrowed.div(amountPledged) // mock required contract calls const expectedPoolDebtInfo = new DebtInfo(amountBorrowed, ZERO_BI, ZERO_BI, ZERO_BI) @@ -1161,7 +1177,9 @@ describe("Describe entity assertions", () => { let expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // create and handle DrawDebt event @@ -1211,6 +1229,7 @@ describe("Describe entity assertions", () => { const kickTime = BigInt.fromI32(123) const referencePrice = BigInt.fromI32(456) const neutralPrice = BigInt.fromI32(456) + thresholdPrice = debt.div(amountPledged) const head = Address.fromString("0x0000000000000000000000000000000000000000") const next = Address.fromString("0x0000000000000000000000000000000000000000") const prev = Address.fromString("0x0000000000000000000000000000000000000000") @@ -1223,6 +1242,7 @@ describe("Describe entity assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1235,7 +1255,10 @@ describe("Describe entity assertions", () => { debt, false, wmul(neutralPrice, BigInt.fromString("1020000000000000000")), // take price = neutral price * 1.02 - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) @@ -1296,7 +1319,9 @@ describe("Describe entity assertions", () => { expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged.minus(collateralToTake), - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // mock bucket take event diff --git a/tests/utils/mock-contract-calls.ts b/tests/utils/mock-contract-calls.ts index 25375ce..8d2dcb2 100644 --- a/tests/utils/mock-contract-calls.ts +++ b/tests/utils/mock-contract-calls.ts @@ -5,7 +5,7 @@ import { BucketInfo } from "../../src/utils/pool/bucket" import { positionManagerAddressTable, poolInfoUtilsAddressTable, ZERO_BI, ONE_BI, poolInfoUtilsMulticallAddressTable } from '../../src/utils/constants'; import { BurnInfo, DebtInfo, LoansInfo, PoolPricesInfo, PoolUtilizationInfo, ReservesInfo, PoolDetails, RatesAndFees, PoolBalanceDetails, depositUpToIndex } from '../../src/utils/pool/pool'; import { AuctionInfo, AuctionStatus } from "../../src/utils/pool/liquidation" -import { BorrowerInfo } from "../../src/utils/pool/loan" +import { BorrowerInfo } from '../../src/utils/pool/loan'; import { wdiv, wmin, wmul } from "../../src/utils/math" import { addressToBytes, decimalToWad } from "../../src/utils/convert" import { Pool } from "../../generated/schema" @@ -137,12 +137,13 @@ export function mockGetPositionInfo(tokenId: BigInt, bucketIndex: BigInt, expect /***************************/ export function mockGetBorrowerInfo(pool: Address, borrower: Address, expectedInfo: BorrowerInfo): void { - createMockedFunction(pool, 'borrowerInfo', 'borrowerInfo(address):(uint256,uint256,uint256)') - .withArgs([ethereum.Value.fromAddress(borrower)]) + createMockedFunction(poolInfoUtilsAddressTable.get(dataSource.network())!, 'borrowerInfo', 'borrowerInfo(address,address):(uint256,uint256,uint256,uint256)') + .withArgs([ethereum.Value.fromAddress(pool), ethereum.Value.fromAddress(borrower)]) .returns([ ethereum.Value.fromUnsignedBigInt(expectedInfo.t0debt), ethereum.Value.fromUnsignedBigInt(expectedInfo.collateral), - ethereum.Value.fromUnsignedBigInt(expectedInfo.t0Np) + ethereum.Value.fromUnsignedBigInt(expectedInfo.t0Np), + ethereum.Value.fromUnsignedBigInt(expectedInfo.thresholdPrice) ]) } @@ -326,7 +327,7 @@ export function mockGetPoolBalanceDetails(pool: Address, meaningfulIndex: BigInt // mock auctionInfo contract calls export function mockGetAuctionInfo(borrower: Address, pool: Address, expectedInfo: AuctionInfo): void { - createMockedFunction(pool, 'auctionInfo', 'auctionInfo(address):(address,uint256,uint256,uint256,uint256,uint256,address,address,address)') + createMockedFunction(pool, 'auctionInfo', 'auctionInfo(address):(address,uint256,uint256,uint256,uint256,uint256,uint256,address,address,address)') .withArgs([ethereum.Value.fromAddress(borrower)]) .returns([ ethereum.Value.fromAddress(expectedInfo.kicker), @@ -335,6 +336,7 @@ export function mockGetAuctionInfo(borrower: Address, pool: Address, expectedInf ethereum.Value.fromUnsignedBigInt(expectedInfo.kickTime), ethereum.Value.fromUnsignedBigInt(expectedInfo.referencePrice), ethereum.Value.fromUnsignedBigInt(expectedInfo.neutralPrice), + ethereum.Value.fromUnsignedBigInt(expectedInfo.thresholdPrice), ethereum.Value.fromAddress(expectedInfo.head), ethereum.Value.fromAddress(expectedInfo.next), ethereum.Value.fromAddress(expectedInfo.prev) @@ -344,15 +346,18 @@ export function mockGetAuctionInfo(borrower: Address, pool: Address, expectedInf // mock auctionStatus poolInfoUtils calls export function mockGetAuctionStatus(pool: Address, borrower: Address, expectedInfo: AuctionStatus): void { createMockedFunction(poolInfoUtilsAddressTable.get(dataSource.network())!, - 'auctionStatus', 'auctionStatus(address,address):(uint256,uint256,uint256,bool,uint256,uint256)') + 'auctionStatus', 'auctionStatus(address,address):(uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256)') .withArgs([ethereum.Value.fromAddress(pool), ethereum.Value.fromAddress(borrower)]) .returns([ - ethereum.Value.fromUnsignedBigInt(expectedInfo.kickTime), - ethereum.Value.fromUnsignedBigInt(expectedInfo.collateral), - ethereum.Value.fromUnsignedBigInt(expectedInfo.debtToCover), - ethereum.Value.fromBoolean(expectedInfo.isCollateralized), - ethereum.Value.fromUnsignedBigInt(expectedInfo.price), - ethereum.Value.fromUnsignedBigInt(expectedInfo.neutralPrice) + ethereum.Value.fromUnsignedBigInt(expectedInfo.kickTime), + ethereum.Value.fromUnsignedBigInt(expectedInfo.collateral), + ethereum.Value.fromUnsignedBigInt(expectedInfo.debtToCover), + ethereum.Value.fromBoolean(expectedInfo.isCollateralized), + ethereum.Value.fromUnsignedBigInt(expectedInfo.price), + ethereum.Value.fromUnsignedBigInt(expectedInfo.neutralPrice), + ethereum.Value.fromUnsignedBigInt(expectedInfo.referencePrice), + ethereum.Value.fromUnsignedBigInt(expectedInfo.thresholdPrice), + ethereum.Value.fromUnsignedBigInt(expectedInfo.bondFactor) ]) }