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..e64354f 100644 --- a/abis/AjnaToken.json +++ b/abis/AjnaToken.json @@ -1,366 +1,674 @@ [ { + "type": "constructor", "inputs": [ - { "internalType": "address", "name": "tokenReceiver_", "type": "address" } + { + "name": "tokenReceiver_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "allowance", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "spender", - "type": "address" - }, + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AjnaTokenApproval", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "approve", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" + "name": "spender", + "type": "address", + "internalType": "address" }, { - "indexed": true, - "internalType": "address", - "name": "fromDelegate", - "type": "address" - }, + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "toDelegate", - "type": "address" + "name": "", + "type": "bool", + "internalType": "bool" } ], - "name": "DelegateChanged", - "type": "event" + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "function", + "name": "balanceOf", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "delegate", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousBalance", - "type": "uint256" - }, + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "DelegateVotesChanged", - "type": "event" + "stateMutability": "view" }, { - "anonymous": false, + "type": "function", + "name": "burn", "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "burnFrom", + "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + "name": "account", + "type": "address", + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" + "name": "amount", + "type": "uint256", + "internalType": "uint256" } ], - "name": "AjnaTokenTransfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "checkpoints", "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } + { + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "pos", + "type": "uint32", + "internalType": "uint32" + } ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "tuple", + "internalType": "struct ERC20Votes.Checkpoint", + "components": [ + { + "name": "fromBlock", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "votes", + "type": "uint224", + "internalType": "uint224" + } + ] + } + ], + "stateMutability": "view" }, { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "decreaseAllowance", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "subtractedValue", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "delegate", "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "name": "delegatee", + "type": "address", + "internalType": "address" + } ], - "name": "burn", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "delegateBySig", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "name": "delegatee", + "type": "address", + "internalType": "address" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "burnFrom", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "delegates", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint32", "name": "pos", "type": "uint32" } + { + "name": "account", + "type": "address", + "internalType": "address" + } ], - "name": "checkpoints", "outputs": [ { - "components": [ - { "internalType": "uint32", "name": "fromBlock", "type": "uint32" }, - { "internalType": "uint224", "name": "votes", "type": "uint224" } - ], - "internalType": "struct ERC20Votes.Checkpoint", "name": "", - "type": "tuple" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" + "type": "function", + "name": "getPastTotalSupply", + "inputs": [ + { + "name": "blockNumber", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "getPastVotes", "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "blockNumber", + "type": "uint256", + "internalType": "uint256" } ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "getVotes", "inputs": [ - { "internalType": "address", "name": "delegatee", "type": "address" } + { + "name": "account", + "type": "address", + "internalType": "address" + } ], - "name": "delegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "increaseAllowance", "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" } + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "addedValue", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "delegateBySig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } ], - "name": "delegates", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "nonces", "inputs": [ - { "internalType": "uint256", "name": "blockNumber", "type": "uint256" } + { + "name": "owner", + "type": "address", + "internalType": "address" + } ], - "name": "getPastTotalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "numCheckpoints", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "blockNumber", "type": "uint256" } + { + "name": "account", + "type": "address", + "internalType": "address" + } ], - "name": "getPastVotes", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "permit", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "deadline", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "getVotes", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } ], - "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "totalSupply", "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "transfer", "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "transferFrom", "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "numCheckpoints", - "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "transferFromWithPermit", "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" } + { + "name": "from_", + "type": "address", + "internalType": "address" + }, + { + "name": "to_", + "type": "address", + "internalType": "address" + }, + { + "name": "spender_", + "type": "address", + "internalType": "address" + }, + { + "name": "value_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "deadline_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "v_", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r_", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s_", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "permit", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "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": "DelegateChanged", "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "name": "delegator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + } ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "DelegateVotesChanged", "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "name": "delegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "previousBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "Transfer", "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" } + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } ], - "name": "transferFromWithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false } ] 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..3968b4e 100644 --- a/abis/GrantFund.json +++ b/abis/GrantFund.json @@ -1,1036 +1,1031 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "address", "name": "ajnaToken_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AlreadyVoted", - "type": "error" - }, - { - "inputs": [], - "name": "DelegateRewardInvalid", - "type": "error" - }, - { - "inputs": [], - "name": "DistributionPeriodStillActive", - "type": "error" - }, - { - "inputs": [], - "name": "ExecuteProposalInvalid", - "type": "error" - }, - { - "inputs": [], - "name": "FundingVoteWrongDirection", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientRemainingVotingPower", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientVotingPower", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProposal", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProposalSlate", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidVote", - "type": "error" - }, - { - "inputs": [], - "name": "ProposalAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "ProposalNotSuccessful", - "type": "error" - }, - { - "inputs": [], - "name": "RewardAlreadyClaimed", - "type": "error" - }, - { - "inputs": [], - "name": "ScreeningPeriodEnded", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegateeAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rewardClaimed", - "type": "uint256" - } - ], - "name": "DelegateRewardClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "startBlock", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - } - ], - "name": "DistributionPeriodStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "treasuryBalance", - "type": "uint256" - } - ], - "name": "FundTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "fundedSlateHash", - "type": "bytes32" - } - ], - "name": "FundedSlateUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "string[]", - "name": "signatures", - "type": "string[]" - }, - { - "indexed": false, - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "startBlock", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "name": "ProposalCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "ProposalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "weight", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "VoteCast", - "type": "event" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "_voterInfo", "inputs": [ { - "internalType": "uint256", "name": "distributionId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "voter", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "_voterInfo", "outputs": [ { - "internalType": "uint128", "name": "fundingVotingPower", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint128", "name": "fundingRemainingVotingPower", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint248", "name": "screeningVotesCast", - "type": "uint248" + "type": "uint248", + "internalType": "uint248" }, { - "internalType": "bool", "name": "hasClaimedReward", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "ajnaTokenAddress", + "inputs": [], "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "claimDelegateReward", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "name": "claimDelegateReward", "outputs": [ { - "internalType": "uint256", "name": "rewardClaimed_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "execute", "inputs": [ { - "internalType": "address[]", "name": "targets_", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "uint256[]", "name": "values_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "bytes[]", "name": "calldatas_", - "type": "bytes[]" + "type": "bytes[]", + "internalType": "bytes[]" }, { - "internalType": "bytes32", "name": "descriptionHash_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "execute", "outputs": [ { - "internalType": "uint256", "name": "proposalId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "fundTreasury", "inputs": [ { - "internalType": "uint256", "name": "fundingAmount_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "fundTreasury", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "fundingVote", "inputs": [ { + "name": "voteParams_", + "type": "tuple[]", + "internalType": "struct IGrantFundState.FundingVoteParams[]", "components": [ { - "internalType": "uint256", "name": "proposalId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "int256", "name": "votesUsed", - "type": "int256" + "type": "int256", + "internalType": "int256" } - ], - "internalType": "struct IGrantFundState.FundingVoteParams[]", - "name": "voteParams_", - "type": "tuple[]" + ] } ], - "name": "fundingVote", "outputs": [ { - "internalType": "uint256", "name": "votesCast_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "getChallengeStageStartBlock", "inputs": [ { - "internalType": "uint256", "name": "endBlock_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getChallengeStageStartBlock", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "getDelegateReward", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "address", "name": "voter_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getDelegateReward", "outputs": [ { - "internalType": "uint256", "name": "rewards_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getDescriptionHash", "inputs": [ { - "internalType": "string", "name": "description_", - "type": "string" + "type": "string", + "internalType": "string" } ], - "name": "getDescriptionHash", "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { - "inputs": [], + "type": "function", "name": "getDistributionId", + "inputs": [], "outputs": [ { - "internalType": "uint24", "name": "", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getDistributionPeriodInfo", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "name": "getDistributionPeriodInfo", "outputs": [ { - "internalType": "uint24", "name": "", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "uint48", "name": "", - "type": "uint48" + "type": "uint48", + "internalType": "uint48" }, { - "internalType": "uint48", "name": "", - "type": "uint48" + "type": "uint48", + "internalType": "uint48" }, { - "internalType": "uint128", "name": "", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getFundedProposalSlate", "inputs": [ { - "internalType": "bytes32", "name": "slateHash_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getFundedProposalSlate", "outputs": [ { - "internalType": "uint256[]", "name": "", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getFundingStageEndBlock", "inputs": [ { - "internalType": "uint256", "name": "startBlock_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getFundingStageEndBlock", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "getFundingVotesCast", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getFundingVotesCast", "outputs": [ { + "name": "", + "type": "tuple[]", + "internalType": "struct IGrantFundState.FundingVoteParams[]", "components": [ { - "internalType": "uint256", "name": "proposalId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "int256", "name": "votesUsed", - "type": "int256" + "type": "int256", + "internalType": "int256" } - ], - "internalType": "struct IGrantFundState.FundingVoteParams[]", - "name": "", - "type": "tuple[]" + ] } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getHasClaimedRewards", "inputs": [ { - "internalType": "uint256", "name": "distributionId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getHasClaimedRewards", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getProposalInfo", "inputs": [ { - "internalType": "uint256", "name": "proposalId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getProposalInfo", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint24", "name": "", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "uint128", "name": "", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint128", "name": "", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "int128", "name": "", - "type": "int128" + "type": "int128", + "internalType": "int128" }, { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getScreeningStageEndBlock", "inputs": [ { - "internalType": "uint256", "name": "startBlock_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getScreeningStageEndBlock", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "getScreeningVotesCast", "inputs": [ { - "internalType": "uint256", "name": "distributionId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getScreeningVotesCast", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getSlateHash", "inputs": [ { - "internalType": "uint256[]", "name": "proposalIds_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "name": "getSlateHash", "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { - "inputs": [], + "type": "function", "name": "getStage", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "stage_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getTopTenProposals", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "name": "getTopTenProposals", "outputs": [ { - "internalType": "uint256[]", "name": "", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getVoterInfo", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getVoterInfo", "outputs": [ { - "internalType": "uint128", "name": "", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint128", "name": "", - "type": "uint128" + "type": "uint128", + "internalType": "uint128" }, { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getVotesFunding", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getVotesFunding", "outputs": [ { - "internalType": "uint256", "name": "votes_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getVotesScreening", "inputs": [ { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" }, { - "internalType": "address", "name": "account_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getVotesScreening", "outputs": [ { - "internalType": "uint256", "name": "votes_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "hashProposal", "inputs": [ { - "internalType": "address[]", "name": "targets_", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "uint256[]", "name": "values_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "bytes[]", "name": "calldatas_", - "type": "bytes[]" + "type": "bytes[]", + "internalType": "bytes[]" }, { - "internalType": "bytes32", "name": "descriptionHash_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "hashProposal", "outputs": [ { - "internalType": "uint256", "name": "proposalId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "propose", "inputs": [ { - "internalType": "address[]", "name": "targets_", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "uint256[]", "name": "values_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "bytes[]", "name": "calldatas_", - "type": "bytes[]" + "type": "bytes[]", + "internalType": "bytes[]" }, { - "internalType": "string", "name": "description_", - "type": "string" + "type": "string", + "internalType": "string" } ], - "name": "propose", "outputs": [ { - "internalType": "uint256", "name": "proposalId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "screeningVote", "inputs": [ { + "name": "voteParams_", + "type": "tuple[]", + "internalType": "struct IGrantFundState.ScreeningVoteParams[]", "components": [ { - "internalType": "uint256", "name": "proposalId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votes", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } - ], - "internalType": "struct IGrantFundState.ScreeningVoteParams[]", - "name": "voteParams_", - "type": "tuple[]" + ] } ], - "name": "screeningVote", "outputs": [ { - "internalType": "uint256", "name": "votesCast_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "startNewDistributionPeriod", + "inputs": [], "outputs": [ { - "internalType": "uint24", "name": "newDistributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "state", "inputs": [ { - "internalType": "uint256", "name": "proposalId_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "state", "outputs": [ { - "internalType": "enum IGrantFundState.ProposalState", "name": "", - "type": "uint8" + "type": "uint8", + "internalType": "enum IGrantFundState.ProposalState" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "treasury", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "updateSlate", "inputs": [ { - "internalType": "uint256[]", "name": "proposalIds_", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "uint24", "name": "distributionId_", - "type": "uint24" + "type": "uint24", + "internalType": "uint24" } ], - "name": "updateSlate", "outputs": [ { - "internalType": "bool", "name": "newTopSlate_", - "type": "bool" + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "DelegateRewardClaimed", + "inputs": [ + { + "name": "delegateeAddress", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "distributionId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "rewardClaimed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DistributionPeriodStarted", + "inputs": [ + { + "name": "distributionId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "startBlock", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "endBlock", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false + }, + { + "type": "event", + "name": "FundTreasury", + "inputs": [ + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "treasuryBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FundedSlateUpdated", + "inputs": [ + { + "name": "distributionId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "fundedSlateHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalCreated", + "inputs": [ + { + "name": "proposalId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "proposer", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + }, + { + "name": "signatures", + "type": "string[]", + "indexed": false, + "internalType": "string[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + }, + { + "name": "startBlock", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "endBlock", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "description", + "type": "string", + "indexed": false, + "internalType": "string" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExecuted", + "inputs": [ + { + "name": "proposalId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "VoteCast", + "inputs": [ + { + "name": "voter", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "proposalId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "support", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + }, + { + "name": "weight", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "reason", + "type": "string", + "indexed": false, + "internalType": "string" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "DelegateRewardInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "DistributionPeriodStillActive", + "inputs": [] + }, + { + "type": "error", + "name": "ExecuteProposalInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "FundingVoteWrongDirection", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientRemainingVotingPower", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientVotingPower", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidProposal", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidProposalSlate", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidVote", + "inputs": [] + }, + { + "type": "error", + "name": "ProposalAlreadyExists", + "inputs": [] + }, + { + "type": "error", + "name": "ProposalNotSuccessful", + "inputs": [] + }, + { + "type": "error", + "name": "RewardAlreadyClaimed", + "inputs": [] + }, + { + "type": "error", + "name": "ScreeningPeriodEnded", + "inputs": [] } ] diff --git a/abis/PoolInfoUtils.json b/abis/PoolInfoUtils.json index f4792e6..4d69e1c 100644 --- a/abis/PoolInfoUtils.json +++ b/abis/PoolInfoUtils.json @@ -1,681 +1,789 @@ [ { - "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": "depositFeeRate", "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": "hpb", "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": "hpbIndex", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", "name": "htp", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + } + ], "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": "multicall", "inputs": [ { - "internalType": "address", - "name": "ajnaPool_", - "type": "address" + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ + { + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" } ], + "stateMutability": "nonpayable" + }, + { + "type": "function", "name": "poolLoansInfo", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + } + ], "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": "error", + "name": "BucketIndexOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "BucketPriceOutOfBounds", + "inputs": [] }, { + "type": "error", + "name": "PRBMathSD59x18__CeilOverflow", "inputs": [ { - "internalType": "address", - "name": "ajnaPool_", - "type": "address" + "name": "x", + "type": "int256", + "internalType": "int256" } - ], - "name": "unutilizedDepositFeeRate", - "outputs": [ + ] + }, + { + "type": "error", + "name": "PRBMathSD59x18__DivInputTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "PRBMathSD59x18__DivOverflow", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "rAbs", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "view", - "type": "function" + ] + }, + { + "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/PoolInfoUtilsMulticall.json b/abis/PoolInfoUtilsMulticall.json new file mode 100644 index 0000000..c8466a8 --- /dev/null +++ b/abis/PoolInfoUtilsMulticall.json @@ -0,0 +1,295 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "poolInfoUtils_", + "type": "address", + "internalType": "contract PoolInfoUtils" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "poolBalanceDetails", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + }, + { + "name": "index_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteTokenAddress_", + "type": "address", + "internalType": "address" + }, + { + "name": "collateralTokenAddress_", + "type": "address", + "internalType": "address" + }, + { + "name": "isNFT_", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "poolBalanceDetails_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolBalanceDetails", + "components": [ + { + "name": "debt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "accruedDebt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "debtInAuction", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "t0Debt2ToCollateral", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "depositUpToIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteTokenBalance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "collateralTokenBalance", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "poolDetailsMulticall", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "poolLoansInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolLoansInfo", + "components": [ + { + "name": "poolSize", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "loansCount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "maxBorrower", + "type": "address", + "internalType": "address" + }, + { + "name": "pendingInflator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "pendingInterestFactor", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "poolPriceInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolPriceInfo", + "components": [ + { + "name": "hpb", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "hpbIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "htp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "htpIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lup", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lupIndex", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "poolRatesAndFees_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolRatesAndFees", + "components": [ + { + "name": "lenderInterestMargin", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "borrowFeeRate", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "depositFeeRate", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "poolReservesInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolReservesInfo", + "components": [ + { + "name": "reserves", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "claimableReserves", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "claimableReservesRemaining", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "auctionPrice", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "timeRemaining", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "poolUtilizationInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolUtilizationInfo", + "components": [ + { + "name": "poolMinDebtAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "poolCollateralization", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "poolActualUtilization", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "poolTargetUtilization", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "poolInfoUtils", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract PoolInfoUtils" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "poolRatesAndFeesMulticall", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "lenderInterestMargin", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "borrowFeeRate", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "depositFeeRate", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + } +] 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/networks.json b/networks.json index aeb3854..0e3cca8 100644 --- a/networks.json +++ b/networks.json @@ -51,18 +51,44 @@ "startBlock": 46312499 } }, + "base": { + "ERC20PoolFactory": { + "address": "0xdc01502485c02496a929c12762cE99Fd755c6a25", + "startBlock": 8156311 + }, + "ERC721PoolFactory": { + "address": "0x513cc6E8De2FC3c7532d867fc6c287ABb56df230", + "startBlock": 8156311 + }, + "PositionManager": { + "address": "0x72Ce601AecE3C46eF2b7C85712E05d7c0f29A364", + "startBlock": 8156311 + }, + "GrantFund": { + "address": "0x0000000000000000000000000000000000000000", + "startBlock": 8156311 + }, + "AjnaToken": { + "address": "0xf0f326af3b1Ed943ab95C29470730CC8Cf66ae47", + "startBlock": 3055193 + }, + "BurnWrappedAjna": { + "address": "0x0000000000000000000000000000000000000000", + "startBlock": 3055193 + } + }, "goerli": { "ERC20PoolFactory": { - "address": "0x14F2474fB5ea9DF82059053c4F85A8C803Ab10C9", - "startBlock": 9888337 + "address": "0xA2d6694F24c84e428B97bF9fCD8E3e3dba3023D0", + "startBlock": 10243942 }, "ERC721PoolFactory": { - "address": "0xb0d1c875B240EE9f6C2c3284a31b10f1EC6De7d2", - "startBlock": 9888337 + "address": "0x0CC0Ba1bC6f45513422D6BF301Bd1Cb8c78B5861", + "startBlock": 10243942 }, "PositionManager": { - "address": "0xC4114D90F51960854ab574297Cf7CC131d445F29", - "startBlock": 9888337 + "address": "0x20BE7129B4126dC39aadBfA4C3360b52313a660D", + "startBlock": 10243942 }, "GrantFund": { "address": "0x17C7eb98aD29c8C07C2842C4B64342142C405aF4", 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/base/base-pool.ts b/src/mappings/base/base-pool.ts index 9e9e765..4a9c7c3 100644 --- a/src/mappings/base/base-pool.ts +++ b/src/mappings/base/base-pool.ts @@ -18,7 +18,7 @@ import { ONE_BI, TEN_BI, ZERO_BD } from "../../utils/constants" import { addressToBytes, bigIntArrayToIntArray, wadToDecimal } from "../../utils/convert" import { getBucketId, getBucketInfo, loadOrCreateBucket, updateBucketLends } from "../../utils/pool/bucket" import { getDepositTime, getLendId, loadOrCreateLend, lpbValueInQuote, saveOrRemoveLend } from "../../utils/pool/lend" -import { addReserveAuctionToPool, getBurnInfo, getLenderInfo, isERC20Pool, updatePool } from "../../utils/pool/pool" +import { addReserveAuctionToPool, getBurnInfo, getLenderInfo, isERC20Pool, updatePool } from '../../utils/pool/pool'; import { incrementTokenTxCount as incrementTokenTxCountERC20Pool } from "../../utils/token-erc20" import { incrementTokenTxCount as incrementTokenTxCountERC721Pool } from "../../utils/token-erc721" import { loadOrCreateReserveAuction } from "../../utils/pool/reserve-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/constants.ts b/src/utils/constants.ts index edad0ab..72e8fc0 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -31,11 +31,17 @@ export const MAX_BUCKET_INDEX = 4156; export const poolInfoUtilsAddressTable = new TypedMap() poolInfoUtilsAddressTable.set('mainnet', Address.fromString('0x154FFf344f426F99E328bacf70f4Eb632210ecdc')) poolInfoUtilsAddressTable.set('matic', Address.fromString('0xA9Ada58DD3c820b30D3bf5B490226F2ef92107bA')) -poolInfoUtilsAddressTable.set('goerli', Address.fromString('0x08F304cBeA7FAF48C93C27ae1305E220913a571d')) +poolInfoUtilsAddressTable.set('base', Address.fromString('0xC086acc9Bf89D8a0E2209e2870fC020D8f3323a8')) +poolInfoUtilsAddressTable.set('goerli', Address.fromString('0x3c5cf15122903C7CabcAA49FcfC090D3A311C038')) poolInfoUtilsAddressTable.set('mumbai', Address.fromString('0x39250241CC84Dadb1cDFE3A1a717631e2aA603eB')) poolInfoUtilsAddressTable.set('ganache', Address.fromString('0xab56A77bDFe82b36875e92CE717fE533C1709A9D')) +export const poolInfoUtilsMulticallAddressTable = new TypedMap() +poolInfoUtilsMulticallAddressTable.set('base', Address.fromString('0x83bC7AE84B469Fa4c86a91BA8A82D253c0858e13')) +poolInfoUtilsMulticallAddressTable.set('goerli', Address.fromString('0xE1a73054BA68f31F029bC6D452DF786D900b3Ed0')) +poolInfoUtilsMulticallAddressTable.set('ganache', Address.fromString('0x1d00b2f5861457F8503a481774903E36872Ea17d')) export const positionManagerAddressTable = new TypedMap() -positionManagerAddressTable.set('goerli', Address.fromString('0xC4114D90F51960854ab574297Cf7CC131d445F29')) +positionManagerAddressTable.set('base', Address.fromString('0x72Ce601AecE3C46eF2b7C85712E05d7c0f29A364')) +positionManagerAddressTable.set('goerli', Address.fromString('0x20BE7129B4126dC39aadBfA4C3360b52313a660D')) positionManagerAddressTable.set('ganache', Address.fromString('0x502dD41556B128C23F8B715dBEEBB73D1F1Feb67')) // GrantFund constants 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/src/utils/pool/pool.ts b/src/utils/pool/pool.ts index 6b0e850..0cae512 100644 --- a/src/utils/pool/pool.ts +++ b/src/utils/pool/pool.ts @@ -1,16 +1,18 @@ -import { BigDecimal, BigInt, Bytes, Address, dataSource, log } from '@graphprotocol/graph-ts' +import { BigDecimal, BigInt, Bytes, Address, dataSource, ethereum, log } from '@graphprotocol/graph-ts' import { LiquidationAuction, Pool, ReserveAuction, Token } from "../../../generated/schema" import { ERC20Pool } from '../../../generated/templates/ERC20Pool/ERC20Pool' import { ERC721Pool } from '../../../generated/templates/ERC721Pool/ERC721Pool' import { PoolInfoUtils } from '../../../generated/templates/ERC20Pool/PoolInfoUtils' +import { PoolInfoUtilsMulticall } from '../../../generated/templates/ERC20Pool/PoolInfoUtilsMulticall' -import { MAX_PRICE, MAX_PRICE_INDEX, ONE_BD, poolInfoUtilsAddressTable, TEN_BI, ZERO_ADDRESS, ZERO_BD, ZERO_BI } from "../constants" -import { addressToBytes, decimalToWad, wadToDecimal } from '../convert' +import { MAX_PRICE, MAX_PRICE_INDEX, ONE_BD, poolInfoUtilsAddressTable, poolInfoUtilsMulticallAddressTable, TEN_BI, ZERO_ADDRESS, ZERO_BD, ZERO_BI } from "../constants" +import { addressToBytes, decimalToWad, wadToDecimal } from '../convert'; import { getTokenBalance } from '../token-erc20' import { getTokenBalance as getERC721TokenBalance } from '../token-erc721' import { wmul, wdiv } from '../math' import { ERC721PoolFactory } from '../../../generated/ERC721PoolFactory/ERC721PoolFactory' +import { BucketInfo } from './bucket'; export function getPoolAddress(poolId: Bytes): Address { @@ -76,22 +78,19 @@ export function getRatesAndFees(poolId: Bytes): RatesAndFees { const lim = poolInfoUtilsContract.lenderInterestMargin(poolAddress) const bfr = poolInfoUtilsContract.borrowFeeRate(poolAddress) - const dfr = poolInfoUtilsContract.unutilizedDepositFeeRate(poolAddress) + const dfr = poolInfoUtilsContract.depositFeeRate(poolAddress) return new RatesAndFees(lim, bfr, dfr); } export function calculateLendRate( - poolAddress: Address, borrowRate: BigInt, - lenderInterestMargin: BigInt, - poolPricesInfo: PoolPricesInfo, + lenderInterestMargin: BigInt, + meaningfulDeposit: BigInt, debt: BigInt ): BigDecimal { - const meaningfulPriceIndex = max(poolPricesInfo.lupIndex.toU32(), poolPricesInfo.htpIndex.toU32()) - const meaningfulDeposit = depositUpToIndex(poolAddress, meaningfulPriceIndex) if (meaningfulDeposit.equals(ZERO_BI)) return ZERO_BD const utilization = wdiv(debt, meaningfulDeposit) - return wadToDecimal(wmul(wmul(borrowRate,lenderInterestMargin), utilization)) + return wadToDecimal(wmul(wmul(borrowRate, lenderInterestMargin), utilization)) } export class LoansInfo { @@ -212,68 +211,152 @@ export function getPoolUtilizationInfo(pool: Pool): PoolUtilizationInfo { // TODO: investigate checking blockHeight to avoid duplicate calls on same block export function updatePool(pool: Pool): void { - // update pool loan information - const poolLoansInfo = getPoolLoansInfo(pool) - pool.poolSize = wadToDecimal(poolLoansInfo.poolSize) - pool.loansCount = poolLoansInfo.loansCount - pool.maxBorrower = poolLoansInfo.maxBorrower - pool.inflator = wadToDecimal(poolLoansInfo.pendingInflator) - - // update amount of debt in pool - const debtInfo = isERC20Pool(pool) ? getDebtInfo(pool) : getDebtInfoERC721Pool(pool) - pool.t0debt = wadToDecimal(wdiv(debtInfo.pendingDebt, poolLoansInfo.pendingInflator)) - - // update pool prices information - const poolPricesInfo = getPoolPricesInfo(pool) - pool.hpb = wadToDecimal(poolPricesInfo.hpb) - pool.hpbIndex = poolPricesInfo.hpbIndex.toU32() - pool.htp = wadToDecimal(poolPricesInfo.htp) - pool.htpIndex = poolPricesInfo.htpIndex.toU32() - pool.lup = wadToDecimal(poolPricesInfo.lup) - pool.lupIndex = poolPricesInfo.lupIndex.toU32() - - // update reserve auction information - const poolReservesInfo = getPoolReservesInfo(pool) - pool.reserves = wadToDecimal(poolReservesInfo.reserves) - pool.claimableReserves = wadToDecimal(poolReservesInfo.claimableReserves) - pool.claimableReservesRemaining = wadToDecimal(poolReservesInfo.claimableReservesRemaining) - - // update pool utilization information - const poolUtilizationInfo = getPoolUtilizationInfo(pool) - pool.minDebtAmount = wadToDecimal(poolUtilizationInfo.minDebtAmount) - pool.actualUtilization = wadToDecimal(poolUtilizationInfo.actualUtilization) - pool.targetUtilization = wadToDecimal(poolUtilizationInfo.targetUtilization) - - // update pool token balances - // update quote token balances, this is common between all pool types - const poolAddress = Address.fromBytes(pool.id) - let token = Token.load(pool.quoteToken)! - let scaleFactor = TEN_BI.pow(18 - token.decimals as u8) - let unnormalizedTokenBalance = getTokenBalance(Address.fromBytes(pool.quoteToken), poolAddress) - pool.quoteTokenBalance = wadToDecimal(unnormalizedTokenBalance.times(scaleFactor)) - // update collateral token balances - // use the appropriate contract for querying balanceOf the pool - if (pool.poolType == 'Fungible') { - token = Token.load(pool.collateralToken)! - scaleFactor = TEN_BI.pow(18 - token.decimals as u8) - unnormalizedTokenBalance = getTokenBalance(Address.fromBytes(pool.collateralToken), poolAddress) - } else { - scaleFactor = TEN_BI.pow(18) // assume 18 decimal factor for ERC721 - unnormalizedTokenBalance = getERC721TokenBalance(Address.fromBytes(pool.collateralToken), poolAddress) - } - pool.collateralBalance = wadToDecimal(unnormalizedTokenBalance.times(scaleFactor)) + // get pool details and bucket info + const poolDetails = getPoolDetailsMulticall(pool) + + // update pool loan information + const poolLoansInfo = poolDetails.poolLoansInfo + pool.poolSize = wadToDecimal(poolLoansInfo.poolSize) + pool.loansCount = poolLoansInfo.loansCount + pool.maxBorrower = poolLoansInfo.maxBorrower + pool.inflator = wadToDecimal(poolLoansInfo.pendingInflator) + + // update pool prices information + const poolPricesInfo = poolDetails.poolPricesInfo + pool.hpb = wadToDecimal(poolPricesInfo.hpb) + pool.hpbIndex = poolPricesInfo.hpbIndex.toU32() + pool.htp = wadToDecimal(poolPricesInfo.htp) + pool.htpIndex = poolPricesInfo.htpIndex.toU32() + pool.lup = wadToDecimal(poolPricesInfo.lup) + pool.lupIndex = poolPricesInfo.lupIndex.toU32() + + // update reserve auction information + const poolReservesInfo = poolDetails.reservesInfo + pool.reserves = wadToDecimal(poolReservesInfo.reserves) + pool.claimableReserves = wadToDecimal(poolReservesInfo.claimableReserves) + pool.claimableReservesRemaining = wadToDecimal(poolReservesInfo.claimableReservesRemaining) + + // update pool utilization information + const poolUtilizationInfo = poolDetails.poolUtilizationInfo + pool.minDebtAmount = wadToDecimal(poolUtilizationInfo.minDebtAmount) + pool.actualUtilization = wadToDecimal(poolUtilizationInfo.actualUtilization) + pool.targetUtilization = wadToDecimal(poolUtilizationInfo.targetUtilization) + + // update pool token balances + const meaningfulPriceIndex = max(poolPricesInfo.lupIndex.toU32(), poolPricesInfo.htpIndex.toU32()) + const poolBalanceDetails = getPoolBalanceDetails(pool, BigInt.fromI32(meaningfulPriceIndex)) + pool.quoteTokenBalance = wadToDecimal(poolBalanceDetails.quoteTokenBalance) + pool.collateralBalance = wadToDecimal(poolBalanceDetails.collateralTokenBalance) + // update pool debt info + pool.t0debt = wadToDecimal(poolBalanceDetails.debt) + + // update rates and fees which change irrespective of borrow rate + const ratesAndFees = poolDetails.ratesAndFeesInfo + pool.lendRate = calculateLendRate( + decimalToWad(pool.borrowRate), + ratesAndFees.lenderInterestMargin, + poolBalanceDetails.depositUpToIndex, + poolBalanceDetails.debt) + pool.borrowFeeRate = wadToDecimal(ratesAndFees.borrowFeeRate) + pool.depositFeeRate = wadToDecimal(ratesAndFees.depositFeeRate) +} + +export class PoolDetails { + poolLoansInfo: LoansInfo + poolPricesInfo: PoolPricesInfo + ratesAndFeesInfo: RatesAndFees + reservesInfo: ReservesInfo + poolUtilizationInfo: PoolUtilizationInfo + constructor(poolLoansInfo: LoansInfo, poolPricesInfo: PoolPricesInfo, ratesAndFeesInfo: RatesAndFees, reservesInfo: ReservesInfo, poolUtilizationInfo: PoolUtilizationInfo) { + this.poolLoansInfo = poolLoansInfo + this.poolPricesInfo = poolPricesInfo + this.ratesAndFeesInfo = ratesAndFeesInfo + this.reservesInfo = reservesInfo + this.poolUtilizationInfo = poolUtilizationInfo + } +} +export function getPoolDetailsMulticall(pool: Pool): PoolDetails { + const poolInfoUtilsMulticallAddress = poolInfoUtilsMulticallAddressTable.get(dataSource.network())! + const poolInfoUtilsMulticallContract = PoolInfoUtilsMulticall.bind(poolInfoUtilsMulticallAddress) + const poolDetailsMulticallResult = poolInfoUtilsMulticallContract.poolDetailsMulticall(Address.fromBytes(pool.id)) + + const poolDetails = new PoolDetails( + new LoansInfo( + poolDetailsMulticallResult.value0.poolSize, + poolDetailsMulticallResult.value0.loansCount, + poolDetailsMulticallResult.value0.maxBorrower, + poolDetailsMulticallResult.value0.pendingInflator, + poolDetailsMulticallResult.value0.pendingInterestFactor + ), + new PoolPricesInfo( + poolDetailsMulticallResult.value1.hpb, + poolDetailsMulticallResult.value1.hpbIndex, + poolDetailsMulticallResult.value1.htp, + poolDetailsMulticallResult.value1.htpIndex, + poolDetailsMulticallResult.value1.lup, + poolDetailsMulticallResult.value1.lupIndex + ), + new RatesAndFees( + poolDetailsMulticallResult.value2.lenderInterestMargin, + poolDetailsMulticallResult.value2.borrowFeeRate, + poolDetailsMulticallResult.value2.depositFeeRate + ), + new ReservesInfo( + poolDetailsMulticallResult.value3.reserves, + poolDetailsMulticallResult.value3.claimableReserves, + poolDetailsMulticallResult.value3.claimableReservesRemaining, + poolDetailsMulticallResult.value3.auctionPrice, + poolDetailsMulticallResult.value3.timeRemaining + ), + new PoolUtilizationInfo( + poolDetailsMulticallResult.value4.poolMinDebtAmount, + poolDetailsMulticallResult.value4.poolCollateralization, + poolDetailsMulticallResult.value4.poolActualUtilization, + poolDetailsMulticallResult.value4.poolTargetUtilization + ) + ) + return poolDetails +} - // update rates and fees which change irrespective of borrow rate - const ratesAndFees = getRatesAndFees(poolAddress) - pool.lendRate = calculateLendRate( - poolAddress, - decimalToWad(pool.borrowRate), - ratesAndFees.lenderInterestMargin, - poolPricesInfo, - debtInfo.pendingDebt) - pool.borrowFeeRate = wadToDecimal(ratesAndFees.borrowFeeRate) - pool.depositFeeRate = wadToDecimal(ratesAndFees.depositFeeRate) +export class PoolBalanceDetails { + debt: BigInt + accruedDebt: BigInt + debtInAuction: BigInt + t0Debt2ToCollateral: BigInt + depositUpToIndex: BigInt + quoteTokenBalance: BigInt + collateralTokenBalance: BigInt + constructor(debt: BigInt, accruedDebt: BigInt, debtInAuction: BigInt, t0Debt2ToCollateral: BigInt, depositUpToIndex: BigInt, quoteTokenBalance: BigInt, collateralTokenBalance: BigInt) { + this.debt = debt + this.accruedDebt = accruedDebt + this.debtInAuction = debtInAuction + this.t0Debt2ToCollateral = t0Debt2ToCollateral + this.depositUpToIndex = depositUpToIndex + this.quoteTokenBalance = quoteTokenBalance + this.collateralTokenBalance = collateralTokenBalance + } } +export function getPoolBalanceDetails(pool: Pool, meaningFulIndex: BigInt): PoolBalanceDetails { + const poolInfoUtilsMulticallAddress = poolInfoUtilsMulticallAddressTable.get(dataSource.network())! + const poolInfoUtilsMulticallContract = PoolInfoUtilsMulticall.bind(poolInfoUtilsMulticallAddress) + const poolBalanceDetailsResult = poolInfoUtilsMulticallContract.poolBalanceDetails(Address.fromBytes(pool.id), meaningFulIndex, Address.fromBytes(pool.quoteToken), Address.fromBytes(pool.collateralToken), pool.poolType != 'Fungible') + + const poolBalanceDetails = new PoolBalanceDetails( + poolBalanceDetailsResult.debt, + poolBalanceDetailsResult.accruedDebt, + poolBalanceDetailsResult.debtInAuction, + poolBalanceDetailsResult.t0Debt2ToCollateral, + poolBalanceDetailsResult.depositUpToIndex, + poolBalanceDetailsResult.quoteTokenBalance, + poolBalanceDetailsResult.collateralTokenBalance + ) + return poolBalanceDetails +} + + // TODO: rearrange into organized sections + /****************/ + /*** Pointers ***/ + /****************/ // if absent, add a liquidation auction to the pool's collection of active liquidations export function addLiquidationToPool(pool: Pool, liquidationAuction: LiquidationAuction): void { @@ -347,6 +430,7 @@ export function getBurnInfoERC721Pool(pool: Pool, burnEpoch: BigInt): BurnInfo { return burnInfo } +// FIXME: this needs to be updated export class DebtInfo { pendingDebt: BigInt accruedDebt: BigInt @@ -384,7 +468,7 @@ export function getDebtInfoERC721Pool(pool: Pool): DebtInfo { export function getTotalBucketTokens(pool: Bytes): BigInt { const poolContract = ERC721Pool.bind(Address.fromBytes(pool)) - return poolContract.totalBucketTokens() + return BigInt.fromU64(poolContract.bucketTokenIds.length) } export function isERC20Pool(pool: Pool): boolean { diff --git a/subgraph.yaml b/subgraph.yaml index ed57de3..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 @@ -227,6 +227,8 @@ templates: file: ./abis/ERC20Pool.json - name: PoolInfoUtils file: ./abis/PoolInfoUtils.json + - name: PoolInfoUtilsMulticall + file: ./abis/PoolInfoUtilsMulticall.json eventHandlers: - event: AddCollateral(indexed address,indexed uint256,uint256,uint256) handler: handleAddCollateral @@ -332,6 +334,8 @@ templates: file: ./abis/ERC721Pool.json - name: PoolInfoUtils file: ./abis/PoolInfoUtils.json + - name: PoolInfoUtilsMulticall + file: ./abis/PoolInfoUtilsMulticall.json eventHandlers: - event: AddCollateralNFT(indexed address,indexed uint256,uint256[],uint256) handler: handleAddCollateralNFT diff --git a/tests/erc-20-pool.test.ts b/tests/erc-20-pool.test.ts index 6e8f047..77202a7 100644 --- a/tests/erc-20-pool.test.ts +++ b/tests/erc-20-pool.test.ts @@ -21,10 +21,10 @@ import { import { mockGetAuctionInfo, mockGetAuctionStatus, mockGetBorrowerInfo, mockGetBucketInfo, mockGetBurnInfo, mockGetCurrentBurnEpoch, mockGetDebtInfo, mockGetLPBValueInQuote, mockGetLenderInfo, mockGetRatesAndFees, mockPoolInfoUtilsPoolUpdateCalls, mockTokenBalance } from "./utils/mock-contract-calls" import { BucketInfo, getBucketId } from "../src/utils/pool/bucket" 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 { 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" @@ -467,15 +467,40 @@ describe("ERC20Pool assertions", () => { const amountBorrowed = BigInt.fromString("567529276179422528643") // 567.529276179422528643 * 1e18 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) - const expectedPoolDebtInfo = new DebtInfo(amountBorrowed, ZERO_BI, ZERO_BI, ZERO_BI) - mockGetDebtInfo(poolAddress, expectedPoolDebtInfo) + mockPoolInfoUtilsPoolUpdateCalls(poolAddress, { + poolSize: ZERO_BI, + debt: amountBorrowed, + loansCount: ONE_BI, + maxBorrower: borrower, + inflator: inflator, + hpb: ZERO_BI, //TODO: indexToPrice(price) + hpbIndex: index, + htp: ZERO_BI, //TODO: indexToPrice(price) + htpIndex: ZERO_BI, + lup: lup, + lupIndex: BigInt.fromU32(MAX_PRICE_INDEX), + reserves: ZERO_BI, + claimableReserves: ZERO_BI, + claimableReservesRemaining: ZERO_BI, + reserveAuctionPrice: ZERO_BI, + currentBurnEpoch: BigInt.fromI32(9998102), + reserveAuctionTimeRemaining: ZERO_BI, + minDebtAmount: ZERO_BI, + collateralization: ONE_WAD_BI, + actualUtilization: ZERO_BI, + targetUtilization: ONE_WAD_BI + }) - const inflator = BigInt.fromString("1002804000000000000") const expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), collateralPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) // mock drawDebt event @@ -574,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( @@ -631,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") @@ -642,6 +670,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -653,7 +682,10 @@ describe("ERC20Pool assertions", () => { debt, false, startPrice, - neutralPrice + neutralPrice, + referencePrice, + thresholdPrice, + bondFactor ) mockGetAuctionStatus(poolAddress, borrower, expectedAuctionStatus) @@ -813,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") @@ -824,6 +857,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -834,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 @@ -860,6 +896,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -871,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 @@ -1001,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") @@ -1011,6 +1054,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1040,6 +1084,7 @@ describe("ERC20Pool assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1051,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) @@ -1193,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") @@ -1203,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 f94f81d..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" @@ -256,16 +256,40 @@ describe("Describe entity assertions", () => { const tokenIdsPledged = [BigInt.fromI32(234), BigInt.fromI32(345)] 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) - // mock required contract calls - const expectedPoolDebtInfo = new DebtInfo(amountBorrowed, ZERO_BI, ZERO_BI, ZERO_BI) - mockGetDebtInfo(poolAddress, expectedPoolDebtInfo) + mockPoolInfoUtilsPoolUpdateCalls(poolAddress, { + poolSize: ZERO_BI, + debt: amountBorrowed, + loansCount: ONE_BI, + maxBorrower: borrower, + inflator: inflator, + hpb: ZERO_BI, //TODO: indexToPrice(price) + hpbIndex: index, + htp: ZERO_BI, //TODO: indexToPrice(price) + htpIndex: ZERO_BI, + lup: lup, + lupIndex: BigInt.fromU32(MAX_PRICE_INDEX), + reserves: ZERO_BI, + claimableReserves: ZERO_BI, + claimableReservesRemaining: ZERO_BI, + reserveAuctionPrice: ZERO_BI, + currentBurnEpoch: BigInt.fromI32(9998102), + reserveAuctionTimeRemaining: ZERO_BI, + minDebtAmount: ZERO_BI, + collateralization: ONE_WAD_BI, + actualUtilization: ZERO_BI, + targetUtilization: ONE_WAD_BI + }) - const inflator = BigInt.fromString("1002804000000000000") const expectedBorrowerInfo = new BorrowerInfo( wdiv(amountBorrowed, inflator), amountPledged, - BigInt.fromString("8766934085068726351")) + BigInt.fromString("8766934085068726351"), + thresholdPrice + ) mockGetBorrowerInfo(poolAddress, borrower, expectedBorrowerInfo) const newDrawDebtEvent = createDrawDebtNFTEvent( @@ -382,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) @@ -391,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( @@ -434,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( @@ -737,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) @@ -746,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 @@ -796,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") @@ -808,6 +839,7 @@ describe("Describe entity assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -820,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) @@ -850,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 @@ -1130,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) @@ -1139,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 @@ -1189,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") @@ -1201,6 +1242,7 @@ describe("Describe entity assertions", () => { kickTime, referencePrice, neutralPrice, + thresholdPrice, head, next, prev @@ -1213,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) @@ -1274,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 b125be2..8a10de3 100644 --- a/tests/utils/mock-contract-calls.ts +++ b/tests/utils/mock-contract-calls.ts @@ -2,10 +2,10 @@ import { Address, BigInt, Bytes, ethereum, dataSource, log, BigDecimal } from "@ import { createMockedFunction } from "matchstick-as" import { BucketInfo } from "../../src/utils/pool/bucket" -import { positionManagerAddressTable, poolInfoUtilsAddressTable, ZERO_BI, ONE_BI } from "../../src/utils/constants" -import { BurnInfo, DebtInfo, LoansInfo, PoolPricesInfo, PoolUtilizationInfo, ReservesInfo } from "../../src/utils/pool/pool" +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) ]) } @@ -181,7 +182,7 @@ export function mockGetRatesAndFees(pool: Address, expectedLenderInterestMargin: createMockedFunction(poolInfoUtilsAddressTable.get(dataSource.network())!, 'borrowFeeRate', 'borrowFeeRate(address):(uint256)') .withArgs([ethereum.Value.fromAddress(pool)]) .returns([ethereum.Value.fromUnsignedBigInt(expectedBorrowFeeRate)]) - createMockedFunction(poolInfoUtilsAddressTable.get(dataSource.network())!, 'unutilizedDepositFeeRate', 'unutilizedDepositFeeRate(address):(uint256)') + createMockedFunction(poolInfoUtilsAddressTable.get(dataSource.network())!, 'depositFeeRate', 'depositFeeRate(address):(uint256)') .withArgs([ethereum.Value.fromAddress(pool)]) .returns([ethereum.Value.fromUnsignedBigInt(expectedDepositFeeRate)]) } @@ -254,9 +255,79 @@ export function mockGetPoolUtilizationInfo(pool: Address, expectedInfo: PoolUtil ]) } +// https://github.com/LimeChain/matchstick/issues/376 +export function mockGetPoolDetailsMulticall(pool: Address, expectedPoolDetails: PoolDetails): void { + const expectedPoolLoansInfo = new ethereum.Tuple(); + expectedPoolLoansInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolLoansInfo.poolSize)); + expectedPoolLoansInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolLoansInfo.loansCount)); + expectedPoolLoansInfo.push(ethereum.Value.fromAddress(expectedPoolDetails.poolLoansInfo.maxBorrower)); + expectedPoolLoansInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolLoansInfo.pendingInflator)); + expectedPoolLoansInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolLoansInfo.pendingInterestFactor)); + + const expectedPoolPricesInfo = new ethereum.Tuple(); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.hpb)); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.hpbIndex)); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.htp)); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.htpIndex)); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.lup)); + expectedPoolPricesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolPricesInfo.lupIndex)); + + const expectedRatesAndFeesInfo = new ethereum.Tuple(); + expectedRatesAndFeesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.ratesAndFeesInfo.lenderInterestMargin)); + expectedRatesAndFeesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.ratesAndFeesInfo.borrowFeeRate)); + expectedRatesAndFeesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.ratesAndFeesInfo.depositFeeRate)); + + const expectedPoolReservesInfo = new ethereum.Tuple(); + expectedPoolReservesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.reservesInfo.reserves)); + expectedPoolReservesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.reservesInfo.claimableReserves)); + expectedPoolReservesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.reservesInfo.claimableReservesRemaining)); + expectedPoolReservesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.reservesInfo.reserveAuctionPrice)); + expectedPoolReservesInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.reservesInfo.reserveAuctionTimeRemaining)); + + const expectedPoolUtilizationInfo = new ethereum.Tuple(); + expectedPoolUtilizationInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolUtilizationInfo.minDebtAmount)); + expectedPoolUtilizationInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolUtilizationInfo.collateralization)); + expectedPoolUtilizationInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolUtilizationInfo.actualUtilization)); + expectedPoolUtilizationInfo.push(ethereum.Value.fromUnsignedBigInt(expectedPoolDetails.poolUtilizationInfo.targetUtilization)); + + createMockedFunction(poolInfoUtilsMulticallAddressTable.get(dataSource.network())!, 'poolDetailsMulticall', 'poolDetailsMulticall(address):((uint256,uint256,address,uint256,uint256),(uint256,uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256))') + .withArgs([ethereum.Value.fromAddress(pool)]) + .returns([ + ethereum.Value.fromTuple(expectedPoolLoansInfo), + ethereum.Value.fromTuple(expectedPoolPricesInfo), + ethereum.Value.fromTuple(expectedRatesAndFeesInfo), + ethereum.Value.fromTuple(expectedPoolReservesInfo), + ethereum.Value.fromTuple(expectedPoolUtilizationInfo) + ]) +} + +// https://github.com/LimeChain/matchstick/issues/376 +export function mockGetPoolBalanceDetails(pool: Address, meaningfulIndex: BigInt, quoteToken: Address, collateralToken: Address, isNFT: bool, expectedPoolBalanceDetails: PoolBalanceDetails): void { + const expectedPoolBalanceDetailsTuple = new ethereum.Tuple(); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.debt)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.accruedDebt)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.debtInAuction)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.t0Debt2ToCollateral)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.depositUpToIndex)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.quoteTokenBalance)); + expectedPoolBalanceDetailsTuple.push(ethereum.Value.fromUnsignedBigInt(expectedPoolBalanceDetails.collateralTokenBalance)); + + createMockedFunction(poolInfoUtilsMulticallAddressTable.get(dataSource.network())!, 'poolBalanceDetails', 'poolBalanceDetails(address,uint256,address,address,bool):((uint256,uint256,uint256,uint256,uint256,uint256,uint256))') + .withArgs([ + ethereum.Value.fromAddress(pool), + ethereum.Value.fromUnsignedBigInt(meaningfulIndex), + ethereum.Value.fromAddress(quoteToken), + ethereum.Value.fromAddress(collateralToken), + ethereum.Value.fromBoolean(isNFT) + ]) + .returns([ + ethereum.Value.fromTuple(expectedPoolBalanceDetailsTuple) + ]) +} + // 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), @@ -265,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) @@ -274,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) ]) } @@ -366,6 +441,7 @@ export class PoolMockParams { // quoteTokenBalance: BigInt // TODO: add quoteBalance and collateralBalance } + // mock all pool poolInfoUtilis contract calls export function mockPoolInfoUtilsPoolUpdateCalls(pool: Address, params: PoolMockParams): void { const expectedPoolLoansInfo = new LoansInfo( @@ -375,11 +451,6 @@ export function mockPoolInfoUtilsPoolUpdateCalls(pool: Address, params: PoolMock params.inflator, ONE_BI ) - mockGetPoolLoansInfo(pool, expectedPoolLoansInfo) - - const expectedPoolDebtInfo = new DebtInfo(params.debt, ZERO_BI, ZERO_BI, ZERO_BI) - mockGetDebtInfo(pool, expectedPoolDebtInfo) - const expectedPoolPricesInfo = new PoolPricesInfo( params.hpb, params.hpbIndex, @@ -388,8 +459,11 @@ export function mockPoolInfoUtilsPoolUpdateCalls(pool: Address, params: PoolMock params.lup, params.lupIndex ) - mockGetPoolPricesInfo(pool, expectedPoolPricesInfo) - + const expectedRatesAndFeesInfo = new RatesAndFees( + BigInt.fromString("10000000000000000"), // 0.01 * 1e18 + BigInt.fromString("850000000000000000"), // 0.85 * 1e18 + BigInt.fromString("50000000000000000") // 0.05 * 1e18 + ) const expectedPoolReservesInfo = new ReservesInfo( params.reserves, params.claimableReserves, @@ -397,30 +471,44 @@ export function mockPoolInfoUtilsPoolUpdateCalls(pool: Address, params: PoolMock params.reserveAuctionPrice, params.reserveAuctionTimeRemaining ) - mockGetPoolReserves(pool, expectedPoolReservesInfo) - const expectedPoolUtilizationInfo = new PoolUtilizationInfo( params.minDebtAmount, params.collateralization, params.actualUtilization, params.targetUtilization ) - mockGetPoolUtilizationInfo(pool, expectedPoolUtilizationInfo) - // TODO: pass expected balance to mock balance calls + const expectedPoolDetails = new PoolDetails( + expectedPoolLoansInfo, + expectedPoolPricesInfo, + expectedRatesAndFeesInfo, + expectedPoolReservesInfo, + expectedPoolUtilizationInfo + ) + mockGetPoolDetailsMulticall(pool, expectedPoolDetails) + // load pool instance const poolInstance = Pool.load(addressToBytes(pool))! - // mock token balance calls - mockTokenBalance(Address.fromBytes(poolInstance.collateralToken), pool, decimalToWad(poolInstance.collateralBalance)) - mockTokenBalance(Address.fromBytes(poolInstance.quoteToken), pool, decimalToWad(poolInstance.quoteTokenBalance)) - - mockGetRatesAndFees( - pool, - BigInt.fromString("850000000000000000"), // 0.85 * 1e18 - BigInt.fromString("50000000000000000"), // 0.05 * 1e18 + const depositUpToIndex = wmul(params.poolSize, params.actualUtilization) + const meaningfulIndex = BigInt.fromI32(max(params.lupIndex.toI32(), params.htpIndex.toI32())) + const isNFT = poolInstance.poolType != 'Fungible' + + mockGetPoolBalanceDetails( + pool, + meaningfulIndex, + Address.fromBytes(poolInstance.quoteToken), + Address.fromBytes(poolInstance.collateralToken), + isNFT, + new PoolBalanceDetails( + params.debt, + ZERO_BI, + ZERO_BI, + ZERO_BI, + depositUpToIndex, + decimalToWad(poolInstance.quoteTokenBalance), + decimalToWad(poolInstance.collateralBalance) + ) ) - - mockDepositUpToIndex(pool, params.lupIndex, wmul(params.poolSize, params.actualUtilization)) } /****************************/