From 5ebbc6a45e44d51e2bbd44261854602ce5236485 Mon Sep 17 00:00:00 2001 From: tadej-solidant Date: Mon, 27 Nov 2023 14:42:58 +0100 Subject: [PATCH] feat(apps): Spool.fi v2 support --- .../contracts/abis/spool-staking.json | 810 +++++++++++ .../spool-v2/contracts/abis/spool-vault.json | 815 +++++++++++ .../contracts/abis/spool-vospool.json | 1173 ++++++++++++++++ .../spool-v2/contracts/ethers/SpoolStaking.ts | 998 ++++++++++++++ .../spool-v2/contracts/ethers/SpoolVault.ts | 1137 ++++++++++++++++ .../spool-v2/contracts/ethers/SpoolVospool.ts | 1157 ++++++++++++++++ .../ethers/factories/SpoolStaking__factory.ts | 828 ++++++++++++ .../ethers/factories/SpoolVault__factory.ts | 833 ++++++++++++ .../ethers/factories/SpoolVospool__factory.ts | 1191 +++++++++++++++++ .../spool-v2/ethereum/spool-v2.constants.ts | 109 ++ ...ol-v2.staking.contract-position-fetcher.ts | 149 +++ src/apps/spool-v2/ethereum/spool-v2.types.ts | 137 ++ ...pool-v2.vault.contract-position-fetcher.ts | 211 +++ .../spool-v2.vo-spool.token-fetcher.ts | 43 + src/apps/spool-v2/spool-v2.module.ts | 18 + 15 files changed, 9609 insertions(+) create mode 100644 src/apps/spool-v2/contracts/abis/spool-staking.json create mode 100644 src/apps/spool-v2/contracts/abis/spool-vault.json create mode 100644 src/apps/spool-v2/contracts/abis/spool-vospool.json create mode 100644 src/apps/spool-v2/contracts/ethers/SpoolStaking.ts create mode 100644 src/apps/spool-v2/contracts/ethers/SpoolVault.ts create mode 100644 src/apps/spool-v2/contracts/ethers/SpoolVospool.ts create mode 100644 src/apps/spool-v2/contracts/ethers/factories/SpoolStaking__factory.ts create mode 100644 src/apps/spool-v2/contracts/ethers/factories/SpoolVault__factory.ts create mode 100644 src/apps/spool-v2/contracts/ethers/factories/SpoolVospool__factory.ts create mode 100644 src/apps/spool-v2/ethereum/spool-v2.constants.ts create mode 100644 src/apps/spool-v2/ethereum/spool-v2.staking.contract-position-fetcher.ts create mode 100644 src/apps/spool-v2/ethereum/spool-v2.types.ts create mode 100644 src/apps/spool-v2/ethereum/spool-v2.vault.contract-position-fetcher.ts create mode 100644 src/apps/spool-v2/ethereum/spool-v2.vo-spool.token-fetcher.ts create mode 100644 src/apps/spool-v2/spool-v2.module.ts diff --git a/src/apps/spool-v2/contracts/abis/spool-staking.json b/src/apps/spool-v2/contracts/abis/spool-staking.json new file mode 100644 index 000000000..cec171051 --- /dev/null +++ b/src/apps/spool-v2/contracts/abis/spool-staking.json @@ -0,0 +1,810 @@ +[ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "contract IVoSPOOL", + "name": "_voSpool", + "type": "address" + }, + { + "internalType": "contract IVoSpoolRewards", + "name": "_voSpoolRewards", + "type": "address" + }, + { + "internalType": "contract IRewardDistributor", + "name": "_rewardDistributor", + "type": "address" + }, + { + "internalType": "contract ISpoolOwner", + "name": "_spoolOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "canStakeFor", + "type": "bool" + } + ], + "name": "CanStakeForSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "periodFinish", + "type": "uint32" + } + ], + "name": "PeriodFinishUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "RewardCompounded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "RewardPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "RewardRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "leftover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "periodFinish", + "type": "uint32" + } + ], + "name": "RewardUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Staked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "stakedFor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "stakedBy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakedFor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Unstaked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "VoRewardCompounded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "VoSpoolRewardPaid", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint32", + "name": "rewardsDuration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "addToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allowFor", + "type": "address" + } + ], + "name": "allowUnstakeFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "canStakeFor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "doCompoundVoSpoolRewards", + "type": "bool" + } + ], + "name": "compound", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "earned", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "doClaimVoSpoolRewards", + "type": "bool" + } + ], + "name": "getActiveRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "doClaimVoSpoolRewards", + "type": "bool" + } + ], + "name": "getRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getUpdatedVoSpoolRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "rewards", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "lastTimeRewardApplicable", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_rewardsDuration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "notifyRewardAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recoverTo", + "type": "address" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "removeReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "rewardConfiguration", + "outputs": [ + { + "internalType": "uint32", + "name": "rewardsDuration", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "periodFinish", + "type": "uint32" + }, + { + "internalType": "uint192", + "name": "rewardRate", + "type": "uint192" + }, + { + "internalType": "uint32", + "name": "lastUpdateTime", + "type": "uint32" + }, + { + "internalType": "uint224", + "name": "rewardPerTokenStored", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardDistributor", + "outputs": [ + { + "internalType": "contract IRewardDistributor", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "rewardPerToken", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "rewardTokens", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardTokensCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_canStakeFor", + "type": "bool" + } + ], + "name": "setCanStakeFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stakedBy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "tokenBlacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "updatePeriodFinish", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "voSpool", + "outputs": [ + { + "internalType": "contract IVoSPOOL", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "voSpoolRewards", + "outputs": [ + { + "internalType": "contract IVoSpoolRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/spool-v2/contracts/abis/spool-vault.json b/src/apps/spool-v2/contracts/abis/spool-vault.json new file mode 100644 index 000000000..5ac084cfe --- /dev/null +++ b/src/apps/spool-v2/contracts/abis/spool-vault.json @@ -0,0 +1,815 @@ +[ + { + "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": "account", + "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": false, + "internalType": "string", + "name": "baseUri", + "type": "string" + } + ], + "name": "BaseURIChanged", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "assetGroupId", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOfFractional", + "outputs": [ + { + "internalType": "uint256", + "name": "fractionalBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfFractionalBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fractionalBalances", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "nftIds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "nftAmounts", + "type": "uint256[]" + } + ], + "name": "burnNFTs", + "outputs": [ + { + "internalType": "bytes[]", + "name": "metadata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "vaultShares", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "strategies", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "shares", + "type": "uint256[]" + } + ], + "name": "burnVaultShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "claimer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "claimShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "nftIds", + "type": "uint256[]" + } + ], + "name": "getMetadata", + "outputs": [ + { + "internalType": "bytes[]", + "name": "metadata", + "type": "bytes[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "assets", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "initiated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flushIndex", + "type": "uint256" + } + ], + "internalType": "struct DepositMetadata", + "name": "metadata", + "type": "tuple" + } + ], + "name": "mintDepositNFT", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "vaultShares", + "type": "uint256" + } + ], + "name": "mintVaultShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "vaultShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flushIndex", + "type": "uint256" + } + ], + "internalType": "struct WithdrawalMetadata", + "name": "metadata", + "type": "tuple" + } + ], + "name": "mintWithdrawalNFT", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "uri_", + "type": "string" + } + ], + "name": "setBaseURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFromSpender", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaultName", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/spool-v2/contracts/abis/spool-vospool.json b/src/apps/spool-v2/contracts/abis/spool-vospool.json new file mode 100644 index 000000000..d8014ca64 --- /dev/null +++ b/src/apps/spool-v2/contracts/abis/spool-vospool.json @@ -0,0 +1,1173 @@ +[ + { + "inputs": [ + { + "internalType": "contract ISpoolOwner", + "name": "_spoolOwner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_firstTrancheEndTime", + "type": "uint256" + } + ], + "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": "source", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "totalMaturedVotingPower", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "totalMaturingAmount", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint56", + "name": "totalRawUnmaturedVotingPower", + "type": "uint56" + } + ], + "name": "GlobalGradualUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "burnAll", + "type": "bool" + } + ], + "name": "GradualBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "GradualMinted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "set", + "type": "bool" + } + ], + "name": "GradualMinterSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Minted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "set", + "type": "bool" + } + ], + "name": "MinterSet", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "maturedVotingPower", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "maturingAmount", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint56", + "name": "rawUnmaturedVotingPower", + "type": "uint56" + } + ], + "name": "UserGradualUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "FULL_POWER_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FULL_POWER_TRANCHES_COUNT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TRANCHE_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "burnAll", + "type": "bool" + } + ], + "name": "burnGradual", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "firstTrancheStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentTrancheIndex", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGlobalGradual", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "totalMaturedVotingPower", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "totalMaturingAmount", + "type": "uint48" + }, + { + "internalType": "uint56", + "name": "totalRawUnmaturedVotingPower", + "type": "uint56" + }, + { + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + } + ], + "internalType": "struct GlobalGradual", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastFinishedTrancheIndex", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNextTrancheEndTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNotUpdatedGlobalGradual", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "totalMaturedVotingPower", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "totalMaturingAmount", + "type": "uint48" + }, + { + "internalType": "uint56", + "name": "totalRawUnmaturedVotingPower", + "type": "uint56" + }, + { + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + } + ], + "internalType": "struct GlobalGradual", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getNotUpdatedUserGradual", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "maturedVotingPower", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "maturingAmount", + "type": "uint48" + }, + { + "internalType": "uint56", + "name": "rawUnmaturedVotingPower", + "type": "uint56" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "arrayIndex", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "position", + "type": "uint8" + } + ], + "internalType": "struct UserTranchePosition", + "name": "oldestTranchePosition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "arrayIndex", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "position", + "type": "uint8" + } + ], + "internalType": "struct UserTranchePosition", + "name": "latestTranchePosition", + "type": "tuple" + }, + { + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + } + ], + "internalType": "struct UserGradual", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalGradualVotingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "trancheIndex", + "type": "uint256" + } + ], + "name": "getTrancheEndTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "time", + "type": "uint256" + } + ], + "name": "getTrancheIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserGradual", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "maturedVotingPower", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "maturingAmount", + "type": "uint48" + }, + { + "internalType": "uint56", + "name": "rawUnmaturedVotingPower", + "type": "uint56" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "arrayIndex", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "position", + "type": "uint8" + } + ], + "internalType": "struct UserTranchePosition", + "name": "oldestTranchePosition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "arrayIndex", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "position", + "type": "uint8" + } + ], + "internalType": "struct UserTranchePosition", + "name": "latestTranchePosition", + "type": "tuple" + }, + { + "internalType": "uint16", + "name": "lastUpdatedTrancheIndex", + "type": "uint16" + } + ], + "internalType": "struct UserGradual", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserGradualVotingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "gradualMinters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "indexedGlobalTranches", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + } + ], + "internalType": "struct Tranche", + "name": "zero", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + } + ], + "internalType": "struct Tranche", + "name": "one", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + } + ], + "internalType": "struct Tranche", + "name": "two", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + } + ], + "internalType": "struct Tranche", + "name": "three", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + } + ], + "internalType": "struct Tranche", + "name": "four", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mintGradual", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gradualMinter", + "type": "address" + }, + { + "internalType": "bool", + "name": "_set", + "type": "bool" + } + ], + "name": "setGradualMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "bool", + "name": "_set", + "type": "bool" + } + ], + "name": "setMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalInstantPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "updateUserVotingPower", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateVotingPower", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userInstantPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "userTranches", + "outputs": [ + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "internalType": "struct UserTranche", + "name": "zero", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "internalType": "struct UserTranche", + "name": "one", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "internalType": "struct UserTranche", + "name": "two", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint48", + "name": "amount", + "type": "uint48" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "internalType": "struct UserTranche", + "name": "three", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/spool-v2/contracts/ethers/SpoolStaking.ts b/src/apps/spool-v2/contracts/ethers/SpoolStaking.ts new file mode 100644 index 000000000..8c1893840 --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/SpoolStaking.ts @@ -0,0 +1,998 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export interface SpoolStakingInterface extends utils.Interface { + functions: { + 'addToken(address,uint32,uint256)': FunctionFragment; + 'allowUnstakeFor(address)': FunctionFragment; + 'balances(address)': FunctionFragment; + 'canStakeFor(address)': FunctionFragment; + 'compound(bool)': FunctionFragment; + 'earned(address,address)': FunctionFragment; + 'getActiveRewards(bool)': FunctionFragment; + 'getRewards(address[],bool)': FunctionFragment; + 'getUpdatedVoSpoolRewardAmount()': FunctionFragment; + 'initialize()': FunctionFragment; + 'lastTimeRewardApplicable(address)': FunctionFragment; + 'notifyRewardAmount(address,uint32,uint256)': FunctionFragment; + 'recoverERC20(address,uint256,address)': FunctionFragment; + 'removeReward(address)': FunctionFragment; + 'rewardConfiguration(address)': FunctionFragment; + 'rewardDistributor()': FunctionFragment; + 'rewardPerToken(address)': FunctionFragment; + 'rewardTokens(uint256)': FunctionFragment; + 'rewardTokensCount()': FunctionFragment; + 'setCanStakeFor(address,bool)': FunctionFragment; + 'stake(uint256)': FunctionFragment; + 'stakeFor(address,uint256)': FunctionFragment; + 'stakedBy(address)': FunctionFragment; + 'stakingToken()': FunctionFragment; + 'tokenBlacklist(address)': FunctionFragment; + 'totalStaked()': FunctionFragment; + 'unstake(uint256)': FunctionFragment; + 'updatePeriodFinish(address,uint32)': FunctionFragment; + 'voSpool()': FunctionFragment; + 'voSpoolRewards()': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'addToken' + | 'allowUnstakeFor' + | 'balances' + | 'canStakeFor' + | 'compound' + | 'earned' + | 'getActiveRewards' + | 'getRewards' + | 'getUpdatedVoSpoolRewardAmount' + | 'initialize' + | 'lastTimeRewardApplicable' + | 'notifyRewardAmount' + | 'recoverERC20' + | 'removeReward' + | 'rewardConfiguration' + | 'rewardDistributor' + | 'rewardPerToken' + | 'rewardTokens' + | 'rewardTokensCount' + | 'setCanStakeFor' + | 'stake' + | 'stakeFor' + | 'stakedBy' + | 'stakingToken' + | 'tokenBlacklist' + | 'totalStaked' + | 'unstake' + | 'updatePeriodFinish' + | 'voSpool' + | 'voSpoolRewards', + ): FunctionFragment; + + encodeFunctionData( + functionFragment: 'addToken', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'allowUnstakeFor', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'balances', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'canStakeFor', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'compound', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'earned', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getActiveRewards', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'getRewards', + values: [PromiseOrValue[], PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'getUpdatedVoSpoolRewardAmount', values?: undefined): string; + encodeFunctionData(functionFragment: 'initialize', values?: undefined): string; + encodeFunctionData(functionFragment: 'lastTimeRewardApplicable', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'notifyRewardAmount', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'recoverERC20', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'removeReward', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'rewardConfiguration', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'rewardDistributor', values?: undefined): string; + encodeFunctionData(functionFragment: 'rewardPerToken', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'rewardTokens', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'rewardTokensCount', values?: undefined): string; + encodeFunctionData( + functionFragment: 'setCanStakeFor', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'stake', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'stakeFor', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'stakedBy', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'stakingToken', values?: undefined): string; + encodeFunctionData(functionFragment: 'tokenBlacklist', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'totalStaked', values?: undefined): string; + encodeFunctionData(functionFragment: 'unstake', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'updatePeriodFinish', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'voSpool', values?: undefined): string; + encodeFunctionData(functionFragment: 'voSpoolRewards', values?: undefined): string; + + decodeFunctionResult(functionFragment: 'addToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowUnstakeFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balances', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'canStakeFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'compound', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'earned', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getActiveRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUpdatedVoSpoolRewardAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lastTimeRewardApplicable', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'notifyRewardAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recoverERC20', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'removeReward', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardConfiguration', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardDistributor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardPerToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardTokens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardTokensCount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setCanStakeFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stake', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakeFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakedBy', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakingToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tokenBlacklist', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalStaked', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'unstake', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updatePeriodFinish', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voSpool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voSpoolRewards', data: BytesLike): Result; + + events: { + 'CanStakeForSet(address,bool)': EventFragment; + 'PeriodFinishUpdated(address,uint32)': EventFragment; + 'RewardAdded(address,uint256,uint256)': EventFragment; + 'RewardCompounded(address,uint256)': EventFragment; + 'RewardPaid(address,address,uint256)': EventFragment; + 'RewardRemoved(address)': EventFragment; + 'RewardUpdated(address,uint256,uint256,uint256,uint32)': EventFragment; + 'Staked(address,uint256)': EventFragment; + 'StakedFor(address,address,uint256)': EventFragment; + 'Unstaked(address,uint256)': EventFragment; + 'VoRewardCompounded(address,uint256)': EventFragment; + 'VoSpoolRewardPaid(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'CanStakeForSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PeriodFinishUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardAdded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardCompounded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardPaid'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardRemoved'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Staked'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'StakedFor'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Unstaked'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VoRewardCompounded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VoSpoolRewardPaid'): EventFragment; +} + +export interface CanStakeForSetEventObject { + account: string; + canStakeFor: boolean; +} +export type CanStakeForSetEvent = TypedEvent<[string, boolean], CanStakeForSetEventObject>; + +export type CanStakeForSetEventFilter = TypedEventFilter; + +export interface PeriodFinishUpdatedEventObject { + token: string; + periodFinish: number; +} +export type PeriodFinishUpdatedEvent = TypedEvent<[string, number], PeriodFinishUpdatedEventObject>; + +export type PeriodFinishUpdatedEventFilter = TypedEventFilter; + +export interface RewardAddedEventObject { + token: string; + amount: BigNumber; + duration: BigNumber; +} +export type RewardAddedEvent = TypedEvent<[string, BigNumber, BigNumber], RewardAddedEventObject>; + +export type RewardAddedEventFilter = TypedEventFilter; + +export interface RewardCompoundedEventObject { + user: string; + reward: BigNumber; +} +export type RewardCompoundedEvent = TypedEvent<[string, BigNumber], RewardCompoundedEventObject>; + +export type RewardCompoundedEventFilter = TypedEventFilter; + +export interface RewardPaidEventObject { + token: string; + user: string; + reward: BigNumber; +} +export type RewardPaidEvent = TypedEvent<[string, string, BigNumber], RewardPaidEventObject>; + +export type RewardPaidEventFilter = TypedEventFilter; + +export interface RewardRemovedEventObject { + token: string; +} +export type RewardRemovedEvent = TypedEvent<[string], RewardRemovedEventObject>; + +export type RewardRemovedEventFilter = TypedEventFilter; + +export interface RewardUpdatedEventObject { + token: string; + amount: BigNumber; + leftover: BigNumber; + duration: BigNumber; + periodFinish: number; +} +export type RewardUpdatedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, number], + RewardUpdatedEventObject +>; + +export type RewardUpdatedEventFilter = TypedEventFilter; + +export interface StakedEventObject { + user: string; + amount: BigNumber; +} +export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject>; + +export type StakedEventFilter = TypedEventFilter; + +export interface StakedForEventObject { + stakedFor: string; + stakedBy: string; + amount: BigNumber; +} +export type StakedForEvent = TypedEvent<[string, string, BigNumber], StakedForEventObject>; + +export type StakedForEventFilter = TypedEventFilter; + +export interface UnstakedEventObject { + user: string; + amount: BigNumber; +} +export type UnstakedEvent = TypedEvent<[string, BigNumber], UnstakedEventObject>; + +export type UnstakedEventFilter = TypedEventFilter; + +export interface VoRewardCompoundedEventObject { + user: string; + reward: BigNumber; +} +export type VoRewardCompoundedEvent = TypedEvent<[string, BigNumber], VoRewardCompoundedEventObject>; + +export type VoRewardCompoundedEventFilter = TypedEventFilter; + +export interface VoSpoolRewardPaidEventObject { + token: string; + user: string; + reward: BigNumber; +} +export type VoSpoolRewardPaidEvent = TypedEvent<[string, string, BigNumber], VoSpoolRewardPaidEventObject>; + +export type VoSpoolRewardPaidEventFilter = TypedEventFilter; + +export interface SpoolStaking extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SpoolStakingInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + addToken( + token: PromiseOrValue, + rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + allowUnstakeFor( + allowFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + canStakeFor(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + compound( + doCompoundVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earned( + token: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + getActiveRewards( + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getRewards( + tokens: PromiseOrValue[], + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getUpdatedVoSpoolRewardAmount( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + initialize(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + lastTimeRewardApplicable(token: PromiseOrValue, overrides?: CallOverrides): Promise<[number]>; + + notifyRewardAmount( + token: PromiseOrValue, + _rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + recoverERC20( + tokenAddress: PromiseOrValue, + tokenAmount: PromiseOrValue, + recoverTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + removeReward( + token: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardConfiguration( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [number, number, BigNumber, number, BigNumber] & { + rewardsDuration: number; + periodFinish: number; + rewardRate: BigNumber; + lastUpdateTime: number; + rewardPerTokenStored: BigNumber; + } + >; + + rewardDistributor(overrides?: CallOverrides): Promise<[string]>; + + rewardPerToken(token: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + rewardTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + + rewardTokensCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + setCanStakeFor( + account: PromiseOrValue, + _canStakeFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakeFor( + account: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakedBy(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + + stakingToken(overrides?: CallOverrides): Promise<[string]>; + + tokenBlacklist(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + totalStaked(overrides?: CallOverrides): Promise<[BigNumber]>; + + unstake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updatePeriodFinish( + token: PromiseOrValue, + timestamp: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voSpool(overrides?: CallOverrides): Promise<[string]>; + + voSpoolRewards(overrides?: CallOverrides): Promise<[string]>; + }; + + addToken( + token: PromiseOrValue, + rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + allowUnstakeFor( + allowFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + canStakeFor(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + compound( + doCompoundVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earned(token: PromiseOrValue, account: PromiseOrValue, overrides?: CallOverrides): Promise; + + getActiveRewards( + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getRewards( + tokens: PromiseOrValue[], + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getUpdatedVoSpoolRewardAmount( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + initialize(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + lastTimeRewardApplicable(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + notifyRewardAmount( + token: PromiseOrValue, + _rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + recoverERC20( + tokenAddress: PromiseOrValue, + tokenAmount: PromiseOrValue, + recoverTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + removeReward( + token: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardConfiguration( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [number, number, BigNumber, number, BigNumber] & { + rewardsDuration: number; + periodFinish: number; + rewardRate: BigNumber; + lastUpdateTime: number; + rewardPerTokenStored: BigNumber; + } + >; + + rewardDistributor(overrides?: CallOverrides): Promise; + + rewardPerToken(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokensCount(overrides?: CallOverrides): Promise; + + setCanStakeFor( + account: PromiseOrValue, + _canStakeFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakeFor( + account: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakedBy(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + stakingToken(overrides?: CallOverrides): Promise; + + tokenBlacklist(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalStaked(overrides?: CallOverrides): Promise; + + unstake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updatePeriodFinish( + token: PromiseOrValue, + timestamp: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voSpool(overrides?: CallOverrides): Promise; + + voSpoolRewards(overrides?: CallOverrides): Promise; + + callStatic: { + addToken( + token: PromiseOrValue, + rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + allowUnstakeFor(allowFor: PromiseOrValue, overrides?: CallOverrides): Promise; + + balances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + canStakeFor(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + compound(doCompoundVoSpoolRewards: PromiseOrValue, overrides?: CallOverrides): Promise; + + earned( + token: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getActiveRewards(doClaimVoSpoolRewards: PromiseOrValue, overrides?: CallOverrides): Promise; + + getRewards( + tokens: PromiseOrValue[], + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getUpdatedVoSpoolRewardAmount(overrides?: CallOverrides): Promise; + + initialize(overrides?: CallOverrides): Promise; + + lastTimeRewardApplicable(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + notifyRewardAmount( + token: PromiseOrValue, + _rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + recoverERC20( + tokenAddress: PromiseOrValue, + tokenAmount: PromiseOrValue, + recoverTo: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + removeReward(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardConfiguration( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [number, number, BigNumber, number, BigNumber] & { + rewardsDuration: number; + periodFinish: number; + rewardRate: BigNumber; + lastUpdateTime: number; + rewardPerTokenStored: BigNumber; + } + >; + + rewardDistributor(overrides?: CallOverrides): Promise; + + rewardPerToken(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokensCount(overrides?: CallOverrides): Promise; + + setCanStakeFor( + account: PromiseOrValue, + _canStakeFor: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + stake(amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + stakeFor( + account: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + stakedBy(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + stakingToken(overrides?: CallOverrides): Promise; + + tokenBlacklist(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalStaked(overrides?: CallOverrides): Promise; + + unstake(amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + updatePeriodFinish( + token: PromiseOrValue, + timestamp: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + voSpool(overrides?: CallOverrides): Promise; + + voSpoolRewards(overrides?: CallOverrides): Promise; + }; + + filters: { + 'CanStakeForSet(address,bool)'( + account?: PromiseOrValue | null, + canStakeFor?: null, + ): CanStakeForSetEventFilter; + CanStakeForSet(account?: PromiseOrValue | null, canStakeFor?: null): CanStakeForSetEventFilter; + + 'PeriodFinishUpdated(address,uint32)'( + token?: PromiseOrValue | null, + periodFinish?: null, + ): PeriodFinishUpdatedEventFilter; + PeriodFinishUpdated(token?: PromiseOrValue | null, periodFinish?: null): PeriodFinishUpdatedEventFilter; + + 'RewardAdded(address,uint256,uint256)'( + token?: PromiseOrValue | null, + amount?: null, + duration?: null, + ): RewardAddedEventFilter; + RewardAdded(token?: PromiseOrValue | null, amount?: null, duration?: null): RewardAddedEventFilter; + + 'RewardCompounded(address,uint256)'( + user?: PromiseOrValue | null, + reward?: null, + ): RewardCompoundedEventFilter; + RewardCompounded(user?: PromiseOrValue | null, reward?: null): RewardCompoundedEventFilter; + + 'RewardPaid(address,address,uint256)'( + token?: null, + user?: PromiseOrValue | null, + reward?: null, + ): RewardPaidEventFilter; + RewardPaid(token?: null, user?: PromiseOrValue | null, reward?: null): RewardPaidEventFilter; + + 'RewardRemoved(address)'(token?: PromiseOrValue | null): RewardRemovedEventFilter; + RewardRemoved(token?: PromiseOrValue | null): RewardRemovedEventFilter; + + 'RewardUpdated(address,uint256,uint256,uint256,uint32)'( + token?: PromiseOrValue | null, + amount?: null, + leftover?: null, + duration?: null, + periodFinish?: null, + ): RewardUpdatedEventFilter; + RewardUpdated( + token?: PromiseOrValue | null, + amount?: null, + leftover?: null, + duration?: null, + periodFinish?: null, + ): RewardUpdatedEventFilter; + + 'Staked(address,uint256)'(user?: PromiseOrValue | null, amount?: null): StakedEventFilter; + Staked(user?: PromiseOrValue | null, amount?: null): StakedEventFilter; + + 'StakedFor(address,address,uint256)'( + stakedFor?: PromiseOrValue | null, + stakedBy?: PromiseOrValue | null, + amount?: null, + ): StakedForEventFilter; + StakedFor( + stakedFor?: PromiseOrValue | null, + stakedBy?: PromiseOrValue | null, + amount?: null, + ): StakedForEventFilter; + + 'Unstaked(address,uint256)'(user?: PromiseOrValue | null, amount?: null): UnstakedEventFilter; + Unstaked(user?: PromiseOrValue | null, amount?: null): UnstakedEventFilter; + + 'VoRewardCompounded(address,uint256)'( + user?: PromiseOrValue | null, + reward?: null, + ): VoRewardCompoundedEventFilter; + VoRewardCompounded(user?: PromiseOrValue | null, reward?: null): VoRewardCompoundedEventFilter; + + 'VoSpoolRewardPaid(address,address,uint256)'( + token?: null, + user?: PromiseOrValue | null, + reward?: null, + ): VoSpoolRewardPaidEventFilter; + VoSpoolRewardPaid(token?: null, user?: PromiseOrValue | null, reward?: null): VoSpoolRewardPaidEventFilter; + }; + + estimateGas: { + addToken( + token: PromiseOrValue, + rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + allowUnstakeFor( + allowFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + canStakeFor(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + compound( + doCompoundVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earned( + token: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getActiveRewards( + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getRewards( + tokens: PromiseOrValue[], + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getUpdatedVoSpoolRewardAmount(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + initialize(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + lastTimeRewardApplicable(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + notifyRewardAmount( + token: PromiseOrValue, + _rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + recoverERC20( + tokenAddress: PromiseOrValue, + tokenAmount: PromiseOrValue, + recoverTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + removeReward( + token: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardConfiguration(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardDistributor(overrides?: CallOverrides): Promise; + + rewardPerToken(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokensCount(overrides?: CallOverrides): Promise; + + setCanStakeFor( + account: PromiseOrValue, + _canStakeFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakeFor( + account: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakedBy(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + stakingToken(overrides?: CallOverrides): Promise; + + tokenBlacklist(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalStaked(overrides?: CallOverrides): Promise; + + unstake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updatePeriodFinish( + token: PromiseOrValue, + timestamp: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voSpool(overrides?: CallOverrides): Promise; + + voSpoolRewards(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + addToken( + token: PromiseOrValue, + rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + allowUnstakeFor( + allowFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + canStakeFor(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + compound( + doCompoundVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earned( + token: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getActiveRewards( + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getRewards( + tokens: PromiseOrValue[], + doClaimVoSpoolRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getUpdatedVoSpoolRewardAmount( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + initialize(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + lastTimeRewardApplicable(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + notifyRewardAmount( + token: PromiseOrValue, + _rewardsDuration: PromiseOrValue, + reward: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + recoverERC20( + tokenAddress: PromiseOrValue, + tokenAmount: PromiseOrValue, + recoverTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + removeReward( + token: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardConfiguration(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardDistributor(overrides?: CallOverrides): Promise; + + rewardPerToken(token: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + rewardTokensCount(overrides?: CallOverrides): Promise; + + setCanStakeFor( + account: PromiseOrValue, + _canStakeFor: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakeFor( + account: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + stakedBy(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + stakingToken(overrides?: CallOverrides): Promise; + + tokenBlacklist(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalStaked(overrides?: CallOverrides): Promise; + + unstake( + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updatePeriodFinish( + token: PromiseOrValue, + timestamp: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voSpool(overrides?: CallOverrides): Promise; + + voSpoolRewards(overrides?: CallOverrides): Promise; + }; +} diff --git a/src/apps/spool-v2/contracts/ethers/SpoolVault.ts b/src/apps/spool-v2/contracts/ethers/SpoolVault.ts new file mode 100644 index 000000000..5376830a0 --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/SpoolVault.ts @@ -0,0 +1,1137 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export type DepositMetadataStruct = { + assets: PromiseOrValue[]; + initiated: PromiseOrValue; + flushIndex: PromiseOrValue; +}; + +export type DepositMetadataStructOutput = [BigNumber[], BigNumber, BigNumber] & { + assets: BigNumber[]; + initiated: BigNumber; + flushIndex: BigNumber; +}; + +export type WithdrawalMetadataStruct = { + vaultShares: PromiseOrValue; + flushIndex: PromiseOrValue; +}; + +export type WithdrawalMetadataStructOutput = [BigNumber, BigNumber] & { + vaultShares: BigNumber; + flushIndex: BigNumber; +}; + +export interface SpoolVaultInterface extends utils.Interface { + functions: { + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'assetGroupId()': FunctionFragment; + 'balanceOf(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'balanceOfBatch(address[],uint256[])': FunctionFragment; + 'balanceOfFractional(address,uint256)': FunctionFragment; + 'balanceOfFractionalBatch(address,uint256[])': FunctionFragment; + 'burnNFTs(address,uint256[],uint256[])': FunctionFragment; + 'burnVaultShares(address,uint256,address[],uint256[])': FunctionFragment; + 'claimShares(address,uint256)': FunctionFragment; + 'getMetadata(uint256[])': FunctionFragment; + 'isApprovedForAll(address,address)': FunctionFragment; + 'mintDepositNFT(address,(uint256[],uint256,uint256))': FunctionFragment; + 'mintVaultShares(address,uint256)': FunctionFragment; + 'mintWithdrawalNFT(address,(uint256,uint256))': FunctionFragment; + 'safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)': FunctionFragment; + 'safeTransferFrom(address,address,uint256,uint256,bytes)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setBaseURI(string)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'transferFromSpender(address,address,uint256)': FunctionFragment; + 'uri(uint256)': FunctionFragment; + 'vaultName()': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'allowance' + | 'approve' + | 'assetGroupId' + | 'balanceOf(address,uint256)' + | 'balanceOf(address)' + | 'balanceOfBatch' + | 'balanceOfFractional' + | 'balanceOfFractionalBatch' + | 'burnNFTs' + | 'burnVaultShares' + | 'claimShares' + | 'getMetadata' + | 'isApprovedForAll' + | 'mintDepositNFT' + | 'mintVaultShares' + | 'mintWithdrawalNFT' + | 'safeBatchTransferFrom' + | 'safeTransferFrom' + | 'setApprovalForAll' + | 'setBaseURI' + | 'supportsInterface' + | 'totalSupply' + | 'transfer' + | 'transferFrom' + | 'transferFromSpender' + | 'uri' + | 'vaultName', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'allowance', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'approve', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'assetGroupId', values?: undefined): string; + encodeFunctionData( + functionFragment: 'balanceOf(address,uint256)', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'balanceOf(address)', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'balanceOfBatch', + values: [PromiseOrValue[], PromiseOrValue[]], + ): string; + encodeFunctionData( + functionFragment: 'balanceOfFractional', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'balanceOfFractionalBatch', + values: [PromiseOrValue, PromiseOrValue[]], + ): string; + encodeFunctionData( + functionFragment: 'burnNFTs', + values: [PromiseOrValue, PromiseOrValue[], PromiseOrValue[]], + ): string; + encodeFunctionData( + functionFragment: 'burnVaultShares', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + ], + ): string; + encodeFunctionData( + functionFragment: 'claimShares', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'getMetadata', values: [PromiseOrValue[]]): string; + encodeFunctionData( + functionFragment: 'isApprovedForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'mintDepositNFT', + values: [PromiseOrValue, DepositMetadataStruct], + ): string; + encodeFunctionData( + functionFragment: 'mintVaultShares', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'mintWithdrawalNFT', + values: [PromiseOrValue, WithdrawalMetadataStruct], + ): string; + encodeFunctionData( + functionFragment: 'safeBatchTransferFrom', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + PromiseOrValue, + ], + ): string; + encodeFunctionData( + functionFragment: 'safeTransferFrom', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string; + encodeFunctionData( + functionFragment: 'setApprovalForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'setBaseURI', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'transferFromSpender', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'uri', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'vaultName', values?: undefined): string; + + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'assetGroupId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf(address,uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf(address)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOfBatch', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOfFractional', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOfFractionalBatch', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burnNFTs', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burnVaultShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'claimShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getMetadata', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mintDepositNFT', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mintVaultShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mintWithdrawalNFT', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeBatchTransferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBaseURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFromSpender', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uri', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'vaultName', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'ApprovalForAll(address,address,bool)': EventFragment; + 'BaseURIChanged(string)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'TransferBatch(address,address,address,uint256[],uint256[])': EventFragment; + 'TransferSingle(address,address,address,uint256,uint256)': EventFragment; + 'URI(string,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BaseURIChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TransferBatch'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TransferSingle'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'URI'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface ApprovalForAllEventObject { + account: string; + operator: string; + approved: boolean; +} +export type ApprovalForAllEvent = TypedEvent<[string, string, boolean], ApprovalForAllEventObject>; + +export type ApprovalForAllEventFilter = TypedEventFilter; + +export interface BaseURIChangedEventObject { + baseUri: string; +} +export type BaseURIChangedEvent = TypedEvent<[string], BaseURIChangedEventObject>; + +export type BaseURIChangedEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface TransferBatchEventObject { + operator: string; + from: string; + to: string; + ids: BigNumber[]; + values: BigNumber[]; +} +export type TransferBatchEvent = TypedEvent< + [string, string, string, BigNumber[], BigNumber[]], + TransferBatchEventObject +>; + +export type TransferBatchEventFilter = TypedEventFilter; + +export interface TransferSingleEventObject { + operator: string; + from: string; + to: string; + id: BigNumber; + value: BigNumber; +} +export type TransferSingleEvent = TypedEvent<[string, string, string, BigNumber, BigNumber], TransferSingleEventObject>; + +export type TransferSingleEventFilter = TypedEventFilter; + +export interface URIEventObject { + value: string; + id: BigNumber; +} +export type URIEvent = TypedEvent<[string, BigNumber], URIEventObject>; + +export type URIEventFilter = TypedEventFilter; + +export interface SpoolVault extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SpoolVaultInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + assetGroupId(overrides?: CallOverrides): Promise<[BigNumber] & { id: BigNumber }>; + + 'balanceOf(address,uint256)'( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + 'balanceOf(address)'(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[BigNumber[]]>; + + balanceOfFractional( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { fractionalBalance: BigNumber }>; + + balanceOfFractionalBatch( + account: PromiseOrValue, + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[BigNumber[]] & { fractionalBalances: BigNumber[] }>; + + burnNFTs( + owner: PromiseOrValue, + nftIds: PromiseOrValue[], + nftAmounts: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnVaultShares( + owner: PromiseOrValue, + vaultShares: PromiseOrValue, + strategies: PromiseOrValue[], + shares: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimShares( + claimer: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getMetadata( + nftIds: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[]] & { metadata: string[] }>; + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + mintDepositNFT( + receiver: PromiseOrValue, + metadata: DepositMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintVaultShares( + receiver: PromiseOrValue, + vaultShares: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintWithdrawalNFT( + receiver: PromiseOrValue, + metadata: WithdrawalMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setBaseURI( + uri_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFromSpender( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + uri(id: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + + vaultName(overrides?: CallOverrides): Promise<[string] & { name: string }>; + }; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + assetGroupId(overrides?: CallOverrides): Promise; + + 'balanceOf(address,uint256)'( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + 'balanceOf(address)'(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + balanceOfFractional( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOfFractionalBatch( + account: PromiseOrValue, + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + burnNFTs( + owner: PromiseOrValue, + nftIds: PromiseOrValue[], + nftAmounts: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnVaultShares( + owner: PromiseOrValue, + vaultShares: PromiseOrValue, + strategies: PromiseOrValue[], + shares: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimShares( + claimer: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getMetadata(nftIds: PromiseOrValue[], overrides?: CallOverrides): Promise; + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mintDepositNFT( + receiver: PromiseOrValue, + metadata: DepositMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintVaultShares( + receiver: PromiseOrValue, + vaultShares: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintWithdrawalNFT( + receiver: PromiseOrValue, + metadata: WithdrawalMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setBaseURI( + uri_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFromSpender( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + uri(id: PromiseOrValue, overrides?: CallOverrides): Promise; + + vaultName(overrides?: CallOverrides): Promise; + + callStatic: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + assetGroupId(overrides?: CallOverrides): Promise; + + 'balanceOf(address,uint256)'( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + 'balanceOf(address)'(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + balanceOfFractional( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOfFractionalBatch( + account: PromiseOrValue, + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + burnNFTs( + owner: PromiseOrValue, + nftIds: PromiseOrValue[], + nftAmounts: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + burnVaultShares( + owner: PromiseOrValue, + vaultShares: PromiseOrValue, + strategies: PromiseOrValue[], + shares: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + claimShares( + claimer: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getMetadata(nftIds: PromiseOrValue[], overrides?: CallOverrides): Promise; + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mintDepositNFT( + receiver: PromiseOrValue, + metadata: DepositMetadataStruct, + overrides?: CallOverrides, + ): Promise; + + mintVaultShares( + receiver: PromiseOrValue, + vaultShares: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mintWithdrawalNFT( + receiver: PromiseOrValue, + metadata: WithdrawalMetadataStruct, + overrides?: CallOverrides, + ): Promise; + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setBaseURI(uri_: PromiseOrValue, overrides?: CallOverrides): Promise; + + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFromSpender( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + uri(id: PromiseOrValue, overrides?: CallOverrides): Promise; + + vaultName(overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + + 'ApprovalForAll(address,address,bool)'( + account?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter; + ApprovalForAll( + account?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter; + + 'BaseURIChanged(string)'(baseUri?: null): BaseURIChangedEventFilter; + BaseURIChanged(baseUri?: null): BaseURIChangedEventFilter; + + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + + 'TransferBatch(address,address,address,uint256[],uint256[])'( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + ids?: null, + values?: null, + ): TransferBatchEventFilter; + TransferBatch( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + ids?: null, + values?: null, + ): TransferBatchEventFilter; + + 'TransferSingle(address,address,address,uint256,uint256)'( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + id?: null, + value?: null, + ): TransferSingleEventFilter; + TransferSingle( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + id?: null, + value?: null, + ): TransferSingleEventFilter; + + 'URI(string,uint256)'(value?: null, id?: PromiseOrValue | null): URIEventFilter; + URI(value?: null, id?: PromiseOrValue | null): URIEventFilter; + }; + + estimateGas: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + assetGroupId(overrides?: CallOverrides): Promise; + + 'balanceOf(address,uint256)'( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + 'balanceOf(address)'(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + balanceOfFractional( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOfFractionalBatch( + account: PromiseOrValue, + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + burnNFTs( + owner: PromiseOrValue, + nftIds: PromiseOrValue[], + nftAmounts: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnVaultShares( + owner: PromiseOrValue, + vaultShares: PromiseOrValue, + strategies: PromiseOrValue[], + shares: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimShares( + claimer: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getMetadata(nftIds: PromiseOrValue[], overrides?: CallOverrides): Promise; + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mintDepositNFT( + receiver: PromiseOrValue, + metadata: DepositMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintVaultShares( + receiver: PromiseOrValue, + vaultShares: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintWithdrawalNFT( + receiver: PromiseOrValue, + metadata: WithdrawalMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setBaseURI( + uri_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFromSpender( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + uri(id: PromiseOrValue, overrides?: CallOverrides): Promise; + + vaultName(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + assetGroupId(overrides?: CallOverrides): Promise; + + 'balanceOf(address,uint256)'( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + 'balanceOf(address)'(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + balanceOfFractional( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOfFractionalBatch( + account: PromiseOrValue, + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + burnNFTs( + owner: PromiseOrValue, + nftIds: PromiseOrValue[], + nftAmounts: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnVaultShares( + owner: PromiseOrValue, + vaultShares: PromiseOrValue, + strategies: PromiseOrValue[], + shares: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimShares( + claimer: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + getMetadata(nftIds: PromiseOrValue[], overrides?: CallOverrides): Promise; + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mintDepositNFT( + receiver: PromiseOrValue, + metadata: DepositMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintVaultShares( + receiver: PromiseOrValue, + vaultShares: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintWithdrawalNFT( + receiver: PromiseOrValue, + metadata: WithdrawalMetadataStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setBaseURI( + uri_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFromSpender( + from: PromiseOrValue, + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + uri(id: PromiseOrValue, overrides?: CallOverrides): Promise; + + vaultName(overrides?: CallOverrides): Promise; + }; +} diff --git a/src/apps/spool-v2/contracts/ethers/SpoolVospool.ts b/src/apps/spool-v2/contracts/ethers/SpoolVospool.ts new file mode 100644 index 000000000..57cbcf754 --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/SpoolVospool.ts @@ -0,0 +1,1157 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export type GlobalGradualStruct = { + totalMaturedVotingPower: PromiseOrValue; + totalMaturingAmount: PromiseOrValue; + totalRawUnmaturedVotingPower: PromiseOrValue; + lastUpdatedTrancheIndex: PromiseOrValue; +}; + +export type GlobalGradualStructOutput = [number, number, BigNumber, number] & { + totalMaturedVotingPower: number; + totalMaturingAmount: number; + totalRawUnmaturedVotingPower: BigNumber; + lastUpdatedTrancheIndex: number; +}; + +export type UserTranchePositionStruct = { + arrayIndex: PromiseOrValue; + position: PromiseOrValue; +}; + +export type UserTranchePositionStructOutput = [number, number] & { + arrayIndex: number; + position: number; +}; + +export type UserGradualStruct = { + maturedVotingPower: PromiseOrValue; + maturingAmount: PromiseOrValue; + rawUnmaturedVotingPower: PromiseOrValue; + oldestTranchePosition: UserTranchePositionStruct; + latestTranchePosition: UserTranchePositionStruct; + lastUpdatedTrancheIndex: PromiseOrValue; +}; + +export type UserGradualStructOutput = [ + number, + number, + BigNumber, + UserTranchePositionStructOutput, + UserTranchePositionStructOutput, + number, +] & { + maturedVotingPower: number; + maturingAmount: number; + rawUnmaturedVotingPower: BigNumber; + oldestTranchePosition: UserTranchePositionStructOutput; + latestTranchePosition: UserTranchePositionStructOutput; + lastUpdatedTrancheIndex: number; +}; + +export type TrancheStruct = { amount: PromiseOrValue }; + +export type TrancheStructOutput = [number] & { amount: number }; + +export type UserTrancheStruct = { + amount: PromiseOrValue; + index: PromiseOrValue; +}; + +export type UserTrancheStructOutput = [number, number] & { + amount: number; + index: number; +}; + +export interface SpoolVospoolInterface extends utils.Interface { + functions: { + 'FULL_POWER_TIME()': FunctionFragment; + 'FULL_POWER_TRANCHES_COUNT()': FunctionFragment; + 'TRANCHE_TIME()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(address,uint256)': FunctionFragment; + 'burnGradual(address,uint256,bool)': FunctionFragment; + 'decimals()': FunctionFragment; + 'firstTrancheStartTime()': FunctionFragment; + 'getCurrentTrancheIndex()': FunctionFragment; + 'getGlobalGradual()': FunctionFragment; + 'getLastFinishedTrancheIndex()': FunctionFragment; + 'getNextTrancheEndTime()': FunctionFragment; + 'getNotUpdatedGlobalGradual()': FunctionFragment; + 'getNotUpdatedUserGradual(address)': FunctionFragment; + 'getTotalGradualVotingPower()': FunctionFragment; + 'getTrancheEndTime(uint256)': FunctionFragment; + 'getTrancheIndex(uint256)': FunctionFragment; + 'getUserGradual(address)': FunctionFragment; + 'getUserGradualVotingPower(address)': FunctionFragment; + 'gradualMinters(address)': FunctionFragment; + 'indexedGlobalTranches(uint256)': FunctionFragment; + 'mint(address,uint256)': FunctionFragment; + 'mintGradual(address,uint256)': FunctionFragment; + 'minters(address)': FunctionFragment; + 'name()': FunctionFragment; + 'setGradualMinter(address,bool)': FunctionFragment; + 'setMinter(address,bool)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalInstantPower()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'updateUserVotingPower(address)': FunctionFragment; + 'updateVotingPower()': FunctionFragment; + 'userInstantPower(address)': FunctionFragment; + 'userTranches(address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'FULL_POWER_TIME' + | 'FULL_POWER_TRANCHES_COUNT' + | 'TRANCHE_TIME' + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'burnGradual' + | 'decimals' + | 'firstTrancheStartTime' + | 'getCurrentTrancheIndex' + | 'getGlobalGradual' + | 'getLastFinishedTrancheIndex' + | 'getNextTrancheEndTime' + | 'getNotUpdatedGlobalGradual' + | 'getNotUpdatedUserGradual' + | 'getTotalGradualVotingPower' + | 'getTrancheEndTime' + | 'getTrancheIndex' + | 'getUserGradual' + | 'getUserGradualVotingPower' + | 'gradualMinters' + | 'indexedGlobalTranches' + | 'mint' + | 'mintGradual' + | 'minters' + | 'name' + | 'setGradualMinter' + | 'setMinter' + | 'symbol' + | 'totalInstantPower' + | 'totalSupply' + | 'transfer' + | 'transferFrom' + | 'updateUserVotingPower' + | 'updateVotingPower' + | 'userInstantPower' + | 'userTranches', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'FULL_POWER_TIME', values?: undefined): string; + encodeFunctionData(functionFragment: 'FULL_POWER_TRANCHES_COUNT', values?: undefined): string; + encodeFunctionData(functionFragment: 'TRANCHE_TIME', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'approve', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'burn', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'burnGradual', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'firstTrancheStartTime', values?: undefined): string; + encodeFunctionData(functionFragment: 'getCurrentTrancheIndex', values?: undefined): string; + encodeFunctionData(functionFragment: 'getGlobalGradual', values?: undefined): string; + encodeFunctionData(functionFragment: 'getLastFinishedTrancheIndex', values?: undefined): string; + encodeFunctionData(functionFragment: 'getNextTrancheEndTime', values?: undefined): string; + encodeFunctionData(functionFragment: 'getNotUpdatedGlobalGradual', values?: undefined): string; + encodeFunctionData(functionFragment: 'getNotUpdatedUserGradual', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getTotalGradualVotingPower', values?: undefined): string; + encodeFunctionData(functionFragment: 'getTrancheEndTime', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getTrancheIndex', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getUserGradual', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getUserGradualVotingPower', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'gradualMinters', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'indexedGlobalTranches', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'mint', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'mintGradual', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'minters', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData( + functionFragment: 'setGradualMinter', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'setMinter', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalInstantPower', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'updateUserVotingPower', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'updateVotingPower', values?: undefined): string; + encodeFunctionData(functionFragment: 'userInstantPower', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'userTranches', + values: [PromiseOrValue, PromiseOrValue], + ): string; + + decodeFunctionResult(functionFragment: 'FULL_POWER_TIME', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'FULL_POWER_TRANCHES_COUNT', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'TRANCHE_TIME', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burnGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'firstTrancheStartTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getCurrentTrancheIndex', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getGlobalGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLastFinishedTrancheIndex', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getNextTrancheEndTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getNotUpdatedGlobalGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getNotUpdatedUserGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTotalGradualVotingPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTrancheEndTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTrancheIndex', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUserGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUserGradualVotingPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gradualMinters', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'indexedGlobalTranches', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mintGradual', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'minters', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setGradualMinter', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setMinter', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalInstantPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateUserVotingPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateVotingPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'userInstantPower', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'userTranches', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Burned(address,uint256)': EventFragment; + 'GlobalGradualUpdated(uint16,uint48,uint48,uint56)': EventFragment; + 'GradualBurned(address,uint256,bool)': EventFragment; + 'GradualMinted(address,uint256)': EventFragment; + 'GradualMinterSet(address,bool)': EventFragment; + 'Minted(address,uint256)': EventFragment; + 'MinterSet(address,bool)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'UserGradualUpdated(address,uint16,uint48,uint48,uint56)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Burned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GlobalGradualUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GradualBurned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GradualMinted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GradualMinterSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Minted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'MinterSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'UserGradualUpdated'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface BurnedEventObject { + source: string; + amount: BigNumber; +} +export type BurnedEvent = TypedEvent<[string, BigNumber], BurnedEventObject>; + +export type BurnedEventFilter = TypedEventFilter; + +export interface GlobalGradualUpdatedEventObject { + lastUpdatedTrancheIndex: number; + totalMaturedVotingPower: number; + totalMaturingAmount: number; + totalRawUnmaturedVotingPower: BigNumber; +} +export type GlobalGradualUpdatedEvent = TypedEvent< + [number, number, number, BigNumber], + GlobalGradualUpdatedEventObject +>; + +export type GlobalGradualUpdatedEventFilter = TypedEventFilter; + +export interface GradualBurnedEventObject { + source: string; + amount: BigNumber; + burnAll: boolean; +} +export type GradualBurnedEvent = TypedEvent<[string, BigNumber, boolean], GradualBurnedEventObject>; + +export type GradualBurnedEventFilter = TypedEventFilter; + +export interface GradualMintedEventObject { + recipient: string; + amount: BigNumber; +} +export type GradualMintedEvent = TypedEvent<[string, BigNumber], GradualMintedEventObject>; + +export type GradualMintedEventFilter = TypedEventFilter; + +export interface GradualMinterSetEventObject { + minter: string; + set: boolean; +} +export type GradualMinterSetEvent = TypedEvent<[string, boolean], GradualMinterSetEventObject>; + +export type GradualMinterSetEventFilter = TypedEventFilter; + +export interface MintedEventObject { + recipient: string; + amount: BigNumber; +} +export type MintedEvent = TypedEvent<[string, BigNumber], MintedEventObject>; + +export type MintedEventFilter = TypedEventFilter; + +export interface MinterSetEventObject { + minter: string; + set: boolean; +} +export type MinterSetEvent = TypedEvent<[string, boolean], MinterSetEventObject>; + +export type MinterSetEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface UserGradualUpdatedEventObject { + user: string; + lastUpdatedTrancheIndex: number; + maturedVotingPower: number; + maturingAmount: number; + rawUnmaturedVotingPower: BigNumber; +} +export type UserGradualUpdatedEvent = TypedEvent< + [string, number, number, number, BigNumber], + UserGradualUpdatedEventObject +>; + +export type UserGradualUpdatedEventFilter = TypedEventFilter; + +export interface SpoolVospool extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SpoolVospoolInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + FULL_POWER_TIME(overrides?: CallOverrides): Promise<[BigNumber]>; + + FULL_POWER_TRANCHES_COUNT(overrides?: CallOverrides): Promise<[BigNumber]>; + + TRANCHE_TIME(overrides?: CallOverrides): Promise<[BigNumber]>; + + allowance( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + from: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnGradual( + from: PromiseOrValue, + amount: PromiseOrValue, + burnAll: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + firstTrancheStartTime(overrides?: CallOverrides): Promise<[BigNumber]>; + + getCurrentTrancheIndex(overrides?: CallOverrides): Promise<[number]>; + + getGlobalGradual(overrides?: CallOverrides): Promise<[GlobalGradualStructOutput]>; + + getLastFinishedTrancheIndex(overrides?: CallOverrides): Promise<[number]>; + + getNextTrancheEndTime(overrides?: CallOverrides): Promise<[BigNumber]>; + + getNotUpdatedGlobalGradual(overrides?: CallOverrides): Promise<[GlobalGradualStructOutput]>; + + getNotUpdatedUserGradual( + user: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[UserGradualStructOutput]>; + + getTotalGradualVotingPower(overrides?: CallOverrides): Promise<[BigNumber]>; + + getTrancheEndTime(trancheIndex: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + getTrancheIndex(time: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + getUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise<[UserGradualStructOutput]>; + + getUserGradualVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + gradualMinters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + indexedGlobalTranches( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput] & { + zero: TrancheStructOutput; + one: TrancheStructOutput; + two: TrancheStructOutput; + three: TrancheStructOutput; + four: TrancheStructOutput; + } + >; + + mint( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintGradual( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + minters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + name(overrides?: CallOverrides): Promise<[string]>; + + setGradualMinter( + _gradualMinter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setMinter( + _minter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalInstantPower(overrides?: CallOverrides): Promise<[BigNumber]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + transferFrom( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + updateUserVotingPower( + user: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updateVotingPower(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + userInstantPower(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + userTranches( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput] & { + zero: UserTrancheStructOutput; + one: UserTrancheStructOutput; + two: UserTrancheStructOutput; + three: UserTrancheStructOutput; + } + >; + }; + + FULL_POWER_TIME(overrides?: CallOverrides): Promise; + + FULL_POWER_TRANCHES_COUNT(overrides?: CallOverrides): Promise; + + TRANCHE_TIME(overrides?: CallOverrides): Promise; + + allowance(arg0: PromiseOrValue, arg1: PromiseOrValue, overrides?: CallOverrides): Promise; + + approve( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + from: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnGradual( + from: PromiseOrValue, + amount: PromiseOrValue, + burnAll: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + firstTrancheStartTime(overrides?: CallOverrides): Promise; + + getCurrentTrancheIndex(overrides?: CallOverrides): Promise; + + getGlobalGradual(overrides?: CallOverrides): Promise; + + getLastFinishedTrancheIndex(overrides?: CallOverrides): Promise; + + getNextTrancheEndTime(overrides?: CallOverrides): Promise; + + getNotUpdatedGlobalGradual(overrides?: CallOverrides): Promise; + + getNotUpdatedUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTotalGradualVotingPower(overrides?: CallOverrides): Promise; + + getTrancheEndTime(trancheIndex: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTrancheIndex(time: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradualVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + gradualMinters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + indexedGlobalTranches( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput] & { + zero: TrancheStructOutput; + one: TrancheStructOutput; + two: TrancheStructOutput; + three: TrancheStructOutput; + four: TrancheStructOutput; + } + >; + + mint( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintGradual( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + minters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + setGradualMinter( + _gradualMinter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setMinter( + _minter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalInstantPower(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + updateUserVotingPower( + user: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updateVotingPower(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + userInstantPower(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + userTranches( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput] & { + zero: UserTrancheStructOutput; + one: UserTrancheStructOutput; + two: UserTrancheStructOutput; + three: UserTrancheStructOutput; + } + >; + + callStatic: { + FULL_POWER_TIME(overrides?: CallOverrides): Promise; + + FULL_POWER_TRANCHES_COUNT(overrides?: CallOverrides): Promise; + + TRANCHE_TIME(overrides?: CallOverrides): Promise; + + allowance( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn(from: PromiseOrValue, amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + burnGradual( + from: PromiseOrValue, + amount: PromiseOrValue, + burnAll: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + firstTrancheStartTime(overrides?: CallOverrides): Promise; + + getCurrentTrancheIndex(overrides?: CallOverrides): Promise; + + getGlobalGradual(overrides?: CallOverrides): Promise; + + getLastFinishedTrancheIndex(overrides?: CallOverrides): Promise; + + getNextTrancheEndTime(overrides?: CallOverrides): Promise; + + getNotUpdatedGlobalGradual(overrides?: CallOverrides): Promise; + + getNotUpdatedUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTotalGradualVotingPower(overrides?: CallOverrides): Promise; + + getTrancheEndTime(trancheIndex: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTrancheIndex(time: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradualVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + gradualMinters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + indexedGlobalTranches( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput, TrancheStructOutput] & { + zero: TrancheStructOutput; + one: TrancheStructOutput; + two: TrancheStructOutput; + three: TrancheStructOutput; + four: TrancheStructOutput; + } + >; + + mint(to: PromiseOrValue, amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + mintGradual( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + minters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + setGradualMinter( + _gradualMinter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setMinter(_minter: PromiseOrValue, _set: PromiseOrValue, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalInstantPower(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + updateUserVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + updateVotingPower(overrides?: CallOverrides): Promise; + + userInstantPower(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + userTranches( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput, UserTrancheStructOutput] & { + zero: UserTrancheStructOutput; + one: UserTrancheStructOutput; + two: UserTrancheStructOutput; + three: UserTrancheStructOutput; + } + >; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + + 'Burned(address,uint256)'(source?: PromiseOrValue | null, amount?: null): BurnedEventFilter; + Burned(source?: PromiseOrValue | null, amount?: null): BurnedEventFilter; + + 'GlobalGradualUpdated(uint16,uint48,uint48,uint56)'( + lastUpdatedTrancheIndex?: PromiseOrValue | null, + totalMaturedVotingPower?: null, + totalMaturingAmount?: null, + totalRawUnmaturedVotingPower?: null, + ): GlobalGradualUpdatedEventFilter; + GlobalGradualUpdated( + lastUpdatedTrancheIndex?: PromiseOrValue | null, + totalMaturedVotingPower?: null, + totalMaturingAmount?: null, + totalRawUnmaturedVotingPower?: null, + ): GlobalGradualUpdatedEventFilter; + + 'GradualBurned(address,uint256,bool)'( + source?: PromiseOrValue | null, + amount?: null, + burnAll?: null, + ): GradualBurnedEventFilter; + GradualBurned(source?: PromiseOrValue | null, amount?: null, burnAll?: null): GradualBurnedEventFilter; + + 'GradualMinted(address,uint256)'( + recipient?: PromiseOrValue | null, + amount?: null, + ): GradualMintedEventFilter; + GradualMinted(recipient?: PromiseOrValue | null, amount?: null): GradualMintedEventFilter; + + 'GradualMinterSet(address,bool)'(minter?: PromiseOrValue | null, set?: null): GradualMinterSetEventFilter; + GradualMinterSet(minter?: PromiseOrValue | null, set?: null): GradualMinterSetEventFilter; + + 'Minted(address,uint256)'(recipient?: PromiseOrValue | null, amount?: null): MintedEventFilter; + Minted(recipient?: PromiseOrValue | null, amount?: null): MintedEventFilter; + + 'MinterSet(address,bool)'(minter?: PromiseOrValue | null, set?: null): MinterSetEventFilter; + MinterSet(minter?: PromiseOrValue | null, set?: null): MinterSetEventFilter; + + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + + 'UserGradualUpdated(address,uint16,uint48,uint48,uint56)'( + user?: PromiseOrValue | null, + lastUpdatedTrancheIndex?: PromiseOrValue | null, + maturedVotingPower?: null, + maturingAmount?: null, + rawUnmaturedVotingPower?: null, + ): UserGradualUpdatedEventFilter; + UserGradualUpdated( + user?: PromiseOrValue | null, + lastUpdatedTrancheIndex?: PromiseOrValue | null, + maturedVotingPower?: null, + maturingAmount?: null, + rawUnmaturedVotingPower?: null, + ): UserGradualUpdatedEventFilter; + }; + + estimateGas: { + FULL_POWER_TIME(overrides?: CallOverrides): Promise; + + FULL_POWER_TRANCHES_COUNT(overrides?: CallOverrides): Promise; + + TRANCHE_TIME(overrides?: CallOverrides): Promise; + + allowance( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + from: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnGradual( + from: PromiseOrValue, + amount: PromiseOrValue, + burnAll: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + firstTrancheStartTime(overrides?: CallOverrides): Promise; + + getCurrentTrancheIndex(overrides?: CallOverrides): Promise; + + getGlobalGradual(overrides?: CallOverrides): Promise; + + getLastFinishedTrancheIndex(overrides?: CallOverrides): Promise; + + getNextTrancheEndTime(overrides?: CallOverrides): Promise; + + getNotUpdatedGlobalGradual(overrides?: CallOverrides): Promise; + + getNotUpdatedUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTotalGradualVotingPower(overrides?: CallOverrides): Promise; + + getTrancheEndTime(trancheIndex: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTrancheIndex(time: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradualVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + gradualMinters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + indexedGlobalTranches(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + mint( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintGradual( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + minters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + setGradualMinter( + _gradualMinter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setMinter( + _minter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalInstantPower(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + updateUserVotingPower( + user: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updateVotingPower(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + userInstantPower(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + userTranches( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + }; + + populateTransaction: { + FULL_POWER_TIME(overrides?: CallOverrides): Promise; + + FULL_POWER_TRANCHES_COUNT(overrides?: CallOverrides): Promise; + + TRANCHE_TIME(overrides?: CallOverrides): Promise; + + allowance( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + from: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + burnGradual( + from: PromiseOrValue, + amount: PromiseOrValue, + burnAll: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + firstTrancheStartTime(overrides?: CallOverrides): Promise; + + getCurrentTrancheIndex(overrides?: CallOverrides): Promise; + + getGlobalGradual(overrides?: CallOverrides): Promise; + + getLastFinishedTrancheIndex(overrides?: CallOverrides): Promise; + + getNextTrancheEndTime(overrides?: CallOverrides): Promise; + + getNotUpdatedGlobalGradual(overrides?: CallOverrides): Promise; + + getNotUpdatedUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getTotalGradualVotingPower(overrides?: CallOverrides): Promise; + + getTrancheEndTime( + trancheIndex: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + getTrancheIndex(time: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradual(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + getUserGradualVotingPower(user: PromiseOrValue, overrides?: CallOverrides): Promise; + + gradualMinters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + indexedGlobalTranches(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + mint( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mintGradual( + to: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + minters(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + setGradualMinter( + _gradualMinter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setMinter( + _minter: PromiseOrValue, + _set: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalInstantPower(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + updateUserVotingPower( + user: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + updateVotingPower(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + userInstantPower(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + userTranches( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + }; +} diff --git a/src/apps/spool-v2/contracts/ethers/factories/SpoolStaking__factory.ts b/src/apps/spool-v2/contracts/ethers/factories/SpoolStaking__factory.ts new file mode 100644 index 000000000..c0bda24f6 --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/factories/SpoolStaking__factory.ts @@ -0,0 +1,828 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { SpoolStaking, SpoolStakingInterface } from '../SpoolStaking'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract IERC20', + name: '_stakingToken', + type: 'address', + }, + { + internalType: 'contract IVoSPOOL', + name: '_voSpool', + type: 'address', + }, + { + internalType: 'contract IVoSpoolRewards', + name: '_voSpoolRewards', + type: 'address', + }, + { + internalType: 'contract IRewardDistributor', + name: '_rewardDistributor', + type: 'address', + }, + { + internalType: 'contract ISpoolOwner', + name: '_spoolOwner', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'canStakeFor', + type: 'bool', + }, + ], + name: 'CanStakeForSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint32', + name: 'periodFinish', + type: 'uint32', + }, + ], + name: 'PeriodFinishUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'RewardAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardCompounded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardPaid', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + ], + name: 'RewardRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'leftover', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint32', + name: 'periodFinish', + type: 'uint32', + }, + ], + name: 'RewardUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'stakedFor', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'stakedBy', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'StakedFor', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Unstaked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'VoRewardCompounded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'VoSpoolRewardPaid', + type: 'event', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'uint32', + name: 'rewardsDuration', + type: 'uint32', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'addToken', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'allowFor', + type: 'address', + }, + ], + name: 'allowUnstakeFor', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'balances', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'canStakeFor', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'doCompoundVoSpoolRewards', + type: 'bool', + }, + ], + name: 'compound', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'earned', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'doClaimVoSpoolRewards', + type: 'bool', + }, + ], + name: 'getActiveRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20[]', + name: 'tokens', + type: 'address[]', + }, + { + internalType: 'bool', + name: 'doClaimVoSpoolRewards', + type: 'bool', + }, + ], + name: 'getRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getUpdatedVoSpoolRewardAmount', + outputs: [ + { + internalType: 'uint256', + name: 'rewards', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + ], + name: 'lastTimeRewardApplicable', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'uint32', + name: '_rewardsDuration', + type: 'uint32', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'notifyRewardAmount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recoverTo', + type: 'address', + }, + ], + name: 'recoverERC20', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + ], + name: 'removeReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + name: 'rewardConfiguration', + outputs: [ + { + internalType: 'uint32', + name: 'rewardsDuration', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'periodFinish', + type: 'uint32', + }, + { + internalType: 'uint192', + name: 'rewardRate', + type: 'uint192', + }, + { + internalType: 'uint32', + name: 'lastUpdateTime', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'rewardPerTokenStored', + type: 'uint224', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'rewardDistributor', + outputs: [ + { + internalType: 'contract IRewardDistributor', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + ], + name: 'rewardPerToken', + outputs: [ + { + internalType: 'uint224', + name: '', + type: 'uint224', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'rewardTokens', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'rewardTokensCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'bool', + name: '_canStakeFor', + type: 'bool', + }, + ], + name: 'setCanStakeFor', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stakeFor', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'stakedBy', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'stakingToken', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + name: 'tokenBlacklist', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'unstake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'uint32', + name: 'timestamp', + type: 'uint32', + }, + ], + name: 'updatePeriodFinish', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'voSpool', + outputs: [ + { + internalType: 'contract IVoSPOOL', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'voSpoolRewards', + outputs: [ + { + internalType: 'contract IVoSpoolRewards', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class SpoolStaking__factory { + static readonly abi = _abi; + static createInterface(): SpoolStakingInterface { + return new utils.Interface(_abi) as SpoolStakingInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): SpoolStaking { + return new Contract(address, _abi, signerOrProvider) as SpoolStaking; + } +} diff --git a/src/apps/spool-v2/contracts/ethers/factories/SpoolVault__factory.ts b/src/apps/spool-v2/contracts/ethers/factories/SpoolVault__factory.ts new file mode 100644 index 000000000..d15d8f39e --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/factories/SpoolVault__factory.ts @@ -0,0 +1,833 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { SpoolVault, SpoolVaultInterface } from '../SpoolVault'; + +const _abi = [ + { + 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: 'account', + 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: false, + internalType: 'string', + name: 'baseUri', + type: 'string', + }, + ], + name: 'BaseURIChanged', + 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', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'values', + type: 'uint256[]', + }, + ], + name: 'TransferBatch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'TransferSingle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'value', + type: 'string', + }, + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'URI', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'assetGroupId', + outputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'accounts', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + ], + name: 'balanceOfBatch', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'balanceOfFractional', + outputs: [ + { + internalType: 'uint256', + name: 'fractionalBalance', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + ], + name: 'balanceOfFractionalBatch', + outputs: [ + { + internalType: 'uint256[]', + name: 'fractionalBalances', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'nftIds', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'nftAmounts', + type: 'uint256[]', + }, + ], + name: 'burnNFTs', + outputs: [ + { + internalType: 'bytes[]', + name: 'metadata', + type: 'bytes[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'vaultShares', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'strategies', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'shares', + type: 'uint256[]', + }, + ], + name: 'burnVaultShares', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'claimer', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimShares', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'nftIds', + type: 'uint256[]', + }, + ], + name: 'getMetadata', + outputs: [ + { + internalType: 'bytes[]', + name: 'metadata', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256[]', + name: 'assets', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'initiated', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'flushIndex', + type: 'uint256', + }, + ], + internalType: 'struct DepositMetadata', + name: 'metadata', + type: 'tuple', + }, + ], + name: 'mintDepositNFT', + outputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + internalType: 'uint256', + name: 'vaultShares', + type: 'uint256', + }, + ], + name: 'mintVaultShares', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'vaultShares', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'flushIndex', + type: 'uint256', + }, + ], + internalType: 'struct WithdrawalMetadata', + name: 'metadata', + type: 'tuple', + }, + ], + name: 'mintWithdrawalNFT', + outputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeBatchTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'uri_', + type: 'string', + }, + ], + name: 'setBaseURI', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFromSpender', + outputs: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'uri', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'vaultName', + outputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class SpoolVault__factory { + static readonly abi = _abi; + static createInterface(): SpoolVaultInterface { + return new utils.Interface(_abi) as SpoolVaultInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): SpoolVault { + return new Contract(address, _abi, signerOrProvider) as SpoolVault; + } +} diff --git a/src/apps/spool-v2/contracts/ethers/factories/SpoolVospool__factory.ts b/src/apps/spool-v2/contracts/ethers/factories/SpoolVospool__factory.ts new file mode 100644 index 000000000..2dc1b18b3 --- /dev/null +++ b/src/apps/spool-v2/contracts/ethers/factories/SpoolVospool__factory.ts @@ -0,0 +1,1191 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { SpoolVospool, SpoolVospoolInterface } from '../SpoolVospool'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ISpoolOwner', + name: '_spoolOwner', + type: 'address', + }, + { + internalType: 'uint256', + name: '_firstTrancheEndTime', + type: 'uint256', + }, + ], + 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: 'source', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Burned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint48', + name: 'totalMaturedVotingPower', + type: 'uint48', + }, + { + indexed: false, + internalType: 'uint48', + name: 'totalMaturingAmount', + type: 'uint48', + }, + { + indexed: false, + internalType: 'uint56', + name: 'totalRawUnmaturedVotingPower', + type: 'uint56', + }, + ], + name: 'GlobalGradualUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'source', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'burnAll', + type: 'bool', + }, + ], + name: 'GradualBurned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'GradualMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'minter', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'set', + type: 'bool', + }, + ], + name: 'GradualMinterSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Minted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'minter', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'set', + type: 'bool', + }, + ], + name: 'MinterSet', + 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', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: true, + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint48', + name: 'maturedVotingPower', + type: 'uint48', + }, + { + indexed: false, + internalType: 'uint48', + name: 'maturingAmount', + type: 'uint48', + }, + { + indexed: false, + internalType: 'uint56', + name: 'rawUnmaturedVotingPower', + type: 'uint56', + }, + ], + name: 'UserGradualUpdated', + type: 'event', + }, + { + inputs: [], + name: 'FULL_POWER_TIME', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'FULL_POWER_TRANCHES_COUNT', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'TRANCHE_TIME', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'burnAll', + type: 'bool', + }, + ], + name: 'burnGradual', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'firstTrancheStartTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentTrancheIndex', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getGlobalGradual', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'totalMaturedVotingPower', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'totalMaturingAmount', + type: 'uint48', + }, + { + internalType: 'uint56', + name: 'totalRawUnmaturedVotingPower', + type: 'uint56', + }, + { + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + ], + internalType: 'struct GlobalGradual', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLastFinishedTrancheIndex', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextTrancheEndTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNotUpdatedGlobalGradual', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'totalMaturedVotingPower', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'totalMaturingAmount', + type: 'uint48', + }, + { + internalType: 'uint56', + name: 'totalRawUnmaturedVotingPower', + type: 'uint56', + }, + { + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + ], + internalType: 'struct GlobalGradual', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getNotUpdatedUserGradual', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'maturedVotingPower', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'maturingAmount', + type: 'uint48', + }, + { + internalType: 'uint56', + name: 'rawUnmaturedVotingPower', + type: 'uint56', + }, + { + components: [ + { + internalType: 'uint16', + name: 'arrayIndex', + type: 'uint16', + }, + { + internalType: 'uint8', + name: 'position', + type: 'uint8', + }, + ], + internalType: 'struct UserTranchePosition', + name: 'oldestTranchePosition', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint16', + name: 'arrayIndex', + type: 'uint16', + }, + { + internalType: 'uint8', + name: 'position', + type: 'uint8', + }, + ], + internalType: 'struct UserTranchePosition', + name: 'latestTranchePosition', + type: 'tuple', + }, + { + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + ], + internalType: 'struct UserGradual', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTotalGradualVotingPower', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'trancheIndex', + type: 'uint256', + }, + ], + name: 'getTrancheEndTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'time', + type: 'uint256', + }, + ], + name: 'getTrancheIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getUserGradual', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'maturedVotingPower', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'maturingAmount', + type: 'uint48', + }, + { + internalType: 'uint56', + name: 'rawUnmaturedVotingPower', + type: 'uint56', + }, + { + components: [ + { + internalType: 'uint16', + name: 'arrayIndex', + type: 'uint16', + }, + { + internalType: 'uint8', + name: 'position', + type: 'uint8', + }, + ], + internalType: 'struct UserTranchePosition', + name: 'oldestTranchePosition', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint16', + name: 'arrayIndex', + type: 'uint16', + }, + { + internalType: 'uint8', + name: 'position', + type: 'uint8', + }, + ], + internalType: 'struct UserTranchePosition', + name: 'latestTranchePosition', + type: 'tuple', + }, + { + internalType: 'uint16', + name: 'lastUpdatedTrancheIndex', + type: 'uint16', + }, + ], + internalType: 'struct UserGradual', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getUserGradualVotingPower', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'gradualMinters', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'indexedGlobalTranches', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + ], + internalType: 'struct Tranche', + name: 'zero', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + ], + internalType: 'struct Tranche', + name: 'one', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + ], + internalType: 'struct Tranche', + name: 'two', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + ], + internalType: 'struct Tranche', + name: 'three', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + ], + internalType: 'struct Tranche', + name: 'four', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mintGradual', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'minters', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_gradualMinter', + type: 'address', + }, + { + internalType: 'bool', + name: '_set', + type: 'bool', + }, + ], + name: 'setGradualMinter', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_minter', + type: 'address', + }, + { + internalType: 'bool', + name: '_set', + type: 'bool', + }, + ], + name: 'setMinter', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalInstantPower', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'updateUserVotingPower', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'updateVotingPower', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'userInstantPower', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'userTranches', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + { + internalType: 'uint16', + name: 'index', + type: 'uint16', + }, + ], + internalType: 'struct UserTranche', + name: 'zero', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + { + internalType: 'uint16', + name: 'index', + type: 'uint16', + }, + ], + internalType: 'struct UserTranche', + name: 'one', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + { + internalType: 'uint16', + name: 'index', + type: 'uint16', + }, + ], + internalType: 'struct UserTranche', + name: 'two', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint48', + name: 'amount', + type: 'uint48', + }, + { + internalType: 'uint16', + name: 'index', + type: 'uint16', + }, + ], + internalType: 'struct UserTranche', + name: 'three', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class SpoolVospool__factory { + static readonly abi = _abi; + static createInterface(): SpoolVospoolInterface { + return new utils.Interface(_abi) as SpoolVospoolInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): SpoolVospool { + return new Contract(address, _abi, signerOrProvider) as SpoolVospool; + } +} diff --git a/src/apps/spool-v2/ethereum/spool-v2.constants.ts b/src/apps/spool-v2/ethereum/spool-v2.constants.ts new file mode 100644 index 000000000..5d71ec47e --- /dev/null +++ b/src/apps/spool-v2/ethereum/spool-v2.constants.ts @@ -0,0 +1,109 @@ +import { gql } from 'graphql-request'; + +export const SPOOL_ADDRESS = '0x40803cea2b2a32bda1be61d3604af6a814e70976'; +export const VOSPOOL_ADDRESS = '0xaf56d16a7fe479f2fcd48ff567ff589cb2d2a0e9'; +export const STAKING_ADDRESS = '0xc3160c5cc63b6116dd182faa8393d3ad9313e213'; +export const SUBGRAPH_API_BASE_URL = 'https://api.studio.thegraph.com/query/41372/spool-v2_mainnet/version/latest'; +export const SUBGRAPH_V1_API_BASE_URL = "https://api.thegraph.com/subgraphs/name/spoolfi/spool?source=zapper" +export const ANALYTICS_API_BASE_URL = 'https://subgraph-api.58sa2u0osmd2c.eu-west-1.cs.amazonlightsail.com/mainnet'; +export const SPOOL_STAKED_QUERY = gql` + query getStaking($address: String!) { + userSpoolStaking(id: $address) { + id + spoolStaked + } + } +`; + +export const REWARDS_QUERY = gql` + query { + stakingRewardTokens { + id + token { + id + name + symbol + decimals + } + isRemoved + endTime + startTime + } + } +`; + + +export const FEES_QUERY = gql` + query { + globals { + treasuryFee + ecosystemFee + } + } +`; + +export const VAULTS_ANALYTICS_QUERY = gql` + query { + smartVaults { + id + tvr + baseApy + rewardsApy + adjustedApy + } + } +`; +export const VAULTS_QUERY = gql` + query { + smartVaults { + id + assetGroup { + assetGroupTokens { + token { + id + } + } + } + id + name + riskTolerance + riskProvider { + id + } + smartVaultFees { + id + depositFeePercentage + managementFeePercentage + performanceFeePercentage + } + smartVaultStrategies { + id + isRemoved + allocation + strategy { + id + riskScores { + riskScore + riskProvider { + id + } + } + } + } + smartVaultRewardTokens { + id + token { + id + name + symbol + decimals + } + rewardRate + startTime + endTime + totalAmount + isRemoved + } + } + } +`; diff --git a/src/apps/spool-v2/ethereum/spool-v2.staking.contract-position-fetcher.ts b/src/apps/spool-v2/ethereum/spool-v2.staking.contract-position-fetcher.ts new file mode 100644 index 000000000..27e0a0f7c --- /dev/null +++ b/src/apps/spool-v2/ethereum/spool-v2.staking.contract-position-fetcher.ts @@ -0,0 +1,149 @@ +import { Inject } from '@nestjs/common'; +import { BigNumber } from 'ethers'; +import { parseEther } from 'ethers/lib/utils'; +import _ from 'lodash'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { buildDollarDisplayItem, buildNumberDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; +import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { gqlFetch } from '~app-toolkit/helpers/the-graph.helper'; +import { SpoolV2ContractFactory, SpoolStaking } from '~apps/spool-v2/contracts'; +import { + REWARDS_QUERY, + SPOOL_ADDRESS, + SPOOL_STAKED_QUERY, + STAKING_ADDRESS, + SUBGRAPH_V1_API_BASE_URL, + VOSPOOL_ADDRESS, +} from '~apps/spool-v2/ethereum/spool-v2.constants'; +import { StakingReward, UserSpoolStaking } from '~apps/spool-v2/ethereum/spool-v2.types'; +import { MetaType } from '~position/position.interface'; +import { isClaimable, isSupplied } from '~position/position.utils'; +import { ContractPositionTemplatePositionFetcher } from '~position/template/contract-position.template.position-fetcher'; +import { + GetDisplayPropsParams, + GetTokenBalancesParams, + GetDataPropsParams, +} from '~position/template/contract-position.template.types'; + +type SpoolStakingDataProps = { + tvl: number; + spoolStaked: number; + totalAccVoSpool: number; +}; + +@PositionTemplate() +export class EthereumSpoolV2StakingContractPositionFetcher extends ContractPositionTemplatePositionFetcher< + SpoolStaking, + SpoolStakingDataProps +> { + groupLabel = 'Staking'; + + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(SpoolV2ContractFactory) protected readonly contractFactory: SpoolV2ContractFactory, + ) { + super(appToolkit); + } + + getContract(address: string): SpoolStaking { + return this.contractFactory.spoolStaking({ address, network: this.network }); + } + + async getDefinitions() { + return [{ address: STAKING_ADDRESS }]; + } + + async getTokenDefinitions() { + const now = parseInt(String(new Date().getTime() / 1000)); + const stakingRewards = await gqlFetch({ + endpoint: SUBGRAPH_V1_API_BASE_URL, + query: REWARDS_QUERY, + }); + + // SpoolStaking can emit arbitrary tokens; VoSpoolRewards always emits SPOOL + const rewardAddresses = _.uniq( + stakingRewards.stakingRewardTokens + .filter(reward => !reward.isRemoved && parseInt(reward.startTime) >= now && parseInt(reward.endTime) <= now) + .map(reward => reward.token.id) + .concat([SPOOL_ADDRESS]), + ); + + return [ + { metaType: MetaType.SUPPLIED, address: SPOOL_ADDRESS, network: this.network }, + { metaType: MetaType.VESTING, address: VOSPOOL_ADDRESS, network: this.network }, + ...rewardAddresses.map(address => ({ metaType: MetaType.CLAIMABLE, address, network: this.network })), + ]; + } + + async getDataProps({ multicall, contractPosition }: GetDataPropsParams) { + const [spoolToken, voSpoolToken] = contractPosition.tokens; + const spoolContract = this.contractFactory.erc20(spoolToken); + const voSpoolContract = this.contractFactory.spoolVospool(voSpoolToken); + + const totalStaked = await multicall.wrap(spoolContract).balanceOf(STAKING_ADDRESS); + const votingPowerRaw = await multicall.wrap(voSpoolContract).getTotalGradualVotingPower(); + + const spoolStaked = totalStaked.div(BigNumber.from(10).pow(spoolToken.decimals)).toNumber(); + const totalAccVoSpool = votingPowerRaw.div(BigNumber.from(10).pow(voSpoolToken.decimals)).toNumber(); + const pricePrecision = 10 ** 10; + const tvl = BigNumber.from((pricePrecision * spoolToken.price).toFixed(0)) + .mul(totalStaked) + .div(pricePrecision) + .div(BigNumber.from(10).pow(spoolToken.decimals)) + .toNumber(); + + return { tvl, spoolStaked, totalAccVoSpool }; + } + + async getLabel({ contractPosition }: GetDisplayPropsParams) { + return `${getLabelFromToken(contractPosition.tokens[0])} Staking`; + } + + async getStatsItems({ contractPosition }: GetDisplayPropsParams) { + return [ + { label: 'TVL', value: buildDollarDisplayItem(contractPosition.dataProps.tvl) }, + { label: 'SPOOL Staked', value: buildNumberDisplayItem(contractPosition.dataProps.spoolStaked) }, + { label: 'voSPOOL Accumulated', value: buildNumberDisplayItem(contractPosition.dataProps.totalAccVoSpool) }, + ]; + } + + async getTokenBalancesPerPosition({ + address, + contractPosition, + multicall, + }: GetTokenBalancesParams) { + const suppliedToken = contractPosition.tokens.find(isSupplied)!; + const rewardTokens = contractPosition.tokens.filter(isClaimable); + + const staking = this.contractFactory.spoolStaking({ address: STAKING_ADDRESS, network: this.network }); + const voSpool = this.contractFactory.spoolVospool({ address: VOSPOOL_ADDRESS, network: this.network }); + + const [votingPowerRaw, voSpoolRewards, ...tokenRewards] = await Promise.all([ + multicall.wrap(voSpool).getUserGradualVotingPower(address), + multicall.wrap(staking).callStatic.getUpdatedVoSpoolRewardAmount({ from: address }), + ...rewardTokens.map(reward => multicall.wrap(staking).earned(reward.address, address)), + ]); + + const stakedSpool = await gqlFetch({ + endpoint: SUBGRAPH_V1_API_BASE_URL, + query: SPOOL_STAKED_QUERY, + variables: { address }, + }); + + const stakedAmount = parseEther(stakedSpool?.userSpoolStaking?.spoolStaked || '0').toString(); + + const rewardBalances = rewardTokens.map((token, idx) => { + // Add voSPOOL rewards (always in SPOOL) + const rewards = + token.address.toLowerCase() == suppliedToken.address.toLowerCase() + ? tokenRewards[idx].add(voSpoolRewards) + : tokenRewards[idx]; + + return rewards.toString(); + }); + + return [stakedAmount, votingPowerRaw.toString(), ...rewardBalances]; + } +} diff --git a/src/apps/spool-v2/ethereum/spool-v2.types.ts b/src/apps/spool-v2/ethereum/spool-v2.types.ts new file mode 100644 index 000000000..37f7b2739 --- /dev/null +++ b/src/apps/spool-v2/ethereum/spool-v2.types.ts @@ -0,0 +1,137 @@ +import { IMulticallWrapper } from '~multicall'; +import { ContractPosition } from '~position/position.interface'; + +export type SpoolVaults = { + smartVaults: VaultDetails[]; +}; + +export type VaultDetails = { + id: string; + name: string; + riskTolerance: string; + riskProvider: { + id: string; + }; + assetGroup: { + assetGroupTokens: { + token: { + id: string; + }; + }[]; + }; + smartVaultFees: { + depositFeePercentage: string; + managementFeePercentage: string; + performanceFeePercentage: string; + }; + smartVaultStrategies: { + id: string; + allocation: string; + isRemoved: boolean; + strategy: { + id: string; + riskScores: { + riskScore: string; + riskProvider: { + id: string; + }; + }[]; + }; + }[]; + smartVaultRewardTokens: { + id: string; + token: { + id: string; + name: string; + symbol: string; + decimals: number; + }; + rewardRate: number; + totalAmount: string; + isRemoved: number; + }[]; +}; + +export type Globals = { + globals: { + treasuryFee: string; + ecosystemFee: string; + }; +}; + +export type VaultsAnalytics = { + smartVaults: { + id: string; + tvr: string; + baseApy: string; + rewardsApy: string[]; + adjustedApy: string; + incentivizedApy: string; + }[]; +}; + +export type Platform = { + platform: { + id: string; + treasuryFeeSize: string; + ecosystemFeeSize: string; + }; +}; + +export type StakingReward = { + stakingRewardTokens: { + id: string; + token: { + id: string; + name: string; + symbol: string; + decimals: number; + }; + isRemoved: boolean; + endTime: string; + startTime: string; + }[]; +}; + +export type UserSpoolStaking = { + userSpoolStaking: { + id: string; + spoolStaked: string; + }; +}; + +export type VaultDataProps = { + strategies: string[]; +}; + +export type VaultPosition = ContractPosition; + +export type SpoolVaultDefinition = { + suppliedTokenAddresses: string[]; + address: string; + name: string; + riskModel: string; + rewardTokenAddresses: string[]; + strategyAddresses: string[]; + stats: { + riskTolerance: number; + adjustedApy: number; + incentivizedApy: number; + apy: number; + tvr: number; + fees: number; + }; +}; + +export type SpoolVaultDataProps = { + totalValueRouted: number; + apy: number; + adjustedApy: number; + incentivizedApy: number; + fees: number; + strategies: string[]; + riskScore: string; + riskTolerance: number; +}; + +export type ResolveBalancesProps = { address: string; contractPosition: VaultPosition; multicall: IMulticallWrapper }; diff --git a/src/apps/spool-v2/ethereum/spool-v2.vault.contract-position-fetcher.ts b/src/apps/spool-v2/ethereum/spool-v2.vault.contract-position-fetcher.ts new file mode 100644 index 000000000..b236d8ac8 --- /dev/null +++ b/src/apps/spool-v2/ethereum/spool-v2.vault.contract-position-fetcher.ts @@ -0,0 +1,211 @@ +import { Inject } from '@nestjs/common'; +import { BigNumberish, Contract, ethers } from 'ethers'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { + buildDollarDisplayItem, + buildPercentageDisplayItem, + buildStringDisplayItem, +} from '~app-toolkit/helpers/presentation/display-item.present'; +import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { gqlFetch } from '~app-toolkit/helpers/the-graph.helper'; +import { SpoolV2ContractFactory, SpoolVault } from '~apps/spool-v2/contracts'; +import { + ANALYTICS_API_BASE_URL, + FEES_QUERY, + SUBGRAPH_API_BASE_URL, + VAULTS_ANALYTICS_QUERY, + VAULTS_QUERY, +} from '~apps/spool-v2/ethereum/spool-v2.constants'; +import { + Globals, + SpoolVaultDataProps, + SpoolVaultDefinition, + SpoolVaults, + VaultDetails, + VaultsAnalytics, +} from '~apps/spool-v2/ethereum/spool-v2.types'; +import { DefaultDataProps } from '~position/display.interface'; +import { MetaType } from '~position/position.interface'; +import { ContractPositionTemplatePositionFetcher } from '~position/template/contract-position.template.position-fetcher'; +import { + DefaultContractPositionDefinition, + GetDefinitionsParams, + GetDisplayPropsParams, + GetTokenBalancesParams, + GetTokenDefinitionsParams, +} from '~position/template/contract-position.template.types'; + +const riskModels = { '0xc216ad6280f4fa92a5159ef383a1206d432481c8': 'Spool Labs' }; + +@PositionTemplate() +export class EthereumSpoolV2VaultContractPositionFetcher extends ContractPositionTemplatePositionFetcher { + groupLabel = 'Vaults'; + + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(SpoolV2ContractFactory) protected readonly spoolV2ContractFactory: SpoolV2ContractFactory, + ) { + super(appToolkit); + } + + getContract(_address: string): Contract { + return this.spoolV2ContractFactory.spoolVault({ address: _address, network: this.network }); + } + + async getDefinitions(_params: GetDefinitionsParams): Promise { + // Get all vaults + // Get all fees + + // Request all vaults + const vaultsData = await gqlFetch({ + endpoint: SUBGRAPH_API_BASE_URL, + query: VAULTS_QUERY, + }); + + // Request platform fees + const fees = await gqlFetch({ + endpoint: SUBGRAPH_API_BASE_URL, + query: FEES_QUERY, + }); + + // Request strategy, vault, and reward analytics + const vaultAnalytics = await this.getVaultsAnalytics(); + // console.log(vaultsData.smartVaults); + + return vaultsData.smartVaults.map(vault => ({ + address: vault.id.toLowerCase(), + name: vault.name, + riskModel: vault.riskProvider? vault.riskProvider.id : '', + suppliedTokenAddresses: vault.assetGroup.assetGroupTokens.map(agt => agt.token.id.toLowerCase()), + rewardTokenAddresses: + vault.smartVaultRewardTokens.length > 0 + ? vault.smartVaultRewardTokens.map(rt => rt.token.id.toLowerCase()) + : null, + strategyAddresses: vault.smartVaultStrategies.map(s => s.strategy.id.toLowerCase()), + stats: this.getVaultStats( + vault, + vaultAnalytics.smartVaults.find(va => va.id == vault.id), + fees, + ), + })); + } + + async getTokenDefinitions({ definition }: GetTokenDefinitionsParams) { + return [ + ...definition.suppliedTokenAddresses.map(address => ({ + metaType: MetaType.SUPPLIED, + address, + network: this.network, + })), + ]; + } + + async getLabel({ definition }: GetDisplayPropsParams) { + return definition.name; + } + + async getSecondaryLabel({ + contractPosition, + }: GetDisplayPropsParams) { + return contractPosition.tokens.map(token => getLabelFromToken(token)).join(', '); + } + async getStatsItems({ definition }: GetDisplayPropsParams) { + return [ + { label: 'APY', value: buildPercentageDisplayItem(definition.stats.adjustedApy) }, + { label: 'TVR', value: buildDollarDisplayItem(definition.stats.tvr) }, + { label: 'Risk Model', value: buildStringDisplayItem(riskModels[definition.riskModel]) }, + { + label: 'Risk Appetite', + value: buildStringDisplayItem( + `${this.getRiskScoreString(definition.stats.riskTolerance)} (${this.mapRiskToRange( + definition.stats.riskTolerance, + )})`, + ), + }, + { + label: 'Reward Tokens', + value: buildStringDisplayItem(definition.rewardTokenAddresses?.map(address => address.toString()).join(', ')), + }, + ]; + } + getTokenBalancesPerPosition(_params: GetTokenBalancesParams): Promise { + throw new Error('Method not implemented.'); + } + /** + * Calculate APY, TVR (total value routed) and fees. + * @param vault + * @param vaultAnalytics + * @param platformFees + */ + getVaultStats( + vault: VaultDetails, + vaultAnalytics: + | { + id: string; + tvr: string; + baseApy: string; + rewardsApy: string[]; + adjustedApy: string; + incentivizedApy: string; + } + | undefined, + platformFees: Globals, + ) { + const fees = + parseFloat(platformFees.globals.ecosystemFee) + + parseFloat(platformFees.globals.treasuryFee) + + parseFloat(vault.smartVaultFees.performanceFeePercentage) + + parseFloat(vault.smartVaultFees.managementFeePercentage); + + let tvr = '0'; + let adjustedApy = 0.0; + let incentivizedApy = 0.0; + let baseApy = 0.0; + + if (vaultAnalytics) { + tvr = ethers.utils.formatEther(vaultAnalytics.tvr); + adjustedApy = parseFloat(vaultAnalytics.adjustedApy) * 100; + incentivizedApy = parseFloat(vaultAnalytics.incentivizedApy) * 100; + baseApy = parseFloat(vaultAnalytics.baseApy) * 100; + } + + const riskTolerance = Number(vault.riskTolerance); + + return { + riskTolerance, + tvr: tvr, + fees, + adjustedApy: adjustedApy, + incentivizedApy: incentivizedApy, + baseApy: baseApy, + }; + } + + /** + * Fetch vault analytics + */ + async getVaultsAnalytics(): Promise { + return await gqlFetch({ + endpoint: ANALYTICS_API_BASE_URL, + query: VAULTS_ANALYTICS_QUERY, + }); + } + getRiskScoreString(riskTolerance: number) { + const risk = this.mapRiskToRange(riskTolerance); + switch (true) { + case risk > 5: + return 'Risk Seeking'; + case risk === 5: + return 'Risk Neutral'; + default: + return 'Risk Averse'; + } + } + mapRiskToRange(risk: number) { + const [inMin, inMax] = [-10, 10]; + const [outMin, outMax] = [0, 10]; + return ((risk - inMin) / (inMax - inMin)) * (outMax - outMin) + outMin; + } +} diff --git a/src/apps/spool-v2/ethereum/spool-v2.vo-spool.token-fetcher.ts b/src/apps/spool-v2/ethereum/spool-v2.vo-spool.token-fetcher.ts new file mode 100644 index 000000000..12555da2e --- /dev/null +++ b/src/apps/spool-v2/ethereum/spool-v2.vo-spool.token-fetcher.ts @@ -0,0 +1,43 @@ +import { Inject } from '@nestjs/common'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; + +import { SpoolV2ContractFactory, SpoolVospool } from '../contracts'; + +import { VOSPOOL_ADDRESS } from './spool-v2.constants'; +@PositionTemplate() +export class EthereumSpoolV2VoSpoolTokenFetcher extends AppTokenTemplatePositionFetcher { + groupLabel = 'voSPOOL'; + isExcludedFromBalances = true; + isExcludedFromExplore = true; + isExcludedFromTvl = true; + + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(SpoolV2ContractFactory) protected readonly contractFactory: SpoolV2ContractFactory, + ) { + super(appToolkit); + } + + getContract(address: string) { + return this.contractFactory.spoolVospool({ address, network: this.network }); + } + + async getAddresses(): Promise { + return [VOSPOOL_ADDRESS]; + } + + async getUnderlyingTokenDefinitions() { + return []; + } + + async getPricePerShare() { + return [1]; + } + + async getPrice() { + return 0; // Valueless token + } +} diff --git a/src/apps/spool-v2/spool-v2.module.ts b/src/apps/spool-v2/spool-v2.module.ts new file mode 100644 index 000000000..7f710cd30 --- /dev/null +++ b/src/apps/spool-v2/spool-v2.module.ts @@ -0,0 +1,18 @@ +import { Module } from '@nestjs/common'; + +import { AbstractApp } from '~app/app.dynamic-module'; + +import { SpoolV2ContractFactory } from './contracts'; +import { EthereumSpoolV2StakingContractPositionFetcher } from './ethereum/spool-v2.staking.contract-position-fetcher'; +import { EthereumSpoolV2VaultContractPositionFetcher } from './ethereum/spool-v2.vault.contract-position-fetcher'; +import { EthereumSpoolV2VoSpoolTokenFetcher } from './ethereum/spool-v2.vo-spool.token-fetcher'; + +@Module({ + providers: [ + EthereumSpoolV2StakingContractPositionFetcher, + EthereumSpoolV2VaultContractPositionFetcher, + EthereumSpoolV2VoSpoolTokenFetcher, + SpoolV2ContractFactory, + ], +}) +export class SpoolV2AppModule extends AbstractApp() {}