From 41288b1f6d895ab1b0352e497b0346ff4ceddfbc Mon Sep 17 00:00:00 2001 From: Ed Noepel Date: Wed, 20 Dec 2023 16:23:02 -0500 Subject: [PATCH] update ABIs --- abis/AjnaToken.json | 638 ++++++++-------- abis/GrantFund.json | 1114 ++++++++++++++-------------- abis/PoolInfoUtils.json | 57 +- abis/PoolInfoUtilsMulticall.json | 268 +++---- src/utils/pool/pool.ts | 4 +- tests/utils/mock-contract-calls.ts | 2 +- 6 files changed, 1039 insertions(+), 1044 deletions(-) diff --git a/abis/AjnaToken.json b/abis/AjnaToken.json index b23d1e4..e64354f 100644 --- a/abis/AjnaToken.json +++ b/abis/AjnaToken.json @@ -1,674 +1,674 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "address", "name": "tokenReceiver_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "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": "delegator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "fromDelegate", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "toDelegate", - "type": "address" - } - ], - "name": "DelegateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegate", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousBalance", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" - } - ], - "name": "DelegateVotesChanged", - "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" - }, - { - "inputs": [], + "type": "function", "name": "DOMAIN_SEPARATOR", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "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" }, { + "type": "function", + "name": "burn", "inputs": [ { - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "burn", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "burnFrom", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "burnFrom", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "checkpoints", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint32", "name": "pos", - "type": "uint32" + "type": "uint32", + "internalType": "uint32" } ], - "name": "checkpoints", "outputs": [ { + "name": "", + "type": "tuple", + "internalType": "struct ERC20Votes.Checkpoint", "components": [ { - "internalType": "uint32", "name": "fromBlock", - "type": "uint32" + "type": "uint32", + "internalType": "uint32" }, { - "internalType": "uint224", "name": "votes", - "type": "uint224" + "type": "uint224", + "internalType": "uint224" } - ], - "internalType": "struct ERC20Votes.Checkpoint", - "name": "", - "type": "tuple" + ] } ], - "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": "delegate", "inputs": [ { - "internalType": "address", "name": "delegatee", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "delegate", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "delegateBySig", "inputs": [ { - "internalType": "address", "name": "delegatee", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "nonce", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "expiry", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint8", "name": "v", - "type": "uint8" + "type": "uint8", + "internalType": "uint8" }, { - "internalType": "bytes32", "name": "r", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "s", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "delegateBySig", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "delegates", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "delegates", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getPastTotalSupply", "inputs": [ { - "internalType": "uint256", "name": "blockNumber", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getPastTotalSupply", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getPastVotes", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "blockNumber", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getPastVotes", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getVotes", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getVotes", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "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" }, { + "type": "function", + "name": "nonces", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "nonces", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "numCheckpoints", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "numCheckpoints", "outputs": [ { - "internalType": "uint32", "name": "", - "type": "uint32" + "type": "uint32", + "internalType": "uint32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "permit", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "spender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "deadline", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint8", "name": "v", - "type": "uint8" + "type": "uint8", + "internalType": "uint8" }, { - "internalType": "bytes32", "name": "r", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "s", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "permit", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "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": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "transferFromWithPermit", "inputs": [ { - "internalType": "address", "name": "from_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "to_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "spender_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "deadline_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint8", "name": "v_", - "type": "uint8" + "type": "uint8", + "internalType": "uint8" }, { - "internalType": "bytes32", "name": "r_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "s_", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "transferFromWithPermit", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "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": "DelegateChanged", + "inputs": [ + { + "name": "delegator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateVotesChanged", + "inputs": [ + { + "name": "delegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "previousBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newBalance", + "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" + } + ], + "anonymous": false } ] diff --git a/abis/GrantFund.json b/abis/GrantFund.json index ba6636f..3968b4e 100644 --- a/abis/GrantFund.json +++ b/abis/GrantFund.json @@ -1,1031 +1,1031 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "address", "name": "ajnaToken_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "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": "function" + "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" + } + ], + "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 f3c9baf..4d69e1c 100644 --- a/abis/PoolInfoUtils.json +++ b/abis/PoolInfoUtils.json @@ -258,6 +258,25 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "depositFeeRate", + "inputs": [ + { + "name": "ajnaPool_", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "hpb", @@ -449,6 +468,25 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "multicall", + "inputs": [ + { + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ + { + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "poolLoansInfo", @@ -624,25 +662,6 @@ ], "stateMutability": "pure" }, - { - "type": "function", - "name": "unutilizedDepositFeeRate", - "inputs": [ - { - "name": "ajnaPool_", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, { "type": "error", "name": "BucketIndexOutOfBounds", diff --git a/abis/PoolInfoUtilsMulticall.json b/abis/PoolInfoUtilsMulticall.json index 3ba3b1a..c8466a8 100644 --- a/abis/PoolInfoUtilsMulticall.json +++ b/abis/PoolInfoUtilsMulticall.json @@ -1,319 +1,295 @@ [ { + "type": "constructor", "inputs": [ { - "internalType": "contract PoolInfoUtils", "name": "poolInfoUtils_", - "type": "address" + "type": "address", + "internalType": "contract PoolInfoUtils" } ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "string[]", - "name": "functionSignatures_", - "type": "string[]" - }, - { - "internalType": "string[]", - "name": "args_", - "type": "string[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results_", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "poolBalanceDetails", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "index_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "quoteTokenAddress_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "collateralTokenAddress_", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "bool", "name": "isNFT_", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "name": "poolBalanceDetails", "outputs": [ { + "name": "poolBalanceDetails_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolBalanceDetails", "components": [ { - "internalType": "uint256", "name": "debt", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "accruedDebt", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "debtInAuction", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "t0Debt2ToCollateral", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "depositUpToIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "quoteTokenBalance", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "collateralTokenBalance", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolBalanceDetails", - "name": "poolBalanceDetails_", - "type": "tuple" + ] } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolDetailsMulticall", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolDetailsMulticall", "outputs": [ { + "name": "poolLoansInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolLoansInfo", "components": [ { - "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" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolLoansInfo", - "name": "poolLoansInfo_", - "type": "tuple" + ] }, { + "name": "poolPriceInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolPriceInfo", "components": [ { - "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" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolPriceInfo", - "name": "poolPriceInfo_", - "type": "tuple" + ] }, { + "name": "poolRatesAndFees_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolRatesAndFees", "components": [ { - "internalType": "uint256", "name": "lenderInterestMargin", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "borrowFeeRate", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "depositFeeRate", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolRatesAndFees", - "name": "poolRatesAndFees_", - "type": "tuple" + ] }, { + "name": "poolReservesInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolReservesInfo", "components": [ { - "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" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolReservesInfo", - "name": "poolReservesInfo_", - "type": "tuple" + ] }, { + "name": "poolUtilizationInfo_", + "type": "tuple", + "internalType": "struct PoolInfoUtilsMulticall.PoolUtilizationInfo", "components": [ { - "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" } - ], - "internalType": "struct PoolInfoUtilsMulticall.PoolUtilizationInfo", - "name": "poolUtilizationInfo_", - "type": "tuple" + ] } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "poolInfoUtils", + "inputs": [], "outputs": [ { - "internalType": "contract PoolInfoUtils", "name": "", - "type": "address" + "type": "address", + "internalType": "contract PoolInfoUtils" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "poolRatesAndFeesMulticall", "inputs": [ { - "internalType": "address", "name": "ajnaPool_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "poolRatesAndFeesMulticall", "outputs": [ { - "internalType": "uint256", "name": "lenderInterestMargin", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "borrowFeeRate", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "depositFeeRate", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" } ] diff --git a/src/utils/pool/pool.ts b/src/utils/pool/pool.ts index 2b0f35d..0cae512 100644 --- a/src/utils/pool/pool.ts +++ b/src/utils/pool/pool.ts @@ -78,7 +78,7 @@ 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); } @@ -468,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/tests/utils/mock-contract-calls.ts b/tests/utils/mock-contract-calls.ts index 8d2dcb2..8a10de3 100644 --- a/tests/utils/mock-contract-calls.ts +++ b/tests/utils/mock-contract-calls.ts @@ -182,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)]) }