From 2fb8dbdd89bf6d37c62b9e9a23dd4b49e34a5582 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 28 Jun 2022 09:54:01 -0700 Subject: [PATCH 1/5] upgrade to SPI V3 --- .../abis/solace-cover-product-v-2.json | 734 ------- ...uct.json => solace-cover-product-v-3.json} | 386 ++-- .../contracts/ethers/SolaceCoverProductV2.ts | 1847 ----------------- ...overProduct.ts => SolaceCoverProductV3.ts} | 1203 +++++------ .../SolaceCoverProductV2__factory.ts | 1635 --------------- ...ry.ts => SolaceCoverProductV3__factory.ts} | 731 +++---- .../contracts/ethers/factories/index.ts | 3 +- src/apps/solace/contracts/ethers/index.ts | 6 +- src/apps/solace/contracts/index.ts | 13 +- .../helpers/SolacePolicyBalanceHelper.ts | 15 +- ...lace.policies.contract-position-fetcher.ts | 6 +- 11 files changed, 935 insertions(+), 5644 deletions(-) delete mode 100644 src/apps/solace/contracts/abis/solace-cover-product-v-2.json rename src/apps/solace/contracts/abis/{solace-cover-product.json => solace-cover-product-v-3.json} (58%) delete mode 100644 src/apps/solace/contracts/ethers/SolaceCoverProductV2.ts rename src/apps/solace/contracts/ethers/{SolaceCoverProduct.ts => SolaceCoverProductV3.ts} (55%) delete mode 100644 src/apps/solace/contracts/ethers/factories/SolaceCoverProductV2__factory.ts rename src/apps/solace/contracts/ethers/factories/{SolaceCoverProduct__factory.ts => SolaceCoverProductV3__factory.ts} (75%) diff --git a/src/apps/solace/contracts/abis/solace-cover-product-v-2.json b/src/apps/solace/contracts/abis/solace-cover-product-v-2.json deleted file mode 100644 index cc516a22e..000000000 --- a/src/apps/solace/contracts/abis/solace-cover-product-v-2.json +++ /dev/null @@ -1,734 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "governance_", "type": "address" }, - { "internalType": "address", "name": "registry_", "type": "address" }, - { "internalType": "string", "name": "asset_", "type": "string" }, - { "internalType": "string", "name": "domain_", "type": "string" }, - { "internalType": "string", "name": "version_", "type": "string" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, - { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "string", "name": "asset", "type": "string" }], - "name": "AssetSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "string", "name": "baseURI", "type": "string" }], - "name": "BaseURISet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "chargeCycle", "type": "uint256" }], - "name": "ChargeCycleSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "cooldownPeriod", "type": "uint256" }], - "name": "CooldownPeriodSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "startTime", "type": "uint256" } - ], - "name": "CooldownStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "CooldownStopped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "DepositMade", - "type": "event" - }, - { "anonymous": false, "inputs": [], "name": "GovernanceLocked", "type": "event" }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "pendingGovernance", "type": "address" }], - "name": "GovernancePending", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldGovernance", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newGovernance", "type": "address" } - ], - "name": "GovernanceTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bool", "name": "isReferralOn", "type": "bool" }], - "name": "IsReferralOnSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "maxRateNum", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "maxRateDenom", "type": "uint256" } - ], - "name": "MaxRateSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bool", "name": "pause", "type": "bool" }], - "name": "PauseSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "PolicyCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "PolicyDeactivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "activeCoverLimit", "type": "uint256" }], - "name": "PolicyManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "PolicyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "PremiumCharged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "actualPremium", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "chargedPremium", "type": "uint256" } - ], - "name": "PremiumPartiallyCharged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "referralReward", "type": "uint256" }], - "name": "ReferralRewardSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "rewardEarner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "rewardPointsEarned", "type": "uint256" } - ], - "name": "ReferralRewardsEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "referralThreshold", "type": "uint256" }], - "name": "ReferralThresholdSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "registry", "type": "address" }], - "name": "RegistrySet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amountGifted", "type": "uint256" } - ], - "name": "RewardPointsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "chainId", "type": "uint256" }], - "name": "SupportedChainRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "chainId", "type": "uint256" }], - "name": "SupportedChainSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "WithdrawMade", - "type": "event" - }, - { "inputs": [], "name": "acceptGovernance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [{ "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "accountBalanceOf", - "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "policyholder_", "type": "address" }, - { "internalType": "uint256", "name": "coverLimit_", "type": "uint256" }, - { "internalType": "uint256", "name": "amount_", "type": "uint256" }, - { "internalType": "bytes", "name": "referralCode_", "type": "bytes" }, - { "internalType": "uint256[]", "name": "chains_", "type": "uint256[]" } - ], - "name": "activatePolicy", - "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "activeCoverLimit", - "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256[]", "name": "supportedChains", "type": "uint256[]" }], - "name": "addSupportedChains", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "asset", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "availableCoverCapacity", - "outputs": [{ "internalType": "uint256", "name": "availableCoverCapacity_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "baseURI", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "chargeCycle", - "outputs": [{ "internalType": "uint256", "name": "chargeCycle_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address[]", "name": "holders", "type": "address[]" }, - { "internalType": "uint256[]", "name": "premiums", "type": "uint256[]" } - ], - "name": "chargePremiums", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "cooldownPeriod", - "outputs": [{ "internalType": "uint256", "name": "cooldownPeriod_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "cooldownStart", - "outputs": [{ "internalType": "uint256", "name": "cooldownStart_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "policyID_", "type": "uint256" }], - "name": "coverLimitOf", - "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "deactivatePolicy", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "policyholder", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], - "name": "getApproved", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "chainIndex", "type": "uint256" }], - "name": "getChain", - "outputs": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "getPolicyChainInfo", - "outputs": [{ "internalType": "uint256[]", "name": "policyChains", "type": "uint256[]" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes", "name": "referralCode", "type": "bytes" }], - "name": "getReferrerFromReferralCode", - "outputs": [{ "internalType": "address", "name": "referrer", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governance", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governanceIsLocked", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "operator", "type": "address" } - ], - "name": "isApprovedForAll", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "isReferralCodeUsed", - "outputs": [{ "internalType": "bool", "name": "isReferralCodeUsed_", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes", "name": "referralCode", "type": "bytes" }], - "name": "isReferralCodeValid", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isReferralOn", - "outputs": [{ "internalType": "bool", "name": "isReferralOn_", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }], - "name": "isSupportedChain", - "outputs": [{ "internalType": "bool", "name": "status", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "lockGovernance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "maxCover", - "outputs": [{ "internalType": "uint256", "name": "cover", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxRate", - "outputs": [ - { "internalType": "uint256", "name": "maxRateNum_", "type": "uint256" }, - { "internalType": "uint256", "name": "maxRateDenom_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "coverLimit", "type": "uint256" }], - "name": "minRequiredAccountBalance", - "outputs": [{ "internalType": "uint256", "name": "minRequiredAccountBalance_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numSupportedChains", - "outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], - "name": "ownerOf", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [{ "internalType": "bool", "name": "status", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingGovernance", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "policyCount", - "outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "policyOf", - "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "policyID_", "type": "uint256" }], - "name": "policyStatus", - "outputs": [{ "internalType": "bool", "name": "status", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "premiumsPaidOf", - "outputs": [{ "internalType": "uint256", "name": "premiumsPaid_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "referralReward", - "outputs": [{ "internalType": "uint256", "name": "referralReward_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "referralThreshold", - "outputs": [{ "internalType": "uint256", "name": "referralThreshold_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "registry", - "outputs": [{ "internalType": "address", "name": "registry_", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }], - "name": "removeSupportedChain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "rewardPointsOf", - "outputs": [{ "internalType": "uint256", "name": "rewardPoints_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "riskManager", - "outputs": [{ "internalType": "address", "name": "riskManager_", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "bytes", "name": "_data", "type": "bytes" } - ], - "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": "assetName", "type": "string" }], - "name": "setAsset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "string", "name": "baseURI_", "type": "string" }], - "name": "setBaseURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "chargeCycle_", "type": "uint256" }], - "name": "setChargeCycle", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "cooldownPeriod_", "type": "uint256" }], - "name": "setCooldownPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "isReferralOn_", "type": "bool" }], - "name": "setIsReferralOn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "maxRateNum_", "type": "uint256" }, - { "internalType": "uint256", "name": "maxRateDenom_", "type": "uint256" } - ], - "name": "setMaxRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "paused_", "type": "bool" }], - "name": "setPaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "pendingGovernance_", "type": "address" }], - "name": "setPendingGovernance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "referralReward_", "type": "uint256" }], - "name": "setReferralReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "referralThreshhold_", "type": "uint256" }], - "name": "setReferralThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "registry_", "type": "address" }], - "name": "setRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "policyholder_", "type": "address" }, - { "internalType": "uint256", "name": "rewardPoints_", "type": "uint256" } - ], - "name": "setRewardPoints", - "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": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "tokenURI", - "outputs": [{ "internalType": "string", "name": "tokenURI_", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newCoverLimit_", "type": "uint256" }, - { "internalType": "bytes", "name": "referralCode_", "type": "bytes" } - ], - "name": "updateCoverLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256[]", "name": "policyChains", "type": "uint256[]" }], - "name": "updatePolicyChainInfo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" } -] diff --git a/src/apps/solace/contracts/abis/solace-cover-product.json b/src/apps/solace/contracts/abis/solace-cover-product-v-3.json similarity index 58% rename from src/apps/solace/contracts/abis/solace-cover-product.json rename to src/apps/solace/contracts/abis/solace-cover-product-v-3.json index 7ab93c648..3145bc493 100644 --- a/src/apps/solace/contracts/abis/solace-cover-product.json +++ b/src/apps/solace/contracts/abis/solace-cover-product-v-3.json @@ -1,10 +1,8 @@ [ { "inputs": [ - { "internalType": "address", "name": "governance_", "type": "address" }, - { "internalType": "address", "name": "registry_", "type": "address" }, - { "internalType": "string", "name": "domain_", "type": "string" }, - { "internalType": "string", "name": "version_", "type": "string" } + { "internalType": "address", "name": "_governance", "type": "address" }, + { "internalType": "address", "name": "_registry", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" @@ -41,35 +39,13 @@ "name": "ChargeCycleSet", "type": "event" }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "cooldownPeriod", "type": "uint256" }], - "name": "CooldownPeriodSet", - "type": "event" - }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "startTime", "type": "uint256" } + { "indexed": false, "internalType": "uint256", "name": "debtAmount", "type": "uint256" } ], - "name": "CooldownStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "CooldownStopped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "DepositMade", + "name": "DebtSet", "type": "event" }, { "anonymous": false, "inputs": [], "name": "GovernanceLocked", "type": "event" }, @@ -90,20 +66,17 @@ }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bool", "name": "isReferralOn", "type": "bool" }], - "name": "IsReferralOnSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "maxRateDenom", "type": "uint256" }], - "name": "MaxRateDenomSet", + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], + "name": "LatestChargedTimeSet", "type": "event" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "maxRateNum", "type": "uint256" }], - "name": "MaxRateNumSet", + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "maxRateNum", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "maxRateDenom", "type": "uint256" } + ], + "name": "MaxRateSet", "type": "event" }, { @@ -115,19 +88,13 @@ { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "PolicyCreated", + "name": "PolicyCanceled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "policyID", "type": "uint256" }], - "name": "PolicyDeactivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "activeCoverLimit", "type": "uint256" }], - "name": "PolicyManagerUpdated", + "name": "PolicyCreated", "type": "event" }, { @@ -138,57 +105,20 @@ }, { "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "PremiumCharged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "actualPremium", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "chargedPremium", "type": "uint256" } - ], - "name": "PremiumPartiallyCharged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "referralReward", "type": "uint256" }], - "name": "ReferralRewardSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "rewardEarner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "rewardPointsEarned", "type": "uint256" } - ], - "name": "ReferralRewardsEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "referralThreshold", "type": "uint256" }], - "name": "ReferralThresholdSet", + "inputs": [{ "indexed": false, "internalType": "address", "name": "registry", "type": "address" }], + "name": "RegistrySet", "type": "event" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "registry", "type": "address" }], - "name": "RegistrySet", + "inputs": [{ "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], + "name": "SignerAdded", "type": "event" }, { "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amountGifted", "type": "uint256" } - ], - "name": "RewardPointsSet", + "inputs": [{ "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], + "name": "SignerRemoved", "type": "event" }, { @@ -201,42 +131,21 @@ "name": "Transfer", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "policyholder", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "WithdrawMade", - "type": "event" - }, { "inputs": [], "name": "acceptGovernance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "accountBalanceOf", - "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], + "inputs": [], + "name": "activeCoverLimit", + "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { "internalType": "address", "name": "policyholder_", "type": "address" }, - { "internalType": "uint256", "name": "coverLimit_", "type": "uint256" }, - { "internalType": "uint256", "name": "amount_", "type": "uint256" }, - { "internalType": "bytes", "name": "referralCode_", "type": "bytes" } - ], - "name": "activatePolicy", - "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], + "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }], + "name": "addSigner", + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "activeCoverLimit", - "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -250,7 +159,7 @@ { "inputs": [], "name": "availableCoverCapacity", - "outputs": [{ "internalType": "uint256", "name": "availableCoverCapacity_", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "capacity", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -268,55 +177,38 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "chargeCycle", - "outputs": [{ "internalType": "uint256", "name": "chargeCycle_", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ - { "internalType": "address[]", "name": "holders", "type": "address[]" }, - { "internalType": "uint256[]", "name": "premiums", "type": "uint256[]" } + { "internalType": "uint256", "name": "_premium", "type": "uint256" }, + { "internalType": "uint256", "name": "_deadline", "type": "uint256" }, + { "internalType": "bytes", "name": "_signature", "type": "bytes" } ], - "name": "chargePremiums", + "name": "cancel", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "cooldownPeriod", - "outputs": [{ "internalType": "uint256", "name": "cooldownPeriod_", "type": "uint256" }], - "stateMutability": "view", + "inputs": [{ "internalType": "address[]", "name": "_policyholders", "type": "address[]" }], + "name": "cancelPolicies", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "cooldownStart", - "outputs": [{ "internalType": "uint256", "name": "cooldownStart_", "type": "uint256" }], + "inputs": [], + "name": "chargeCycle", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "policyID_", "type": "uint256" }], + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "coverLimitOf", - "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "deactivatePolicy", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "policyholder", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "getApproved", @@ -325,9 +217,9 @@ "type": "function" }, { - "inputs": [{ "internalType": "bytes", "name": "referralCode", "type": "bytes" }], - "name": "getReferrerFromReferralCode", - "outputs": [{ "internalType": "address", "name": "referrer", "type": "address" }], + "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "getSigner", + "outputs": [{ "internalType": "address", "name": "signer", "type": "address" }], "stateMutability": "view", "type": "function" }, @@ -356,23 +248,16 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder", "type": "address" }], - "name": "isReferralCodeUsed", - "outputs": [{ "internalType": "bool", "name": "isReferralCodeUsed_", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes", "name": "referralCode", "type": "bytes" }], - "name": "isReferralCodeValid", + "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }], + "name": "isSigner", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "isReferralOn", - "outputs": [{ "internalType": "bool", "name": "isReferralOn_", "type": "bool" }], + "name": "latestChargedTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -387,21 +272,28 @@ { "inputs": [], "name": "maxRateDenom", - "outputs": [{ "internalType": "uint256", "name": "maxRateDenom_", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxRateNum", - "outputs": [{ "internalType": "uint256", "name": "maxRateNum_", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "coverLimit", "type": "uint256" }], + "inputs": [{ "internalType": "uint256", "name": "_coverLimit", "type": "uint256" }], "name": "minRequiredAccountBalance", - "outputs": [{ "internalType": "uint256", "name": "minRequiredAccountBalance_", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "mrab", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_policyholder", "type": "address" }], + "name": "minScpRequired", + "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -412,6 +304,13 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "numSigners", + "outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "ownerOf", @@ -422,77 +321,93 @@ { "inputs": [], "name": "paused", - "outputs": [{ "internalType": "bool", "name": "status", "type": "bool" }], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "pendingGovernance", + "name": "paymentManager", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "policyCount", - "outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }], + "name": "pendingGovernance", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "policyOf", - "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "policyID_", "type": "uint256" }], + "inputs": [{ "internalType": "uint256", "name": "_policyID", "type": "uint256" }], "name": "policyStatus", "outputs": [{ "internalType": "bool", "name": "status", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "premiumsPaidOf", - "outputs": [{ "internalType": "uint256", "name": "premiumsPaid_", "type": "uint256" }], - "stateMutability": "view", + "inputs": [ + { "internalType": "address", "name": "_user", "type": "address" }, + { "internalType": "uint256", "name": "_coverLimit", "type": "uint256" } + ], + "name": "purchase", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "referralReward", - "outputs": [{ "internalType": "uint256", "name": "referralReward_", "type": "uint256" }], - "stateMutability": "view", + "inputs": [ + { "internalType": "address", "name": "_user", "type": "address" }, + { "internalType": "uint256", "name": "_coverLimit", "type": "uint256" }, + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "uint256", "name": "_price", "type": "uint256" }, + { "internalType": "uint256", "name": "_priceDeadline", "type": "uint256" }, + { "internalType": "bytes", "name": "_signature", "type": "bytes" } + ], + "name": "purchaseWithNonStable", + "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "referralThreshold", - "outputs": [{ "internalType": "uint256", "name": "referralThreshold_", "type": "uint256" }], - "stateMutability": "view", + "inputs": [ + { "internalType": "address", "name": "_user", "type": "address" }, + { "internalType": "uint256", "name": "_coverLimit", "type": "uint256" }, + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "purchaseWithStable", + "outputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "registry", - "outputs": [{ "internalType": "address", "name": "registry_", "type": "address" }], + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "policyholder_", "type": "address" }], - "name": "rewardPointsOf", - "outputs": [{ "internalType": "uint256", "name": "rewardPoints_", "type": "uint256" }], - "stateMutability": "view", + "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }], + "name": "removeSigner", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "riskManager", - "outputs": [{ "internalType": "address", "name": "riskManager_", "type": "address" }], + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, @@ -530,49 +445,38 @@ "type": "function" }, { - "inputs": [{ "internalType": "string", "name": "baseURI_", "type": "string" }], + "inputs": [{ "internalType": "string", "name": "_baseURI", "type": "string" }], "name": "setBaseURI", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "chargeCycle_", "type": "uint256" }], + "inputs": [{ "internalType": "enum ISolaceCoverProductV3.ChargePeriod", "name": "_chargeCycle", "type": "uint8" }], "name": "setChargeCycle", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "cooldownPeriod_", "type": "uint256" }], - "name": "setCooldownPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "isReferralOn_", "type": "bool" }], - "name": "setIsReferralOn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "maxRateDenom_", "type": "uint256" }], - "name": "setMaxRateDenom", + "inputs": [{ "internalType": "uint256", "name": "_timestamp", "type": "uint256" }], + "name": "setChargedTime", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "maxRateNum_", "type": "uint256" }], - "name": "setMaxRateNum", + "inputs": [ + { "internalType": "uint256", "name": "_maxRateNum", "type": "uint256" }, + { "internalType": "uint256", "name": "_maxRateDenom", "type": "uint256" } + ], + "name": "setMaxRate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "bool", "name": "paused_", "type": "bool" }], + "inputs": [{ "internalType": "bool", "name": "_paused", "type": "bool" }], "name": "setPaused", "outputs": [], "stateMutability": "nonpayable", @@ -586,36 +490,12 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "referralReward_", "type": "uint256" }], - "name": "setReferralReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "referralThreshhold_", "type": "uint256" }], - "name": "setReferralThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "registry_", "type": "address" }], + "inputs": [{ "internalType": "address", "name": "_registry", "type": "address" }], "name": "setRegistry", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "policyholder_", "type": "address" }, - { "internalType": "uint256", "name": "rewardPoints_", "type": "uint256" } - ], - "name": "setRewardPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", @@ -633,7 +513,14 @@ { "inputs": [{ "internalType": "uint256", "name": "policyID", "type": "uint256" }], "name": "tokenURI", - "outputs": [{ "internalType": "string", "name": "tokenURI_", "type": "string" }], + "outputs": [{ "internalType": "string", "name": "uri", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -650,13 +537,26 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newCoverLimit_", "type": "uint256" }, - { "internalType": "bytes", "name": "referralCode_", "type": "bytes" } + { "internalType": "uint256", "name": "premium", "type": "uint256" }, + { "internalType": "address", "name": "policyholder", "type": "address" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "bytes", "name": "signature", "type": "bytes" } ], - "name": "updateCoverLimit", - "outputs": [], - "stateMutability": "nonpayable", + "name": "verifyPremium", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" } + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "bytes", "name": "signature", "type": "bytes" } + ], + "name": "verifyPrice", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } ] diff --git a/src/apps/solace/contracts/ethers/SolaceCoverProductV2.ts b/src/apps/solace/contracts/ethers/SolaceCoverProductV2.ts deleted file mode 100644 index 692c05550..000000000 --- a/src/apps/solace/contracts/ethers/SolaceCoverProductV2.ts +++ /dev/null @@ -1,1847 +0,0 @@ -/* 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 } from './common'; - -export interface SolaceCoverProductV2Interface extends utils.Interface { - functions: { - 'acceptGovernance()': FunctionFragment; - 'accountBalanceOf(address)': FunctionFragment; - 'activatePolicy(address,uint256,uint256,bytes,uint256[])': FunctionFragment; - 'activeCoverLimit()': FunctionFragment; - 'addSupportedChains(uint256[])': FunctionFragment; - 'approve(address,uint256)': FunctionFragment; - 'asset()': FunctionFragment; - 'availableCoverCapacity()': FunctionFragment; - 'balanceOf(address)': FunctionFragment; - 'baseURI()': FunctionFragment; - 'chargeCycle()': FunctionFragment; - 'chargePremiums(address[],uint256[])': FunctionFragment; - 'cooldownPeriod()': FunctionFragment; - 'cooldownStart(address)': FunctionFragment; - 'coverLimitOf(uint256)': FunctionFragment; - 'deactivatePolicy()': FunctionFragment; - 'deposit(address,uint256)': FunctionFragment; - 'getApproved(uint256)': FunctionFragment; - 'getChain(uint256)': FunctionFragment; - 'getPolicyChainInfo(uint256)': FunctionFragment; - 'getReferrerFromReferralCode(bytes)': FunctionFragment; - 'governance()': FunctionFragment; - 'governanceIsLocked()': FunctionFragment; - 'isApprovedForAll(address,address)': FunctionFragment; - 'isReferralCodeUsed(address)': FunctionFragment; - 'isReferralCodeValid(bytes)': FunctionFragment; - 'isReferralOn()': FunctionFragment; - 'isSupportedChain(uint256)': FunctionFragment; - 'lockGovernance()': FunctionFragment; - 'maxCover()': FunctionFragment; - 'maxRate()': FunctionFragment; - 'minRequiredAccountBalance(uint256)': FunctionFragment; - 'name()': FunctionFragment; - 'numSupportedChains()': FunctionFragment; - 'ownerOf(uint256)': FunctionFragment; - 'paused()': FunctionFragment; - 'pendingGovernance()': FunctionFragment; - 'policyCount()': FunctionFragment; - 'policyOf(address)': FunctionFragment; - 'policyStatus(uint256)': FunctionFragment; - 'premiumsPaidOf(address)': FunctionFragment; - 'referralReward()': FunctionFragment; - 'referralThreshold()': FunctionFragment; - 'registry()': FunctionFragment; - 'removeSupportedChain(uint256)': FunctionFragment; - 'rewardPointsOf(address)': FunctionFragment; - 'riskManager()': FunctionFragment; - 'safeTransferFrom(address,address,uint256)': FunctionFragment; - 'safeTransferFrom(address,address,uint256,bytes)': FunctionFragment; - 'setApprovalForAll(address,bool)': FunctionFragment; - 'setAsset(string)': FunctionFragment; - 'setBaseURI(string)': FunctionFragment; - 'setChargeCycle(uint256)': FunctionFragment; - 'setCooldownPeriod(uint256)': FunctionFragment; - 'setIsReferralOn(bool)': FunctionFragment; - 'setMaxRate(uint256,uint256)': FunctionFragment; - 'setPaused(bool)': FunctionFragment; - 'setPendingGovernance(address)': FunctionFragment; - 'setReferralReward(uint256)': FunctionFragment; - 'setReferralThreshold(uint256)': FunctionFragment; - 'setRegistry(address)': FunctionFragment; - 'setRewardPoints(address,uint256)': FunctionFragment; - 'supportsInterface(bytes4)': FunctionFragment; - 'symbol()': FunctionFragment; - 'tokenURI(uint256)': FunctionFragment; - 'transferFrom(address,address,uint256)': FunctionFragment; - 'updateCoverLimit(uint256,bytes)': FunctionFragment; - 'updatePolicyChainInfo(uint256[])': FunctionFragment; - 'withdraw()': FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | 'acceptGovernance' - | 'accountBalanceOf' - | 'activatePolicy' - | 'activeCoverLimit' - | 'addSupportedChains' - | 'approve' - | 'asset' - | 'availableCoverCapacity' - | 'balanceOf' - | 'baseURI' - | 'chargeCycle' - | 'chargePremiums' - | 'cooldownPeriod' - | 'cooldownStart' - | 'coverLimitOf' - | 'deactivatePolicy' - | 'deposit' - | 'getApproved' - | 'getChain' - | 'getPolicyChainInfo' - | 'getReferrerFromReferralCode' - | 'governance' - | 'governanceIsLocked' - | 'isApprovedForAll' - | 'isReferralCodeUsed' - | 'isReferralCodeValid' - | 'isReferralOn' - | 'isSupportedChain' - | 'lockGovernance' - | 'maxCover' - | 'maxRate' - | 'minRequiredAccountBalance' - | 'name' - | 'numSupportedChains' - | 'ownerOf' - | 'paused' - | 'pendingGovernance' - | 'policyCount' - | 'policyOf' - | 'policyStatus' - | 'premiumsPaidOf' - | 'referralReward' - | 'referralThreshold' - | 'registry' - | 'removeSupportedChain' - | 'rewardPointsOf' - | 'riskManager' - | 'safeTransferFrom(address,address,uint256)' - | 'safeTransferFrom(address,address,uint256,bytes)' - | 'setApprovalForAll' - | 'setAsset' - | 'setBaseURI' - | 'setChargeCycle' - | 'setCooldownPeriod' - | 'setIsReferralOn' - | 'setMaxRate' - | 'setPaused' - | 'setPendingGovernance' - | 'setReferralReward' - | 'setReferralThreshold' - | 'setRegistry' - | 'setRewardPoints' - | 'supportsInterface' - | 'symbol' - | 'tokenURI' - | 'transferFrom' - | 'updateCoverLimit' - | 'updatePolicyChainInfo' - | 'withdraw', - ): FunctionFragment; - - encodeFunctionData(functionFragment: 'acceptGovernance', values?: undefined): string; - encodeFunctionData(functionFragment: 'accountBalanceOf', values: [string]): string; - encodeFunctionData( - functionFragment: 'activatePolicy', - values: [string, BigNumberish, BigNumberish, BytesLike, BigNumberish[]], - ): string; - encodeFunctionData(functionFragment: 'activeCoverLimit', values?: undefined): string; - encodeFunctionData(functionFragment: 'addSupportedChains', values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'asset', values?: undefined): string; - encodeFunctionData(functionFragment: 'availableCoverCapacity', values?: undefined): string; - encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; - encodeFunctionData(functionFragment: 'baseURI', values?: undefined): string; - encodeFunctionData(functionFragment: 'chargeCycle', values?: undefined): string; - encodeFunctionData(functionFragment: 'chargePremiums', values: [string[], BigNumberish[]]): string; - encodeFunctionData(functionFragment: 'cooldownPeriod', values?: undefined): string; - encodeFunctionData(functionFragment: 'cooldownStart', values: [string]): string; - encodeFunctionData(functionFragment: 'coverLimitOf', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'deactivatePolicy', values?: undefined): string; - encodeFunctionData(functionFragment: 'deposit', values: [string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'getApproved', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'getChain', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'getPolicyChainInfo', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'getReferrerFromReferralCode', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'governance', values?: undefined): string; - encodeFunctionData(functionFragment: 'governanceIsLocked', values?: undefined): string; - encodeFunctionData(functionFragment: 'isApprovedForAll', values: [string, string]): string; - encodeFunctionData(functionFragment: 'isReferralCodeUsed', values: [string]): string; - encodeFunctionData(functionFragment: 'isReferralCodeValid', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'isReferralOn', values?: undefined): string; - encodeFunctionData(functionFragment: 'isSupportedChain', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'lockGovernance', values?: undefined): string; - encodeFunctionData(functionFragment: 'maxCover', values?: undefined): string; - encodeFunctionData(functionFragment: 'maxRate', values?: undefined): string; - encodeFunctionData(functionFragment: 'minRequiredAccountBalance', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'name', values?: undefined): string; - encodeFunctionData(functionFragment: 'numSupportedChains', values?: undefined): string; - encodeFunctionData(functionFragment: 'ownerOf', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'paused', values?: undefined): string; - encodeFunctionData(functionFragment: 'pendingGovernance', values?: undefined): string; - encodeFunctionData(functionFragment: 'policyCount', values?: undefined): string; - encodeFunctionData(functionFragment: 'policyOf', values: [string]): string; - encodeFunctionData(functionFragment: 'policyStatus', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'premiumsPaidOf', values: [string]): string; - encodeFunctionData(functionFragment: 'referralReward', values?: undefined): string; - encodeFunctionData(functionFragment: 'referralThreshold', values?: undefined): string; - encodeFunctionData(functionFragment: 'registry', values?: undefined): string; - encodeFunctionData(functionFragment: 'removeSupportedChain', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'rewardPointsOf', values: [string]): string; - encodeFunctionData(functionFragment: 'riskManager', values?: undefined): string; - encodeFunctionData( - functionFragment: 'safeTransferFrom(address,address,uint256)', - values: [string, string, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', - values: [string, string, BigNumberish, BytesLike], - ): string; - encodeFunctionData(functionFragment: 'setApprovalForAll', values: [string, boolean]): string; - encodeFunctionData(functionFragment: 'setAsset', values: [string]): string; - encodeFunctionData(functionFragment: 'setBaseURI', values: [string]): string; - encodeFunctionData(functionFragment: 'setChargeCycle', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setCooldownPeriod', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setIsReferralOn', values: [boolean]): string; - encodeFunctionData(functionFragment: 'setMaxRate', values: [BigNumberish, BigNumberish]): string; - encodeFunctionData(functionFragment: 'setPaused', values: [boolean]): string; - encodeFunctionData(functionFragment: 'setPendingGovernance', values: [string]): string; - encodeFunctionData(functionFragment: 'setReferralReward', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setReferralThreshold', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setRegistry', values: [string]): string; - encodeFunctionData(functionFragment: 'setRewardPoints', values: [string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'supportsInterface', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; - encodeFunctionData(functionFragment: 'tokenURI', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'updateCoverLimit', values: [BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: 'updatePolicyChainInfo', values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: 'withdraw', values?: undefined): string; - - decodeFunctionResult(functionFragment: 'acceptGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'accountBalanceOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'activatePolicy', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'activeCoverLimit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'addSupportedChains', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'asset', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'availableCoverCapacity', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'baseURI', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'chargeCycle', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'chargePremiums', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'cooldownPeriod', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'cooldownStart', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'coverLimitOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'deactivatePolicy', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'deposit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getApproved', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getChain', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getPolicyChainInfo', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getReferrerFromReferralCode', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'governanceIsLocked', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralCodeUsed', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralCodeValid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralOn', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isSupportedChain', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'lockGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'maxCover', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'maxRate', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'minRequiredAccountBalance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'numSupportedChains', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'paused', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'pendingGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'policyCount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'policyOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'policyStatus', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'premiumsPaidOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'referralReward', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'referralThreshold', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'registry', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'removeSupportedChain', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'rewardPointsOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'riskManager', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256)', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setAsset', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setBaseURI', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setChargeCycle', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setCooldownPeriod', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setIsReferralOn', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setMaxRate', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setPaused', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setPendingGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setReferralReward', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setReferralThreshold', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setRegistry', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setRewardPoints', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'tokenURI', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'updateCoverLimit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'updatePolicyChainInfo', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result; - - events: { - 'Approval(address,address,uint256)': EventFragment; - 'ApprovalForAll(address,address,bool)': EventFragment; - 'AssetSet(string)': EventFragment; - 'BaseURISet(string)': EventFragment; - 'ChargeCycleSet(uint256)': EventFragment; - 'CooldownPeriodSet(uint256)': EventFragment; - 'CooldownStarted(address,uint256)': EventFragment; - 'CooldownStopped(address)': EventFragment; - 'DepositMade(address,address,uint256)': EventFragment; - 'GovernanceLocked()': EventFragment; - 'GovernancePending(address)': EventFragment; - 'GovernanceTransferred(address,address)': EventFragment; - 'IsReferralOnSet(bool)': EventFragment; - 'MaxRateSet(uint256,uint256)': EventFragment; - 'PauseSet(bool)': EventFragment; - 'PolicyCreated(uint256)': EventFragment; - 'PolicyDeactivated(uint256)': EventFragment; - 'PolicyManagerUpdated(uint256)': EventFragment; - 'PolicyUpdated(uint256)': EventFragment; - 'PremiumCharged(address,uint256)': EventFragment; - 'PremiumPartiallyCharged(address,uint256,uint256)': EventFragment; - 'ReferralRewardSet(uint256)': EventFragment; - 'ReferralRewardsEarned(address,uint256)': EventFragment; - 'ReferralThresholdSet(uint256)': EventFragment; - 'RegistrySet(address)': EventFragment; - 'RewardPointsSet(address,uint256)': EventFragment; - 'SupportedChainRemoved(uint256)': EventFragment; - 'SupportedChainSet(uint256)': EventFragment; - 'Transfer(address,address,uint256)': EventFragment; - 'WithdrawMade(address,uint256)': EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'AssetSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'BaseURISet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ChargeCycleSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownPeriodSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownStarted'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownStopped'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'DepositMade'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'GovernanceLocked'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'GovernancePending'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'GovernanceTransferred'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'IsReferralOnSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'MaxRateSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PauseSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyCreated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyDeactivated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyManagerUpdated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyUpdated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PremiumCharged'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PremiumPartiallyCharged'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralRewardSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralRewardsEarned'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralThresholdSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'RegistrySet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'RewardPointsSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'SupportedChainRemoved'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'SupportedChainSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'WithdrawMade'): EventFragment; -} - -export interface ApprovalEventObject { - owner: string; - approved: string; - tokenId: BigNumber; -} -export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; - -export type ApprovalEventFilter = TypedEventFilter; - -export interface ApprovalForAllEventObject { - owner: string; - operator: string; - approved: boolean; -} -export type ApprovalForAllEvent = TypedEvent<[string, string, boolean], ApprovalForAllEventObject>; - -export type ApprovalForAllEventFilter = TypedEventFilter; - -export interface AssetSetEventObject { - asset: string; -} -export type AssetSetEvent = TypedEvent<[string], AssetSetEventObject>; - -export type AssetSetEventFilter = TypedEventFilter; - -export interface BaseURISetEventObject { - baseURI: string; -} -export type BaseURISetEvent = TypedEvent<[string], BaseURISetEventObject>; - -export type BaseURISetEventFilter = TypedEventFilter; - -export interface ChargeCycleSetEventObject { - chargeCycle: BigNumber; -} -export type ChargeCycleSetEvent = TypedEvent<[BigNumber], ChargeCycleSetEventObject>; - -export type ChargeCycleSetEventFilter = TypedEventFilter; - -export interface CooldownPeriodSetEventObject { - cooldownPeriod: BigNumber; -} -export type CooldownPeriodSetEvent = TypedEvent<[BigNumber], CooldownPeriodSetEventObject>; - -export type CooldownPeriodSetEventFilter = TypedEventFilter; - -export interface CooldownStartedEventObject { - policyholder: string; - startTime: BigNumber; -} -export type CooldownStartedEvent = TypedEvent<[string, BigNumber], CooldownStartedEventObject>; - -export type CooldownStartedEventFilter = TypedEventFilter; - -export interface CooldownStoppedEventObject { - policyholder: string; -} -export type CooldownStoppedEvent = TypedEvent<[string], CooldownStoppedEventObject>; - -export type CooldownStoppedEventFilter = TypedEventFilter; - -export interface DepositMadeEventObject { - from: string; - policyholder: string; - amount: BigNumber; -} -export type DepositMadeEvent = TypedEvent<[string, string, BigNumber], DepositMadeEventObject>; - -export type DepositMadeEventFilter = TypedEventFilter; - -export interface GovernanceLockedEventObject {} -export type GovernanceLockedEvent = TypedEvent<[], GovernanceLockedEventObject>; - -export type GovernanceLockedEventFilter = TypedEventFilter; - -export interface GovernancePendingEventObject { - pendingGovernance: string; -} -export type GovernancePendingEvent = TypedEvent<[string], GovernancePendingEventObject>; - -export type GovernancePendingEventFilter = TypedEventFilter; - -export interface GovernanceTransferredEventObject { - oldGovernance: string; - newGovernance: string; -} -export type GovernanceTransferredEvent = TypedEvent<[string, string], GovernanceTransferredEventObject>; - -export type GovernanceTransferredEventFilter = TypedEventFilter; - -export interface IsReferralOnSetEventObject { - isReferralOn: boolean; -} -export type IsReferralOnSetEvent = TypedEvent<[boolean], IsReferralOnSetEventObject>; - -export type IsReferralOnSetEventFilter = TypedEventFilter; - -export interface MaxRateSetEventObject { - maxRateNum: BigNumber; - maxRateDenom: BigNumber; -} -export type MaxRateSetEvent = TypedEvent<[BigNumber, BigNumber], MaxRateSetEventObject>; - -export type MaxRateSetEventFilter = TypedEventFilter; - -export interface PauseSetEventObject { - pause: boolean; -} -export type PauseSetEvent = TypedEvent<[boolean], PauseSetEventObject>; - -export type PauseSetEventFilter = TypedEventFilter; - -export interface PolicyCreatedEventObject { - policyID: BigNumber; -} -export type PolicyCreatedEvent = TypedEvent<[BigNumber], PolicyCreatedEventObject>; - -export type PolicyCreatedEventFilter = TypedEventFilter; - -export interface PolicyDeactivatedEventObject { - policyID: BigNumber; -} -export type PolicyDeactivatedEvent = TypedEvent<[BigNumber], PolicyDeactivatedEventObject>; - -export type PolicyDeactivatedEventFilter = TypedEventFilter; - -export interface PolicyManagerUpdatedEventObject { - activeCoverLimit: BigNumber; -} -export type PolicyManagerUpdatedEvent = TypedEvent<[BigNumber], PolicyManagerUpdatedEventObject>; - -export type PolicyManagerUpdatedEventFilter = TypedEventFilter; - -export interface PolicyUpdatedEventObject { - policyID: BigNumber; -} -export type PolicyUpdatedEvent = TypedEvent<[BigNumber], PolicyUpdatedEventObject>; - -export type PolicyUpdatedEventFilter = TypedEventFilter; - -export interface PremiumChargedEventObject { - policyholder: string; - amount: BigNumber; -} -export type PremiumChargedEvent = TypedEvent<[string, BigNumber], PremiumChargedEventObject>; - -export type PremiumChargedEventFilter = TypedEventFilter; - -export interface PremiumPartiallyChargedEventObject { - policyholder: string; - actualPremium: BigNumber; - chargedPremium: BigNumber; -} -export type PremiumPartiallyChargedEvent = TypedEvent< - [string, BigNumber, BigNumber], - PremiumPartiallyChargedEventObject ->; - -export type PremiumPartiallyChargedEventFilter = TypedEventFilter; - -export interface ReferralRewardSetEventObject { - referralReward: BigNumber; -} -export type ReferralRewardSetEvent = TypedEvent<[BigNumber], ReferralRewardSetEventObject>; - -export type ReferralRewardSetEventFilter = TypedEventFilter; - -export interface ReferralRewardsEarnedEventObject { - rewardEarner: string; - rewardPointsEarned: BigNumber; -} -export type ReferralRewardsEarnedEvent = TypedEvent<[string, BigNumber], ReferralRewardsEarnedEventObject>; - -export type ReferralRewardsEarnedEventFilter = TypedEventFilter; - -export interface ReferralThresholdSetEventObject { - referralThreshold: BigNumber; -} -export type ReferralThresholdSetEvent = TypedEvent<[BigNumber], ReferralThresholdSetEventObject>; - -export type ReferralThresholdSetEventFilter = TypedEventFilter; - -export interface RegistrySetEventObject { - registry: string; -} -export type RegistrySetEvent = TypedEvent<[string], RegistrySetEventObject>; - -export type RegistrySetEventFilter = TypedEventFilter; - -export interface RewardPointsSetEventObject { - policyholder: string; - amountGifted: BigNumber; -} -export type RewardPointsSetEvent = TypedEvent<[string, BigNumber], RewardPointsSetEventObject>; - -export type RewardPointsSetEventFilter = TypedEventFilter; - -export interface SupportedChainRemovedEventObject { - chainId: BigNumber; -} -export type SupportedChainRemovedEvent = TypedEvent<[BigNumber], SupportedChainRemovedEventObject>; - -export type SupportedChainRemovedEventFilter = TypedEventFilter; - -export interface SupportedChainSetEventObject { - chainId: BigNumber; -} -export type SupportedChainSetEvent = TypedEvent<[BigNumber], SupportedChainSetEventObject>; - -export type SupportedChainSetEventFilter = TypedEventFilter; - -export interface TransferEventObject { - from: string; - to: string; - tokenId: BigNumber; -} -export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; - -export type TransferEventFilter = TypedEventFilter; - -export interface WithdrawMadeEventObject { - policyholder: string; - amount: BigNumber; -} -export type WithdrawMadeEvent = TypedEvent<[string, BigNumber], WithdrawMadeEventObject>; - -export type WithdrawMadeEventFilter = TypedEventFilter; - -export interface SolaceCoverProductV2 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: SolaceCoverProductV2Interface; - - 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: { - acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise<[BigNumber] & { balance: BigNumber }>; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - chains_: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - activeCoverLimit(overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; - - addSupportedChains( - supportedChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - approve( - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - asset(overrides?: CallOverrides): Promise<[string]>; - - availableCoverCapacity(overrides?: CallOverrides): Promise<[BigNumber] & { availableCoverCapacity_: BigNumber }>; - - balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; - - baseURI(overrides?: CallOverrides): Promise<[string]>; - - chargeCycle(overrides?: CallOverrides): Promise<[BigNumber] & { chargeCycle_: BigNumber }>; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise<[BigNumber] & { cooldownPeriod_: BigNumber }>; - - cooldownStart( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { cooldownStart_: BigNumber }>; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; - - getChain(chainIndex: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { chainId: BigNumber }>; - - getPolicyChainInfo( - policyID: BigNumberish, - overrides?: CallOverrides, - ): Promise<[BigNumber[]] & { policyChains: BigNumber[] }>; - - getReferrerFromReferralCode( - referralCode: BytesLike, - overrides?: CallOverrides, - ): Promise<[string] & { referrer: string }>; - - governance(overrides?: CallOverrides): Promise<[string]>; - - governanceIsLocked(overrides?: CallOverrides): Promise<[boolean]>; - - isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise<[boolean]>; - - isReferralCodeUsed( - policyholder: string, - overrides?: CallOverrides, - ): Promise<[boolean] & { isReferralCodeUsed_: boolean }>; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; - - isReferralOn(overrides?: CallOverrides): Promise<[boolean] & { isReferralOn_: boolean }>; - - isSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; - - lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - maxCover(overrides?: CallOverrides): Promise<[BigNumber] & { cover: BigNumber }>; - - maxRate(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - maxRateNum_: BigNumber; - maxRateDenom_: BigNumber; - } - >; - - minRequiredAccountBalance( - coverLimit: BigNumberish, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { minRequiredAccountBalance_: BigNumber }>; - - name(overrides?: CallOverrides): Promise<[string]>; - - numSupportedChains(overrides?: CallOverrides): Promise<[BigNumber] & { count: BigNumber }>; - - ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; - - paused(overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; - - pendingGovernance(overrides?: CallOverrides): Promise<[string]>; - - policyCount(overrides?: CallOverrides): Promise<[BigNumber] & { count: BigNumber }>; - - policyOf(policyholder_: string, overrides?: CallOverrides): Promise<[BigNumber] & { policyID: BigNumber }>; - - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; - - premiumsPaidOf( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { premiumsPaid_: BigNumber }>; - - referralReward(overrides?: CallOverrides): Promise<[BigNumber] & { referralReward_: BigNumber }>; - - referralThreshold(overrides?: CallOverrides): Promise<[BigNumber] & { referralThreshold_: BigNumber }>; - - registry(overrides?: CallOverrides): Promise<[string] & { registry_: string }>; - - removeSupportedChain( - chainId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - rewardPointsOf( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { rewardPoints_: BigNumber }>; - - riskManager(overrides?: CallOverrides): Promise<[string] & { riskManager_: string }>; - - 'safeTransferFrom(address,address,uint256)'( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - 'safeTransferFrom(address,address,uint256,bytes)'( - from: string, - to: string, - tokenId: BigNumberish, - _data: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setApprovalForAll( - operator: string, - approved: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setAsset( - assetName: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setBaseURI( - baseURI_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setIsReferralOn( - isReferralOn_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRate( - maxRateNum_: BigNumberish, - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPaused( - paused_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPendingGovernance( - pendingGovernance_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; - - symbol(overrides?: CallOverrides): Promise<[string]>; - - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise<[string] & { tokenURI_: string }>; - - transferFrom( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updatePolicyChainInfo( - policyChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; - }; - - acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - chains_: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - activeCoverLimit(overrides?: CallOverrides): Promise; - - addSupportedChains( - supportedChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - approve( - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - asset(overrides?: CallOverrides): Promise; - - availableCoverCapacity(overrides?: CallOverrides): Promise; - - balanceOf(owner: string, overrides?: CallOverrides): Promise; - - baseURI(overrides?: CallOverrides): Promise; - - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - getChain(chainIndex: BigNumberish, overrides?: CallOverrides): Promise; - - getPolicyChainInfo(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - governance(overrides?: CallOverrides): Promise; - - governanceIsLocked(overrides?: CallOverrides): Promise; - - isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; - - isSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise; - - lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - maxCover(overrides?: CallOverrides): Promise; - - maxRate(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - maxRateNum_: BigNumber; - maxRateDenom_: BigNumber; - } - >; - - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; - - name(overrides?: CallOverrides): Promise; - - numSupportedChains(overrides?: CallOverrides): Promise; - - ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - pendingGovernance(overrides?: CallOverrides): Promise; - - policyCount(overrides?: CallOverrides): Promise; - - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; - - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; - - referralReward(overrides?: CallOverrides): Promise; - - referralThreshold(overrides?: CallOverrides): Promise; - - registry(overrides?: CallOverrides): Promise; - - removeSupportedChain( - chainId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; - - riskManager(overrides?: CallOverrides): Promise; - - 'safeTransferFrom(address,address,uint256)'( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - 'safeTransferFrom(address,address,uint256,bytes)'( - from: string, - to: string, - tokenId: BigNumberish, - _data: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setApprovalForAll( - operator: string, - approved: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setAsset( - assetName: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setBaseURI( - baseURI_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setIsReferralOn( - isReferralOn_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRate( - maxRateNum_: BigNumberish, - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPaused( - paused_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPendingGovernance( - pendingGovernance_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - transferFrom( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updatePolicyChainInfo( - policyChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; - - callStatic: { - acceptGovernance(overrides?: CallOverrides): Promise; - - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - chains_: BigNumberish[], - overrides?: CallOverrides, - ): Promise; - - activeCoverLimit(overrides?: CallOverrides): Promise; - - addSupportedChains(supportedChains: BigNumberish[], overrides?: CallOverrides): Promise; - - approve(to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - asset(overrides?: CallOverrides): Promise; - - availableCoverCapacity(overrides?: CallOverrides): Promise; - - balanceOf(owner: string, overrides?: CallOverrides): Promise; - - baseURI(overrides?: CallOverrides): Promise; - - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums(holders: string[], premiums: BigNumberish[], overrides?: CallOverrides): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: CallOverrides): Promise; - - deposit(policyholder: string, amount: BigNumberish, overrides?: CallOverrides): Promise; - - getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - getChain(chainIndex: BigNumberish, overrides?: CallOverrides): Promise; - - getPolicyChainInfo(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - governance(overrides?: CallOverrides): Promise; - - governanceIsLocked(overrides?: CallOverrides): Promise; - - isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; - - isSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise; - - lockGovernance(overrides?: CallOverrides): Promise; - - maxCover(overrides?: CallOverrides): Promise; - - maxRate(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - maxRateNum_: BigNumber; - maxRateDenom_: BigNumber; - } - >; - - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; - - name(overrides?: CallOverrides): Promise; - - numSupportedChains(overrides?: CallOverrides): Promise; - - ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - pendingGovernance(overrides?: CallOverrides): Promise; - - policyCount(overrides?: CallOverrides): Promise; - - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; - - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; - - referralReward(overrides?: CallOverrides): Promise; - - referralThreshold(overrides?: CallOverrides): Promise; - - registry(overrides?: CallOverrides): Promise; - - removeSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise; - - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; - - riskManager(overrides?: CallOverrides): Promise; - - 'safeTransferFrom(address,address,uint256)'( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: CallOverrides, - ): Promise; - - 'safeTransferFrom(address,address,uint256,bytes)'( - from: string, - to: string, - tokenId: BigNumberish, - _data: BytesLike, - overrides?: CallOverrides, - ): Promise; - - setApprovalForAll(operator: string, approved: boolean, overrides?: CallOverrides): Promise; - - setAsset(assetName: string, overrides?: CallOverrides): Promise; - - setBaseURI(baseURI_: string, overrides?: CallOverrides): Promise; - - setChargeCycle(chargeCycle_: BigNumberish, overrides?: CallOverrides): Promise; - - setCooldownPeriod(cooldownPeriod_: BigNumberish, overrides?: CallOverrides): Promise; - - setIsReferralOn(isReferralOn_: boolean, overrides?: CallOverrides): Promise; - - setMaxRate(maxRateNum_: BigNumberish, maxRateDenom_: BigNumberish, overrides?: CallOverrides): Promise; - - setPaused(paused_: boolean, overrides?: CallOverrides): Promise; - - setPendingGovernance(pendingGovernance_: string, overrides?: CallOverrides): Promise; - - setReferralReward(referralReward_: BigNumberish, overrides?: CallOverrides): Promise; - - setReferralThreshold(referralThreshhold_: BigNumberish, overrides?: CallOverrides): Promise; - - setRegistry(registry_: string, overrides?: CallOverrides): Promise; - - setRewardPoints(policyholder_: string, rewardPoints_: BigNumberish, overrides?: CallOverrides): Promise; - - supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - transferFrom(from: string, to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - updateCoverLimit(newCoverLimit_: BigNumberish, referralCode_: BytesLike, overrides?: CallOverrides): Promise; - - updatePolicyChainInfo(policyChains: BigNumberish[], overrides?: CallOverrides): Promise; - - withdraw(overrides?: CallOverrides): Promise; - }; - - filters: { - 'Approval(address,address,uint256)'( - owner?: string | null, - approved?: string | null, - tokenId?: BigNumberish | null, - ): ApprovalEventFilter; - Approval(owner?: string | null, approved?: string | null, tokenId?: BigNumberish | null): ApprovalEventFilter; - - 'ApprovalForAll(address,address,bool)'( - owner?: string | null, - operator?: string | null, - approved?: null, - ): ApprovalForAllEventFilter; - ApprovalForAll(owner?: string | null, operator?: string | null, approved?: null): ApprovalForAllEventFilter; - - 'AssetSet(string)'(asset?: null): AssetSetEventFilter; - AssetSet(asset?: null): AssetSetEventFilter; - - 'BaseURISet(string)'(baseURI?: null): BaseURISetEventFilter; - BaseURISet(baseURI?: null): BaseURISetEventFilter; - - 'ChargeCycleSet(uint256)'(chargeCycle?: null): ChargeCycleSetEventFilter; - ChargeCycleSet(chargeCycle?: null): ChargeCycleSetEventFilter; - - 'CooldownPeriodSet(uint256)'(cooldownPeriod?: null): CooldownPeriodSetEventFilter; - CooldownPeriodSet(cooldownPeriod?: null): CooldownPeriodSetEventFilter; - - 'CooldownStarted(address,uint256)'(policyholder?: null, startTime?: null): CooldownStartedEventFilter; - CooldownStarted(policyholder?: null, startTime?: null): CooldownStartedEventFilter; - - 'CooldownStopped(address)'(policyholder?: null): CooldownStoppedEventFilter; - CooldownStopped(policyholder?: null): CooldownStoppedEventFilter; - - 'DepositMade(address,address,uint256)'(from?: null, policyholder?: null, amount?: null): DepositMadeEventFilter; - DepositMade(from?: null, policyholder?: null, amount?: null): DepositMadeEventFilter; - - 'GovernanceLocked()'(): GovernanceLockedEventFilter; - GovernanceLocked(): GovernanceLockedEventFilter; - - 'GovernancePending(address)'(pendingGovernance?: null): GovernancePendingEventFilter; - GovernancePending(pendingGovernance?: null): GovernancePendingEventFilter; - - 'GovernanceTransferred(address,address)'( - oldGovernance?: null, - newGovernance?: null, - ): GovernanceTransferredEventFilter; - GovernanceTransferred(oldGovernance?: null, newGovernance?: null): GovernanceTransferredEventFilter; - - 'IsReferralOnSet(bool)'(isReferralOn?: null): IsReferralOnSetEventFilter; - IsReferralOnSet(isReferralOn?: null): IsReferralOnSetEventFilter; - - 'MaxRateSet(uint256,uint256)'(maxRateNum?: null, maxRateDenom?: null): MaxRateSetEventFilter; - MaxRateSet(maxRateNum?: null, maxRateDenom?: null): MaxRateSetEventFilter; - - 'PauseSet(bool)'(pause?: null): PauseSetEventFilter; - PauseSet(pause?: null): PauseSetEventFilter; - - 'PolicyCreated(uint256)'(policyID?: null): PolicyCreatedEventFilter; - PolicyCreated(policyID?: null): PolicyCreatedEventFilter; - - 'PolicyDeactivated(uint256)'(policyID?: null): PolicyDeactivatedEventFilter; - PolicyDeactivated(policyID?: null): PolicyDeactivatedEventFilter; - - 'PolicyManagerUpdated(uint256)'(activeCoverLimit?: null): PolicyManagerUpdatedEventFilter; - PolicyManagerUpdated(activeCoverLimit?: null): PolicyManagerUpdatedEventFilter; - - 'PolicyUpdated(uint256)'(policyID?: null): PolicyUpdatedEventFilter; - PolicyUpdated(policyID?: null): PolicyUpdatedEventFilter; - - 'PremiumCharged(address,uint256)'(policyholder?: null, amount?: null): PremiumChargedEventFilter; - PremiumCharged(policyholder?: null, amount?: null): PremiumChargedEventFilter; - - 'PremiumPartiallyCharged(address,uint256,uint256)'( - policyholder?: null, - actualPremium?: null, - chargedPremium?: null, - ): PremiumPartiallyChargedEventFilter; - PremiumPartiallyCharged( - policyholder?: null, - actualPremium?: null, - chargedPremium?: null, - ): PremiumPartiallyChargedEventFilter; - - 'ReferralRewardSet(uint256)'(referralReward?: null): ReferralRewardSetEventFilter; - ReferralRewardSet(referralReward?: null): ReferralRewardSetEventFilter; - - 'ReferralRewardsEarned(address,uint256)'( - rewardEarner?: null, - rewardPointsEarned?: null, - ): ReferralRewardsEarnedEventFilter; - ReferralRewardsEarned(rewardEarner?: null, rewardPointsEarned?: null): ReferralRewardsEarnedEventFilter; - - 'ReferralThresholdSet(uint256)'(referralThreshold?: null): ReferralThresholdSetEventFilter; - ReferralThresholdSet(referralThreshold?: null): ReferralThresholdSetEventFilter; - - 'RegistrySet(address)'(registry?: null): RegistrySetEventFilter; - RegistrySet(registry?: null): RegistrySetEventFilter; - - 'RewardPointsSet(address,uint256)'(policyholder?: null, amountGifted?: null): RewardPointsSetEventFilter; - RewardPointsSet(policyholder?: null, amountGifted?: null): RewardPointsSetEventFilter; - - 'SupportedChainRemoved(uint256)'(chainId?: null): SupportedChainRemovedEventFilter; - SupportedChainRemoved(chainId?: null): SupportedChainRemovedEventFilter; - - 'SupportedChainSet(uint256)'(chainId?: null): SupportedChainSetEventFilter; - SupportedChainSet(chainId?: null): SupportedChainSetEventFilter; - - 'Transfer(address,address,uint256)'( - from?: string | null, - to?: string | null, - tokenId?: BigNumberish | null, - ): TransferEventFilter; - Transfer(from?: string | null, to?: string | null, tokenId?: BigNumberish | null): TransferEventFilter; - - 'WithdrawMade(address,uint256)'(policyholder?: null, amount?: null): WithdrawMadeEventFilter; - WithdrawMade(policyholder?: null, amount?: null): WithdrawMadeEventFilter; - }; - - estimateGas: { - acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - chains_: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - activeCoverLimit(overrides?: CallOverrides): Promise; - - addSupportedChains( - supportedChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - approve( - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - asset(overrides?: CallOverrides): Promise; - - availableCoverCapacity(overrides?: CallOverrides): Promise; - - balanceOf(owner: string, overrides?: CallOverrides): Promise; - - baseURI(overrides?: CallOverrides): Promise; - - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - getChain(chainIndex: BigNumberish, overrides?: CallOverrides): Promise; - - getPolicyChainInfo(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - governance(overrides?: CallOverrides): Promise; - - governanceIsLocked(overrides?: CallOverrides): Promise; - - isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; - - isSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise; - - lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - maxCover(overrides?: CallOverrides): Promise; - - maxRate(overrides?: CallOverrides): Promise; - - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; - - name(overrides?: CallOverrides): Promise; - - numSupportedChains(overrides?: CallOverrides): Promise; - - ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - pendingGovernance(overrides?: CallOverrides): Promise; - - policyCount(overrides?: CallOverrides): Promise; - - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; - - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; - - referralReward(overrides?: CallOverrides): Promise; - - referralThreshold(overrides?: CallOverrides): Promise; - - registry(overrides?: CallOverrides): Promise; - - removeSupportedChain( - chainId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; - - riskManager(overrides?: CallOverrides): Promise; - - 'safeTransferFrom(address,address,uint256)'( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - 'safeTransferFrom(address,address,uint256,bytes)'( - from: string, - to: string, - tokenId: BigNumberish, - _data: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setApprovalForAll( - operator: string, - approved: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setAsset(assetName: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - setBaseURI(baseURI_: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setIsReferralOn( - isReferralOn_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRate( - maxRateNum_: BigNumberish, - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPaused(paused_: boolean, overrides?: Overrides & { from?: string | Promise }): Promise; - - setPendingGovernance( - pendingGovernance_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRegistry(registry_: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - transferFrom( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updatePolicyChainInfo( - policyChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; - }; - - populateTransaction: { - acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - chains_: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - activeCoverLimit(overrides?: CallOverrides): Promise; - - addSupportedChains( - supportedChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - approve( - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - asset(overrides?: CallOverrides): Promise; - - availableCoverCapacity(overrides?: CallOverrides): Promise; - - balanceOf(owner: string, overrides?: CallOverrides): Promise; - - baseURI(overrides?: CallOverrides): Promise; - - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - getChain(chainIndex: BigNumberish, overrides?: CallOverrides): Promise; - - getPolicyChainInfo(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - governance(overrides?: CallOverrides): Promise; - - governanceIsLocked(overrides?: CallOverrides): Promise; - - isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; - - isSupportedChain(chainId: BigNumberish, overrides?: CallOverrides): Promise; - - lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - - maxCover(overrides?: CallOverrides): Promise; - - maxRate(overrides?: CallOverrides): Promise; - - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; - - name(overrides?: CallOverrides): Promise; - - numSupportedChains(overrides?: CallOverrides): Promise; - - ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - pendingGovernance(overrides?: CallOverrides): Promise; - - policyCount(overrides?: CallOverrides): Promise; - - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; - - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; - - referralReward(overrides?: CallOverrides): Promise; - - referralThreshold(overrides?: CallOverrides): Promise; - - registry(overrides?: CallOverrides): Promise; - - removeSupportedChain( - chainId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; - - riskManager(overrides?: CallOverrides): Promise; - - 'safeTransferFrom(address,address,uint256)'( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - 'safeTransferFrom(address,address,uint256,bytes)'( - from: string, - to: string, - tokenId: BigNumberish, - _data: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setApprovalForAll( - operator: string, - approved: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setAsset( - assetName: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setBaseURI( - baseURI_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setIsReferralOn( - isReferralOn_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRate( - maxRateNum_: BigNumberish, - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPaused( - paused_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPendingGovernance( - pendingGovernance_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; - - transferFrom( - from: string, - to: string, - tokenId: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - updatePolicyChainInfo( - policyChains: BigNumberish[], - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; - }; -} diff --git a/src/apps/solace/contracts/ethers/SolaceCoverProduct.ts b/src/apps/solace/contracts/ethers/SolaceCoverProductV3.ts similarity index 55% rename from src/apps/solace/contracts/ethers/SolaceCoverProduct.ts rename to src/apps/solace/contracts/ethers/SolaceCoverProductV3.ts index 744018c90..c6f447093 100644 --- a/src/apps/solace/contracts/ethers/SolaceCoverProduct.ts +++ b/src/apps/solace/contracts/ethers/SolaceCoverProductV3.ts @@ -17,181 +17,167 @@ import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi import type { Listener, Provider } from '@ethersproject/providers'; import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; -export interface SolaceCoverProductInterface extends utils.Interface { +export interface SolaceCoverProductV3Interface extends utils.Interface { functions: { 'acceptGovernance()': FunctionFragment; - 'accountBalanceOf(address)': FunctionFragment; - 'activatePolicy(address,uint256,uint256,bytes)': FunctionFragment; 'activeCoverLimit()': FunctionFragment; + 'addSigner(address)': FunctionFragment; 'approve(address,uint256)': FunctionFragment; 'availableCoverCapacity()': FunctionFragment; 'balanceOf(address)': FunctionFragment; 'baseURI()': FunctionFragment; + 'cancel(uint256,uint256,bytes)': FunctionFragment; + 'cancelPolicies(address[])': FunctionFragment; 'chargeCycle()': FunctionFragment; - 'chargePremiums(address[],uint256[])': FunctionFragment; - 'cooldownPeriod()': FunctionFragment; - 'cooldownStart(address)': FunctionFragment; 'coverLimitOf(uint256)': FunctionFragment; - 'deactivatePolicy()': FunctionFragment; - 'deposit(address,uint256)': FunctionFragment; 'getApproved(uint256)': FunctionFragment; - 'getReferrerFromReferralCode(bytes)': FunctionFragment; + 'getSigner(uint256)': FunctionFragment; 'governance()': FunctionFragment; 'governanceIsLocked()': FunctionFragment; 'isApprovedForAll(address,address)': FunctionFragment; - 'isReferralCodeUsed(address)': FunctionFragment; - 'isReferralCodeValid(bytes)': FunctionFragment; - 'isReferralOn()': FunctionFragment; + 'isSigner(address)': FunctionFragment; + 'latestChargedTime()': FunctionFragment; 'lockGovernance()': FunctionFragment; 'maxCover()': FunctionFragment; 'maxRateDenom()': FunctionFragment; 'maxRateNum()': FunctionFragment; 'minRequiredAccountBalance(uint256)': FunctionFragment; + 'minScpRequired(address)': FunctionFragment; 'name()': FunctionFragment; + 'numSigners()': FunctionFragment; 'ownerOf(uint256)': FunctionFragment; 'paused()': FunctionFragment; + 'paymentManager()': FunctionFragment; 'pendingGovernance()': FunctionFragment; - 'policyCount()': FunctionFragment; 'policyOf(address)': FunctionFragment; 'policyStatus(uint256)': FunctionFragment; - 'premiumsPaidOf(address)': FunctionFragment; - 'referralReward()': FunctionFragment; - 'referralThreshold()': FunctionFragment; + 'purchase(address,uint256)': FunctionFragment; + 'purchaseWithNonStable(address,uint256,address,uint256,uint256,uint256,bytes)': FunctionFragment; + 'purchaseWithStable(address,uint256,address,uint256)': FunctionFragment; 'registry()': FunctionFragment; - 'rewardPointsOf(address)': FunctionFragment; + 'removeSigner(address)': FunctionFragment; 'riskManager()': FunctionFragment; 'safeTransferFrom(address,address,uint256)': FunctionFragment; 'safeTransferFrom(address,address,uint256,bytes)': FunctionFragment; 'setApprovalForAll(address,bool)': FunctionFragment; 'setBaseURI(string)': FunctionFragment; - 'setChargeCycle(uint256)': FunctionFragment; - 'setCooldownPeriod(uint256)': FunctionFragment; - 'setIsReferralOn(bool)': FunctionFragment; - 'setMaxRateDenom(uint256)': FunctionFragment; - 'setMaxRateNum(uint256)': FunctionFragment; + 'setChargeCycle(uint8)': FunctionFragment; + 'setChargedTime(uint256)': FunctionFragment; + 'setMaxRate(uint256,uint256)': FunctionFragment; 'setPaused(bool)': FunctionFragment; 'setPendingGovernance(address)': FunctionFragment; - 'setReferralReward(uint256)': FunctionFragment; - 'setReferralThreshold(uint256)': FunctionFragment; 'setRegistry(address)': FunctionFragment; - 'setRewardPoints(address,uint256)': FunctionFragment; 'supportsInterface(bytes4)': FunctionFragment; 'symbol()': FunctionFragment; 'tokenURI(uint256)': FunctionFragment; + 'totalSupply()': FunctionFragment; 'transferFrom(address,address,uint256)': FunctionFragment; - 'updateCoverLimit(uint256,bytes)': FunctionFragment; - 'withdraw()': FunctionFragment; + 'verifyPremium(uint256,address,uint256,bytes)': FunctionFragment; + 'verifyPrice(address,uint256,uint256,bytes)': FunctionFragment; }; getFunction( nameOrSignatureOrTopic: | 'acceptGovernance' - | 'accountBalanceOf' - | 'activatePolicy' | 'activeCoverLimit' + | 'addSigner' | 'approve' | 'availableCoverCapacity' | 'balanceOf' | 'baseURI' + | 'cancel' + | 'cancelPolicies' | 'chargeCycle' - | 'chargePremiums' - | 'cooldownPeriod' - | 'cooldownStart' | 'coverLimitOf' - | 'deactivatePolicy' - | 'deposit' | 'getApproved' - | 'getReferrerFromReferralCode' + | 'getSigner' | 'governance' | 'governanceIsLocked' | 'isApprovedForAll' - | 'isReferralCodeUsed' - | 'isReferralCodeValid' - | 'isReferralOn' + | 'isSigner' + | 'latestChargedTime' | 'lockGovernance' | 'maxCover' | 'maxRateDenom' | 'maxRateNum' | 'minRequiredAccountBalance' + | 'minScpRequired' | 'name' + | 'numSigners' | 'ownerOf' | 'paused' + | 'paymentManager' | 'pendingGovernance' - | 'policyCount' | 'policyOf' | 'policyStatus' - | 'premiumsPaidOf' - | 'referralReward' - | 'referralThreshold' + | 'purchase' + | 'purchaseWithNonStable' + | 'purchaseWithStable' | 'registry' - | 'rewardPointsOf' + | 'removeSigner' | 'riskManager' | 'safeTransferFrom(address,address,uint256)' | 'safeTransferFrom(address,address,uint256,bytes)' | 'setApprovalForAll' | 'setBaseURI' | 'setChargeCycle' - | 'setCooldownPeriod' - | 'setIsReferralOn' - | 'setMaxRateDenom' - | 'setMaxRateNum' + | 'setChargedTime' + | 'setMaxRate' | 'setPaused' | 'setPendingGovernance' - | 'setReferralReward' - | 'setReferralThreshold' | 'setRegistry' - | 'setRewardPoints' | 'supportsInterface' | 'symbol' | 'tokenURI' + | 'totalSupply' | 'transferFrom' - | 'updateCoverLimit' - | 'withdraw', + | 'verifyPremium' + | 'verifyPrice', ): FunctionFragment; encodeFunctionData(functionFragment: 'acceptGovernance', values?: undefined): string; - encodeFunctionData(functionFragment: 'accountBalanceOf', values: [string]): string; - encodeFunctionData( - functionFragment: 'activatePolicy', - values: [string, BigNumberish, BigNumberish, BytesLike], - ): string; encodeFunctionData(functionFragment: 'activeCoverLimit', values?: undefined): string; + encodeFunctionData(functionFragment: 'addSigner', values: [string]): string; encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; encodeFunctionData(functionFragment: 'availableCoverCapacity', values?: undefined): string; encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; encodeFunctionData(functionFragment: 'baseURI', values?: undefined): string; + encodeFunctionData(functionFragment: 'cancel', values: [BigNumberish, BigNumberish, BytesLike]): string; + encodeFunctionData(functionFragment: 'cancelPolicies', values: [string[]]): string; encodeFunctionData(functionFragment: 'chargeCycle', values?: undefined): string; - encodeFunctionData(functionFragment: 'chargePremiums', values: [string[], BigNumberish[]]): string; - encodeFunctionData(functionFragment: 'cooldownPeriod', values?: undefined): string; - encodeFunctionData(functionFragment: 'cooldownStart', values: [string]): string; encodeFunctionData(functionFragment: 'coverLimitOf', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'deactivatePolicy', values?: undefined): string; - encodeFunctionData(functionFragment: 'deposit', values: [string, BigNumberish]): string; encodeFunctionData(functionFragment: 'getApproved', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'getReferrerFromReferralCode', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'getSigner', values: [BigNumberish]): string; encodeFunctionData(functionFragment: 'governance', values?: undefined): string; encodeFunctionData(functionFragment: 'governanceIsLocked', values?: undefined): string; encodeFunctionData(functionFragment: 'isApprovedForAll', values: [string, string]): string; - encodeFunctionData(functionFragment: 'isReferralCodeUsed', values: [string]): string; - encodeFunctionData(functionFragment: 'isReferralCodeValid', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'isReferralOn', values?: undefined): string; + encodeFunctionData(functionFragment: 'isSigner', values: [string]): string; + encodeFunctionData(functionFragment: 'latestChargedTime', values?: undefined): string; encodeFunctionData(functionFragment: 'lockGovernance', values?: undefined): string; encodeFunctionData(functionFragment: 'maxCover', values?: undefined): string; encodeFunctionData(functionFragment: 'maxRateDenom', values?: undefined): string; encodeFunctionData(functionFragment: 'maxRateNum', values?: undefined): string; encodeFunctionData(functionFragment: 'minRequiredAccountBalance', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'minScpRequired', values: [string]): string; encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'numSigners', values?: undefined): string; encodeFunctionData(functionFragment: 'ownerOf', values: [BigNumberish]): string; encodeFunctionData(functionFragment: 'paused', values?: undefined): string; + encodeFunctionData(functionFragment: 'paymentManager', values?: undefined): string; encodeFunctionData(functionFragment: 'pendingGovernance', values?: undefined): string; - encodeFunctionData(functionFragment: 'policyCount', values?: undefined): string; encodeFunctionData(functionFragment: 'policyOf', values: [string]): string; encodeFunctionData(functionFragment: 'policyStatus', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'premiumsPaidOf', values: [string]): string; - encodeFunctionData(functionFragment: 'referralReward', values?: undefined): string; - encodeFunctionData(functionFragment: 'referralThreshold', values?: undefined): string; + encodeFunctionData(functionFragment: 'purchase', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'purchaseWithNonStable', + values: [string, BigNumberish, string, BigNumberish, BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'purchaseWithStable', + values: [string, BigNumberish, string, BigNumberish], + ): string; encodeFunctionData(functionFragment: 'registry', values?: undefined): string; - encodeFunctionData(functionFragment: 'rewardPointsOf', values: [string]): string; + encodeFunctionData(functionFragment: 'removeSigner', values: [string]): string; encodeFunctionData(functionFragment: 'riskManager', values?: undefined): string; encodeFunctionData( functionFragment: 'safeTransferFrom(address,address,uint256)', @@ -204,145 +190,117 @@ export interface SolaceCoverProductInterface extends utils.Interface { encodeFunctionData(functionFragment: 'setApprovalForAll', values: [string, boolean]): string; encodeFunctionData(functionFragment: 'setBaseURI', values: [string]): string; encodeFunctionData(functionFragment: 'setChargeCycle', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setCooldownPeriod', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setIsReferralOn', values: [boolean]): string; - encodeFunctionData(functionFragment: 'setMaxRateDenom', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setMaxRateNum', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'setChargedTime', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'setMaxRate', values: [BigNumberish, BigNumberish]): string; encodeFunctionData(functionFragment: 'setPaused', values: [boolean]): string; encodeFunctionData(functionFragment: 'setPendingGovernance', values: [string]): string; - encodeFunctionData(functionFragment: 'setReferralReward', values: [BigNumberish]): string; - encodeFunctionData(functionFragment: 'setReferralThreshold', values: [BigNumberish]): string; encodeFunctionData(functionFragment: 'setRegistry', values: [string]): string; - encodeFunctionData(functionFragment: 'setRewardPoints', values: [string, BigNumberish]): string; encodeFunctionData(functionFragment: 'supportsInterface', values: [BytesLike]): string; encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; encodeFunctionData(functionFragment: 'tokenURI', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'updateCoverLimit', values: [BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: 'withdraw', values?: undefined): string; + encodeFunctionData( + functionFragment: 'verifyPremium', + values: [BigNumberish, string, BigNumberish, BytesLike], + ): string; + encodeFunctionData(functionFragment: 'verifyPrice', values: [string, BigNumberish, BigNumberish, BytesLike]): string; decodeFunctionResult(functionFragment: 'acceptGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'accountBalanceOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'activatePolicy', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'activeCoverLimit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addSigner', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'availableCoverCapacity', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'baseURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'cancel', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'cancelPolicies', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'chargeCycle', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'chargePremiums', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'cooldownPeriod', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'cooldownStart', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'coverLimitOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'deactivatePolicy', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'deposit', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'getApproved', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getReferrerFromReferralCode', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getSigner', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'governanceIsLocked', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralCodeUsed', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralCodeValid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isReferralOn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isSigner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'latestChargedTime', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'lockGovernance', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'maxCover', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'maxRateDenom', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'maxRateNum', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'minRequiredAccountBalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'minScpRequired', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'numSigners', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'paused', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'paymentManager', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'pendingGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'policyCount', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'policyOf', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'policyStatus', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'premiumsPaidOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'referralReward', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'referralThreshold', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'purchase', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'purchaseWithNonStable', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'purchaseWithStable', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'registry', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'rewardPointsOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'removeSigner', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'riskManager', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256)', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setBaseURI', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setChargeCycle', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setCooldownPeriod', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setIsReferralOn', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setMaxRateDenom', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setMaxRateNum', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setChargedTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setMaxRate', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setPaused', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setPendingGovernance', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setReferralReward', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setReferralThreshold', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'setRegistry', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setRewardPoints', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'tokenURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'updateCoverLimit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'verifyPremium', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'verifyPrice', data: BytesLike): Result; events: { 'Approval(address,address,uint256)': EventFragment; 'ApprovalForAll(address,address,bool)': EventFragment; 'BaseURISet(string)': EventFragment; 'ChargeCycleSet(uint256)': EventFragment; - 'CooldownPeriodSet(uint256)': EventFragment; - 'CooldownStarted(address,uint256)': EventFragment; - 'CooldownStopped(address)': EventFragment; - 'DepositMade(address,address,uint256)': EventFragment; + 'DebtSet(address,uint256)': EventFragment; 'GovernanceLocked()': EventFragment; 'GovernancePending(address)': EventFragment; 'GovernanceTransferred(address,address)': EventFragment; - 'IsReferralOnSet(bool)': EventFragment; - 'MaxRateDenomSet(uint256)': EventFragment; - 'MaxRateNumSet(uint256)': EventFragment; + 'LatestChargedTimeSet(uint256)': EventFragment; + 'MaxRateSet(uint256,uint256)': EventFragment; 'PauseSet(bool)': EventFragment; + 'PolicyCanceled(uint256)': EventFragment; 'PolicyCreated(uint256)': EventFragment; - 'PolicyDeactivated(uint256)': EventFragment; - 'PolicyManagerUpdated(uint256)': EventFragment; 'PolicyUpdated(uint256)': EventFragment; - 'PremiumCharged(address,uint256)': EventFragment; - 'PremiumPartiallyCharged(address,uint256,uint256)': EventFragment; - 'ReferralRewardSet(uint256)': EventFragment; - 'ReferralRewardsEarned(address,uint256)': EventFragment; - 'ReferralThresholdSet(uint256)': EventFragment; 'RegistrySet(address)': EventFragment; - 'RewardPointsSet(address,uint256)': EventFragment; + 'SignerAdded(address)': EventFragment; + 'SignerRemoved(address)': EventFragment; 'Transfer(address,address,uint256)': EventFragment; - 'WithdrawMade(address,uint256)': EventFragment; }; getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; getEvent(nameOrSignatureOrTopic: 'BaseURISet'): EventFragment; getEvent(nameOrSignatureOrTopic: 'ChargeCycleSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownPeriodSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownStarted'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'CooldownStopped'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'DepositMade'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DebtSet'): EventFragment; getEvent(nameOrSignatureOrTopic: 'GovernanceLocked'): EventFragment; getEvent(nameOrSignatureOrTopic: 'GovernancePending'): EventFragment; getEvent(nameOrSignatureOrTopic: 'GovernanceTransferred'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'IsReferralOnSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'MaxRateDenomSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'MaxRateNumSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LatestChargedTimeSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'MaxRateSet'): EventFragment; getEvent(nameOrSignatureOrTopic: 'PauseSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PolicyCanceled'): EventFragment; getEvent(nameOrSignatureOrTopic: 'PolicyCreated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyDeactivated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PolicyManagerUpdated'): EventFragment; getEvent(nameOrSignatureOrTopic: 'PolicyUpdated'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PremiumCharged'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'PremiumPartiallyCharged'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralRewardSet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralRewardsEarned'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'ReferralThresholdSet'): EventFragment; getEvent(nameOrSignatureOrTopic: 'RegistrySet'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'RewardPointsSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SignerAdded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SignerRemoved'): EventFragment; getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; - getEvent(nameOrSignatureOrTopic: 'WithdrawMade'): EventFragment; } export interface ApprovalEventObject { @@ -377,36 +335,13 @@ export type ChargeCycleSetEvent = TypedEvent<[BigNumber], ChargeCycleSetEventObj export type ChargeCycleSetEventFilter = TypedEventFilter; -export interface CooldownPeriodSetEventObject { - cooldownPeriod: BigNumber; -} -export type CooldownPeriodSetEvent = TypedEvent<[BigNumber], CooldownPeriodSetEventObject>; - -export type CooldownPeriodSetEventFilter = TypedEventFilter; - -export interface CooldownStartedEventObject { - policyholder: string; - startTime: BigNumber; -} -export type CooldownStartedEvent = TypedEvent<[string, BigNumber], CooldownStartedEventObject>; - -export type CooldownStartedEventFilter = TypedEventFilter; - -export interface CooldownStoppedEventObject { +export interface DebtSetEventObject { policyholder: string; + debtAmount: BigNumber; } -export type CooldownStoppedEvent = TypedEvent<[string], CooldownStoppedEventObject>; +export type DebtSetEvent = TypedEvent<[string, BigNumber], DebtSetEventObject>; -export type CooldownStoppedEventFilter = TypedEventFilter; - -export interface DepositMadeEventObject { - from: string; - policyholder: string; - amount: BigNumber; -} -export type DepositMadeEvent = TypedEvent<[string, string, BigNumber], DepositMadeEventObject>; - -export type DepositMadeEventFilter = TypedEventFilter; +export type DebtSetEventFilter = TypedEventFilter; export interface GovernanceLockedEventObject {} export type GovernanceLockedEvent = TypedEvent<[], GovernanceLockedEventObject>; @@ -428,26 +363,20 @@ export type GovernanceTransferredEvent = TypedEvent<[string, string], Governance export type GovernanceTransferredEventFilter = TypedEventFilter; -export interface IsReferralOnSetEventObject { - isReferralOn: boolean; -} -export type IsReferralOnSetEvent = TypedEvent<[boolean], IsReferralOnSetEventObject>; - -export type IsReferralOnSetEventFilter = TypedEventFilter; - -export interface MaxRateDenomSetEventObject { - maxRateDenom: BigNumber; +export interface LatestChargedTimeSetEventObject { + timestamp: BigNumber; } -export type MaxRateDenomSetEvent = TypedEvent<[BigNumber], MaxRateDenomSetEventObject>; +export type LatestChargedTimeSetEvent = TypedEvent<[BigNumber], LatestChargedTimeSetEventObject>; -export type MaxRateDenomSetEventFilter = TypedEventFilter; +export type LatestChargedTimeSetEventFilter = TypedEventFilter; -export interface MaxRateNumSetEventObject { +export interface MaxRateSetEventObject { maxRateNum: BigNumber; + maxRateDenom: BigNumber; } -export type MaxRateNumSetEvent = TypedEvent<[BigNumber], MaxRateNumSetEventObject>; +export type MaxRateSetEvent = TypedEvent<[BigNumber, BigNumber], MaxRateSetEventObject>; -export type MaxRateNumSetEventFilter = TypedEventFilter; +export type MaxRateSetEventFilter = TypedEventFilter; export interface PauseSetEventObject { pause: boolean; @@ -456,26 +385,19 @@ export type PauseSetEvent = TypedEvent<[boolean], PauseSetEventObject>; export type PauseSetEventFilter = TypedEventFilter; -export interface PolicyCreatedEventObject { +export interface PolicyCanceledEventObject { policyID: BigNumber; } -export type PolicyCreatedEvent = TypedEvent<[BigNumber], PolicyCreatedEventObject>; +export type PolicyCanceledEvent = TypedEvent<[BigNumber], PolicyCanceledEventObject>; -export type PolicyCreatedEventFilter = TypedEventFilter; +export type PolicyCanceledEventFilter = TypedEventFilter; -export interface PolicyDeactivatedEventObject { +export interface PolicyCreatedEventObject { policyID: BigNumber; } -export type PolicyDeactivatedEvent = TypedEvent<[BigNumber], PolicyDeactivatedEventObject>; - -export type PolicyDeactivatedEventFilter = TypedEventFilter; - -export interface PolicyManagerUpdatedEventObject { - activeCoverLimit: BigNumber; -} -export type PolicyManagerUpdatedEvent = TypedEvent<[BigNumber], PolicyManagerUpdatedEventObject>; +export type PolicyCreatedEvent = TypedEvent<[BigNumber], PolicyCreatedEventObject>; -export type PolicyManagerUpdatedEventFilter = TypedEventFilter; +export type PolicyCreatedEventFilter = TypedEventFilter; export interface PolicyUpdatedEventObject { policyID: BigNumber; @@ -484,48 +406,6 @@ export type PolicyUpdatedEvent = TypedEvent<[BigNumber], PolicyUpdatedEventObjec export type PolicyUpdatedEventFilter = TypedEventFilter; -export interface PremiumChargedEventObject { - policyholder: string; - amount: BigNumber; -} -export type PremiumChargedEvent = TypedEvent<[string, BigNumber], PremiumChargedEventObject>; - -export type PremiumChargedEventFilter = TypedEventFilter; - -export interface PremiumPartiallyChargedEventObject { - policyholder: string; - actualPremium: BigNumber; - chargedPremium: BigNumber; -} -export type PremiumPartiallyChargedEvent = TypedEvent< - [string, BigNumber, BigNumber], - PremiumPartiallyChargedEventObject ->; - -export type PremiumPartiallyChargedEventFilter = TypedEventFilter; - -export interface ReferralRewardSetEventObject { - referralReward: BigNumber; -} -export type ReferralRewardSetEvent = TypedEvent<[BigNumber], ReferralRewardSetEventObject>; - -export type ReferralRewardSetEventFilter = TypedEventFilter; - -export interface ReferralRewardsEarnedEventObject { - rewardEarner: string; - rewardPointsEarned: BigNumber; -} -export type ReferralRewardsEarnedEvent = TypedEvent<[string, BigNumber], ReferralRewardsEarnedEventObject>; - -export type ReferralRewardsEarnedEventFilter = TypedEventFilter; - -export interface ReferralThresholdSetEventObject { - referralThreshold: BigNumber; -} -export type ReferralThresholdSetEvent = TypedEvent<[BigNumber], ReferralThresholdSetEventObject>; - -export type ReferralThresholdSetEventFilter = TypedEventFilter; - export interface RegistrySetEventObject { registry: string; } @@ -533,13 +413,19 @@ export type RegistrySetEvent = TypedEvent<[string], RegistrySetEventObject>; export type RegistrySetEventFilter = TypedEventFilter; -export interface RewardPointsSetEventObject { - policyholder: string; - amountGifted: BigNumber; +export interface SignerAddedEventObject { + signer: string; } -export type RewardPointsSetEvent = TypedEvent<[string, BigNumber], RewardPointsSetEventObject>; +export type SignerAddedEvent = TypedEvent<[string], SignerAddedEventObject>; -export type RewardPointsSetEventFilter = TypedEventFilter; +export type SignerAddedEventFilter = TypedEventFilter; + +export interface SignerRemovedEventObject { + signer: string; +} +export type SignerRemovedEvent = TypedEvent<[string], SignerRemovedEventObject>; + +export type SignerRemovedEventFilter = TypedEventFilter; export interface TransferEventObject { from: string; @@ -550,20 +436,12 @@ export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEven export type TransferEventFilter = TypedEventFilter; -export interface WithdrawMadeEventObject { - policyholder: string; - amount: BigNumber; -} -export type WithdrawMadeEvent = TypedEvent<[string, BigNumber], WithdrawMadeEventObject>; - -export type WithdrawMadeEventFilter = TypedEventFilter; - -export interface SolaceCoverProduct extends BaseContract { +export interface SolaceCoverProductV3 extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; - interface: SolaceCoverProductInterface; + interface: SolaceCoverProductV3Interface; queryFilter( event: TypedEventFilter, @@ -583,61 +461,44 @@ export interface SolaceCoverProduct extends BaseContract { functions: { acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise<[BigNumber] & { balance: BigNumber }>; + activeCoverLimit(overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, + addSigner( + signer: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; - activeCoverLimit(overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; - approve( to: string, tokenId: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - availableCoverCapacity(overrides?: CallOverrides): Promise<[BigNumber] & { availableCoverCapacity_: BigNumber }>; + availableCoverCapacity(overrides?: CallOverrides): Promise<[BigNumber] & { capacity: BigNumber }>; balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; baseURI(overrides?: CallOverrides): Promise<[string]>; - chargeCycle(overrides?: CallOverrides): Promise<[BigNumber] & { chargeCycle_: BigNumber }>; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], + cancel( + _premium: BigNumberish, + _deadline: BigNumberish, + _signature: BytesLike, overrides?: Overrides & { from?: string | Promise }, ): Promise; - cooldownPeriod(overrides?: CallOverrides): Promise<[BigNumber] & { cooldownPeriod_: BigNumber }>; - - cooldownStart( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { cooldownStart_: BigNumber }>; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, + cancelPolicies( + _policyholders: string[], overrides?: Overrides & { from?: string | Promise }, ): Promise; + chargeCycle(overrides?: CallOverrides): Promise<[BigNumber]>; + + coverLimitOf(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; - getReferrerFromReferralCode( - referralCode: BytesLike, - overrides?: CallOverrides, - ): Promise<[string] & { referrer: string }>; + getSigner(index: BigNumberish, overrides?: CallOverrides): Promise<[string] & { signer: string }>; governance(overrides?: CallOverrides): Promise<[string]>; @@ -645,59 +506,74 @@ export interface SolaceCoverProduct extends BaseContract { isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise<[boolean]>; - isReferralCodeUsed( - policyholder: string, - overrides?: CallOverrides, - ): Promise<[boolean] & { isReferralCodeUsed_: boolean }>; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + isSigner(signer: string, overrides?: CallOverrides): Promise<[boolean]>; - isReferralOn(overrides?: CallOverrides): Promise<[boolean] & { isReferralOn_: boolean }>; + latestChargedTime(overrides?: CallOverrides): Promise<[BigNumber]>; lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; maxCover(overrides?: CallOverrides): Promise<[BigNumber] & { cover: BigNumber }>; - maxRateDenom(overrides?: CallOverrides): Promise<[BigNumber] & { maxRateDenom_: BigNumber }>; + maxRateDenom(overrides?: CallOverrides): Promise<[BigNumber]>; - maxRateNum(overrides?: CallOverrides): Promise<[BigNumber] & { maxRateNum_: BigNumber }>; + maxRateNum(overrides?: CallOverrides): Promise<[BigNumber]>; minRequiredAccountBalance( - coverLimit: BigNumberish, + _coverLimit: BigNumberish, overrides?: CallOverrides, - ): Promise<[BigNumber] & { minRequiredAccountBalance_: BigNumber }>; + ): Promise<[BigNumber] & { mrab: BigNumber }>; + + minScpRequired(_policyholder: string, overrides?: CallOverrides): Promise<[BigNumber] & { amount: BigNumber }>; name(overrides?: CallOverrides): Promise<[string]>; + numSigners(overrides?: CallOverrides): Promise<[BigNumber] & { count: BigNumber }>; + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; - paused(overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; + paused(overrides?: CallOverrides): Promise<[boolean]>; - pendingGovernance(overrides?: CallOverrides): Promise<[string]>; + paymentManager(overrides?: CallOverrides): Promise<[string]>; - policyCount(overrides?: CallOverrides): Promise<[BigNumber] & { count: BigNumber }>; + pendingGovernance(overrides?: CallOverrides): Promise<[string]>; - policyOf(policyholder_: string, overrides?: CallOverrides): Promise<[BigNumber] & { policyID: BigNumber }>; + policyOf(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; + policyStatus(_policyID: BigNumberish, overrides?: CallOverrides): Promise<[boolean] & { status: boolean }>; - premiumsPaidOf( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { premiumsPaid_: BigNumber }>; + purchase( + _user: string, + _coverLimit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralReward(overrides?: CallOverrides): Promise<[BigNumber] & { referralReward_: BigNumber }>; + purchaseWithNonStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + _price: BigNumberish, + _priceDeadline: BigNumberish, + _signature: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralThreshold(overrides?: CallOverrides): Promise<[BigNumber] & { referralThreshold_: BigNumber }>; + purchaseWithStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - registry(overrides?: CallOverrides): Promise<[string] & { registry_: string }>; + registry(overrides?: CallOverrides): Promise<[string]>; - rewardPointsOf( - policyholder_: string, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { rewardPoints_: BigNumber }>; + removeSigner( + signer: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - riskManager(overrides?: CallOverrides): Promise<[string] & { riskManager_: string }>; + riskManager(overrides?: CallOverrides): Promise<[string]>; 'safeTransferFrom(address,address,uint256)'( from: string, @@ -721,37 +597,28 @@ export interface SolaceCoverProduct extends BaseContract { ): Promise; setBaseURI( - baseURI_: string, + _baseURI: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; setChargeCycle( - chargeCycle_: BigNumberish, + _chargeCycle: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setCooldownPeriod( - cooldownPeriod_: BigNumberish, + setChargedTime( + _timestamp: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setIsReferralOn( - isReferralOn_: boolean, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRateDenom( - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRateNum( - maxRateNum_: BigNumberish, + setMaxRate( + _maxRateNum: BigNumberish, + _maxRateDenom: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; setPaused( - paused_: boolean, + _paused: boolean, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -760,24 +627,8 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, + _registry: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -785,7 +636,9 @@ export interface SolaceCoverProduct extends BaseContract { symbol(overrides?: CallOverrides): Promise<[string]>; - tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise<[string] & { tokenURI_: string }>; + tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise<[string] & { uri: string }>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; transferFrom( from: string, @@ -794,29 +647,29 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; + verifyPremium( + premium: BigNumberish, + policyholder: string, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise<[boolean]>; - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; + verifyPrice( + token: string, + price: BigNumberish, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise<[boolean]>; }; acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - activeCoverLimit(overrides?: CallOverrides): Promise; + addSigner(signer: string, overrides?: Overrides & { from?: string | Promise }): Promise; + approve( to: string, tokenId: BigNumberish, @@ -829,31 +682,25 @@ export interface SolaceCoverProduct extends BaseContract { baseURI(overrides?: CallOverrides): Promise; - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], + cancel( + _premium: BigNumberish, + _deadline: BigNumberish, + _signature: BytesLike, overrides?: Overrides & { from?: string | Promise }, ): Promise; - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, + cancelPolicies( + _policyholders: string[], overrides?: Overrides & { from?: string | Promise }, ): Promise; + chargeCycle(overrides?: CallOverrides): Promise; + + coverLimitOf(arg0: BigNumberish, overrides?: CallOverrides): Promise; + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; + getSigner(index: BigNumberish, overrides?: CallOverrides): Promise; governance(overrides?: CallOverrides): Promise; @@ -861,11 +708,9 @@ export interface SolaceCoverProduct extends BaseContract { isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; + isSigner(signer: string, overrides?: CallOverrides): Promise; - isReferralOn(overrides?: CallOverrides): Promise; + latestChargedTime(overrides?: CallOverrides): Promise; lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; @@ -875,31 +720,57 @@ export interface SolaceCoverProduct extends BaseContract { maxRateNum(overrides?: CallOverrides): Promise; - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + minRequiredAccountBalance(_coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + + minScpRequired(_policyholder: string, overrides?: CallOverrides): Promise; name(overrides?: CallOverrides): Promise; + numSigners(overrides?: CallOverrides): Promise; + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; paused(overrides?: CallOverrides): Promise; - pendingGovernance(overrides?: CallOverrides): Promise; + paymentManager(overrides?: CallOverrides): Promise; - policyCount(overrides?: CallOverrides): Promise; + pendingGovernance(overrides?: CallOverrides): Promise; - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; + policyOf(arg0: string, overrides?: CallOverrides): Promise; - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; + policyStatus(_policyID: BigNumberish, overrides?: CallOverrides): Promise; - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; + purchase( + _user: string, + _coverLimit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralReward(overrides?: CallOverrides): Promise; + purchaseWithNonStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + _price: BigNumberish, + _priceDeadline: BigNumberish, + _signature: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralThreshold(overrides?: CallOverrides): Promise; + purchaseWithStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; registry(overrides?: CallOverrides): Promise; - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; + removeSigner( + signer: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; riskManager(overrides?: CallOverrides): Promise; @@ -925,37 +796,28 @@ export interface SolaceCoverProduct extends BaseContract { ): Promise; setBaseURI( - baseURI_: string, + _baseURI: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setIsReferralOn( - isReferralOn_: boolean, + _chargeCycle: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setMaxRateDenom( - maxRateDenom_: BigNumberish, + setChargedTime( + _timestamp: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setMaxRateNum( - maxRateNum_: BigNumberish, + setMaxRate( + _maxRateNum: BigNumberish, + _maxRateDenom: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; setPaused( - paused_: boolean, + _paused: boolean, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -964,24 +826,8 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, + _registry: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -991,6 +837,8 @@ export interface SolaceCoverProduct extends BaseContract { tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; + totalSupply(overrides?: CallOverrides): Promise; + transferFrom( from: string, to: string, @@ -998,29 +846,29 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; + verifyPremium( + premium: BigNumberish, + policyholder: string, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; + + verifyPrice( + token: string, + price: BigNumberish, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; callStatic: { acceptGovernance(overrides?: CallOverrides): Promise; - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - overrides?: CallOverrides, - ): Promise; - activeCoverLimit(overrides?: CallOverrides): Promise; + addSigner(signer: string, overrides?: CallOverrides): Promise; + approve(to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; availableCoverCapacity(overrides?: CallOverrides): Promise; @@ -1029,23 +877,22 @@ export interface SolaceCoverProduct extends BaseContract { baseURI(overrides?: CallOverrides): Promise; - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums(holders: string[], premiums: BigNumberish[], overrides?: CallOverrides): Promise; - - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; + cancel( + _premium: BigNumberish, + _deadline: BigNumberish, + _signature: BytesLike, + overrides?: CallOverrides, + ): Promise; - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; + cancelPolicies(_policyholders: string[], overrides?: CallOverrides): Promise; - deactivatePolicy(overrides?: CallOverrides): Promise; + chargeCycle(overrides?: CallOverrides): Promise; - deposit(policyholder: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + coverLimitOf(arg0: BigNumberish, overrides?: CallOverrides): Promise; getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; + getSigner(index: BigNumberish, overrides?: CallOverrides): Promise; governance(overrides?: CallOverrides): Promise; @@ -1053,11 +900,9 @@ export interface SolaceCoverProduct extends BaseContract { isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; + isSigner(signer: string, overrides?: CallOverrides): Promise; - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; + latestChargedTime(overrides?: CallOverrides): Promise; lockGovernance(overrides?: CallOverrides): Promise; @@ -1067,31 +912,50 @@ export interface SolaceCoverProduct extends BaseContract { maxRateNum(overrides?: CallOverrides): Promise; - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + minRequiredAccountBalance(_coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + + minScpRequired(_policyholder: string, overrides?: CallOverrides): Promise; name(overrides?: CallOverrides): Promise; + numSigners(overrides?: CallOverrides): Promise; + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; paused(overrides?: CallOverrides): Promise; - pendingGovernance(overrides?: CallOverrides): Promise; + paymentManager(overrides?: CallOverrides): Promise; - policyCount(overrides?: CallOverrides): Promise; + pendingGovernance(overrides?: CallOverrides): Promise; - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; + policyOf(arg0: string, overrides?: CallOverrides): Promise; - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; + policyStatus(_policyID: BigNumberish, overrides?: CallOverrides): Promise; - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; + purchase(_user: string, _coverLimit: BigNumberish, overrides?: CallOverrides): Promise; - referralReward(overrides?: CallOverrides): Promise; + purchaseWithNonStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + _price: BigNumberish, + _priceDeadline: BigNumberish, + _signature: BytesLike, + overrides?: CallOverrides, + ): Promise; - referralThreshold(overrides?: CallOverrides): Promise; + purchaseWithStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; registry(overrides?: CallOverrides): Promise; - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; + removeSigner(signer: string, overrides?: CallOverrides): Promise; riskManager(overrides?: CallOverrides): Promise; @@ -1112,29 +976,19 @@ export interface SolaceCoverProduct extends BaseContract { setApprovalForAll(operator: string, approved: boolean, overrides?: CallOverrides): Promise; - setBaseURI(baseURI_: string, overrides?: CallOverrides): Promise; - - setChargeCycle(chargeCycle_: BigNumberish, overrides?: CallOverrides): Promise; - - setCooldownPeriod(cooldownPeriod_: BigNumberish, overrides?: CallOverrides): Promise; + setBaseURI(_baseURI: string, overrides?: CallOverrides): Promise; - setIsReferralOn(isReferralOn_: boolean, overrides?: CallOverrides): Promise; + setChargeCycle(_chargeCycle: BigNumberish, overrides?: CallOverrides): Promise; - setMaxRateDenom(maxRateDenom_: BigNumberish, overrides?: CallOverrides): Promise; + setChargedTime(_timestamp: BigNumberish, overrides?: CallOverrides): Promise; - setMaxRateNum(maxRateNum_: BigNumberish, overrides?: CallOverrides): Promise; + setMaxRate(_maxRateNum: BigNumberish, _maxRateDenom: BigNumberish, overrides?: CallOverrides): Promise; - setPaused(paused_: boolean, overrides?: CallOverrides): Promise; + setPaused(_paused: boolean, overrides?: CallOverrides): Promise; setPendingGovernance(pendingGovernance_: string, overrides?: CallOverrides): Promise; - setReferralReward(referralReward_: BigNumberish, overrides?: CallOverrides): Promise; - - setReferralThreshold(referralThreshhold_: BigNumberish, overrides?: CallOverrides): Promise; - - setRegistry(registry_: string, overrides?: CallOverrides): Promise; - - setRewardPoints(policyholder_: string, rewardPoints_: BigNumberish, overrides?: CallOverrides): Promise; + setRegistry(_registry: string, overrides?: CallOverrides): Promise; supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; @@ -1142,11 +996,25 @@ export interface SolaceCoverProduct extends BaseContract { tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; + totalSupply(overrides?: CallOverrides): Promise; + transferFrom(from: string, to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; - updateCoverLimit(newCoverLimit_: BigNumberish, referralCode_: BytesLike, overrides?: CallOverrides): Promise; + verifyPremium( + premium: BigNumberish, + policyholder: string, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; - withdraw(overrides?: CallOverrides): Promise; + verifyPrice( + token: string, + price: BigNumberish, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; }; filters: { @@ -1170,17 +1038,8 @@ export interface SolaceCoverProduct extends BaseContract { 'ChargeCycleSet(uint256)'(chargeCycle?: null): ChargeCycleSetEventFilter; ChargeCycleSet(chargeCycle?: null): ChargeCycleSetEventFilter; - 'CooldownPeriodSet(uint256)'(cooldownPeriod?: null): CooldownPeriodSetEventFilter; - CooldownPeriodSet(cooldownPeriod?: null): CooldownPeriodSetEventFilter; - - 'CooldownStarted(address,uint256)'(policyholder?: null, startTime?: null): CooldownStartedEventFilter; - CooldownStarted(policyholder?: null, startTime?: null): CooldownStartedEventFilter; - - 'CooldownStopped(address)'(policyholder?: null): CooldownStoppedEventFilter; - CooldownStopped(policyholder?: null): CooldownStoppedEventFilter; - - 'DepositMade(address,address,uint256)'(from?: null, policyholder?: null, amount?: null): DepositMadeEventFilter; - DepositMade(from?: null, policyholder?: null, amount?: null): DepositMadeEventFilter; + 'DebtSet(address,uint256)'(policyholder?: null, debtAmount?: null): DebtSetEventFilter; + DebtSet(policyholder?: null, debtAmount?: null): DebtSetEventFilter; 'GovernanceLocked()'(): GovernanceLockedEventFilter; GovernanceLocked(): GovernanceLockedEventFilter; @@ -1194,61 +1053,32 @@ export interface SolaceCoverProduct extends BaseContract { ): GovernanceTransferredEventFilter; GovernanceTransferred(oldGovernance?: null, newGovernance?: null): GovernanceTransferredEventFilter; - 'IsReferralOnSet(bool)'(isReferralOn?: null): IsReferralOnSetEventFilter; - IsReferralOnSet(isReferralOn?: null): IsReferralOnSetEventFilter; - - 'MaxRateDenomSet(uint256)'(maxRateDenom?: null): MaxRateDenomSetEventFilter; - MaxRateDenomSet(maxRateDenom?: null): MaxRateDenomSetEventFilter; + 'LatestChargedTimeSet(uint256)'(timestamp?: null): LatestChargedTimeSetEventFilter; + LatestChargedTimeSet(timestamp?: null): LatestChargedTimeSetEventFilter; - 'MaxRateNumSet(uint256)'(maxRateNum?: null): MaxRateNumSetEventFilter; - MaxRateNumSet(maxRateNum?: null): MaxRateNumSetEventFilter; + 'MaxRateSet(uint256,uint256)'(maxRateNum?: null, maxRateDenom?: null): MaxRateSetEventFilter; + MaxRateSet(maxRateNum?: null, maxRateDenom?: null): MaxRateSetEventFilter; 'PauseSet(bool)'(pause?: null): PauseSetEventFilter; PauseSet(pause?: null): PauseSetEventFilter; + 'PolicyCanceled(uint256)'(policyID?: null): PolicyCanceledEventFilter; + PolicyCanceled(policyID?: null): PolicyCanceledEventFilter; + 'PolicyCreated(uint256)'(policyID?: null): PolicyCreatedEventFilter; PolicyCreated(policyID?: null): PolicyCreatedEventFilter; - 'PolicyDeactivated(uint256)'(policyID?: null): PolicyDeactivatedEventFilter; - PolicyDeactivated(policyID?: null): PolicyDeactivatedEventFilter; - - 'PolicyManagerUpdated(uint256)'(activeCoverLimit?: null): PolicyManagerUpdatedEventFilter; - PolicyManagerUpdated(activeCoverLimit?: null): PolicyManagerUpdatedEventFilter; - 'PolicyUpdated(uint256)'(policyID?: null): PolicyUpdatedEventFilter; PolicyUpdated(policyID?: null): PolicyUpdatedEventFilter; - 'PremiumCharged(address,uint256)'(policyholder?: null, amount?: null): PremiumChargedEventFilter; - PremiumCharged(policyholder?: null, amount?: null): PremiumChargedEventFilter; - - 'PremiumPartiallyCharged(address,uint256,uint256)'( - policyholder?: null, - actualPremium?: null, - chargedPremium?: null, - ): PremiumPartiallyChargedEventFilter; - PremiumPartiallyCharged( - policyholder?: null, - actualPremium?: null, - chargedPremium?: null, - ): PremiumPartiallyChargedEventFilter; - - 'ReferralRewardSet(uint256)'(referralReward?: null): ReferralRewardSetEventFilter; - ReferralRewardSet(referralReward?: null): ReferralRewardSetEventFilter; - - 'ReferralRewardsEarned(address,uint256)'( - rewardEarner?: null, - rewardPointsEarned?: null, - ): ReferralRewardsEarnedEventFilter; - ReferralRewardsEarned(rewardEarner?: null, rewardPointsEarned?: null): ReferralRewardsEarnedEventFilter; - - 'ReferralThresholdSet(uint256)'(referralThreshold?: null): ReferralThresholdSetEventFilter; - ReferralThresholdSet(referralThreshold?: null): ReferralThresholdSetEventFilter; - 'RegistrySet(address)'(registry?: null): RegistrySetEventFilter; RegistrySet(registry?: null): RegistrySetEventFilter; - 'RewardPointsSet(address,uint256)'(policyholder?: null, amountGifted?: null): RewardPointsSetEventFilter; - RewardPointsSet(policyholder?: null, amountGifted?: null): RewardPointsSetEventFilter; + 'SignerAdded(address)'(signer?: null): SignerAddedEventFilter; + SignerAdded(signer?: null): SignerAddedEventFilter; + + 'SignerRemoved(address)'(signer?: null): SignerRemovedEventFilter; + SignerRemoved(signer?: null): SignerRemovedEventFilter; 'Transfer(address,address,uint256)'( from?: string | null, @@ -1256,26 +1086,15 @@ export interface SolaceCoverProduct extends BaseContract { tokenId?: BigNumberish | null, ): TransferEventFilter; Transfer(from?: string | null, to?: string | null, tokenId?: BigNumberish | null): TransferEventFilter; - - 'WithdrawMade(address,uint256)'(policyholder?: null, amount?: null): WithdrawMadeEventFilter; - WithdrawMade(policyholder?: null, amount?: null): WithdrawMadeEventFilter; }; estimateGas: { acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; - - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - activeCoverLimit(overrides?: CallOverrides): Promise; + addSigner(signer: string, overrides?: Overrides & { from?: string | Promise }): Promise; + approve( to: string, tokenId: BigNumberish, @@ -1288,31 +1107,25 @@ export interface SolaceCoverProduct extends BaseContract { baseURI(overrides?: CallOverrides): Promise; - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], + cancel( + _premium: BigNumberish, + _deadline: BigNumberish, + _signature: BytesLike, overrides?: Overrides & { from?: string | Promise }, ): Promise; - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, + cancelPolicies( + _policyholders: string[], overrides?: Overrides & { from?: string | Promise }, ): Promise; + chargeCycle(overrides?: CallOverrides): Promise; + + coverLimitOf(arg0: BigNumberish, overrides?: CallOverrides): Promise; + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; + getSigner(index: BigNumberish, overrides?: CallOverrides): Promise; governance(overrides?: CallOverrides): Promise; @@ -1320,11 +1133,9 @@ export interface SolaceCoverProduct extends BaseContract { isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; - - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; + isSigner(signer: string, overrides?: CallOverrides): Promise; - isReferralOn(overrides?: CallOverrides): Promise; + latestChargedTime(overrides?: CallOverrides): Promise; lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; @@ -1334,31 +1145,54 @@ export interface SolaceCoverProduct extends BaseContract { maxRateNum(overrides?: CallOverrides): Promise; - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + minRequiredAccountBalance(_coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + + minScpRequired(_policyholder: string, overrides?: CallOverrides): Promise; name(overrides?: CallOverrides): Promise; + numSigners(overrides?: CallOverrides): Promise; + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; paused(overrides?: CallOverrides): Promise; - pendingGovernance(overrides?: CallOverrides): Promise; + paymentManager(overrides?: CallOverrides): Promise; - policyCount(overrides?: CallOverrides): Promise; + pendingGovernance(overrides?: CallOverrides): Promise; - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; + policyOf(arg0: string, overrides?: CallOverrides): Promise; - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; + policyStatus(_policyID: BigNumberish, overrides?: CallOverrides): Promise; - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; + purchase( + _user: string, + _coverLimit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralReward(overrides?: CallOverrides): Promise; + purchaseWithNonStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + _price: BigNumberish, + _priceDeadline: BigNumberish, + _signature: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralThreshold(overrides?: CallOverrides): Promise; + purchaseWithStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; registry(overrides?: CallOverrides): Promise; - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; + removeSigner(signer: string, overrides?: Overrides & { from?: string | Promise }): Promise; riskManager(overrides?: CallOverrides): Promise; @@ -1383,57 +1217,32 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - setBaseURI(baseURI_: string, overrides?: Overrides & { from?: string | Promise }): Promise; + setBaseURI(_baseURI: string, overrides?: Overrides & { from?: string | Promise }): Promise; setChargeCycle( - chargeCycle_: BigNumberish, + _chargeCycle: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setCooldownPeriod( - cooldownPeriod_: BigNumberish, + setChargedTime( + _timestamp: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setIsReferralOn( - isReferralOn_: boolean, + setMaxRate( + _maxRateNum: BigNumberish, + _maxRateDenom: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setMaxRateDenom( - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRateNum( - maxRateNum_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setPaused(paused_: boolean, overrides?: Overrides & { from?: string | Promise }): Promise; + setPaused(_paused: boolean, overrides?: Overrides & { from?: string | Promise }): Promise; setPendingGovernance( pendingGovernance_: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRegistry(registry_: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; + setRegistry(_registry: string, overrides?: Overrides & { from?: string | Promise }): Promise; supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; @@ -1441,6 +1250,8 @@ export interface SolaceCoverProduct extends BaseContract { tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; + totalSupply(overrides?: CallOverrides): Promise; + transferFrom( from: string, to: string, @@ -1448,30 +1259,33 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + verifyPremium( + premium: BigNumberish, + policyholder: string, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, ): Promise; - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; + verifyPrice( + token: string, + price: BigNumberish, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; }; populateTransaction: { acceptGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; - accountBalanceOf(policyholder: string, overrides?: CallOverrides): Promise; + activeCoverLimit(overrides?: CallOverrides): Promise; - activatePolicy( - policyholder_: string, - coverLimit_: BigNumberish, - amount_: BigNumberish, - referralCode_: BytesLike, + addSigner( + signer: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; - activeCoverLimit(overrides?: CallOverrides): Promise; - approve( to: string, tokenId: BigNumberish, @@ -1484,31 +1298,25 @@ export interface SolaceCoverProduct extends BaseContract { baseURI(overrides?: CallOverrides): Promise; - chargeCycle(overrides?: CallOverrides): Promise; - - chargePremiums( - holders: string[], - premiums: BigNumberish[], + cancel( + _premium: BigNumberish, + _deadline: BigNumberish, + _signature: BytesLike, overrides?: Overrides & { from?: string | Promise }, ): Promise; - cooldownPeriod(overrides?: CallOverrides): Promise; - - cooldownStart(policyholder_: string, overrides?: CallOverrides): Promise; - - coverLimitOf(policyID_: BigNumberish, overrides?: CallOverrides): Promise; - - deactivatePolicy(overrides?: Overrides & { from?: string | Promise }): Promise; - - deposit( - policyholder: string, - amount: BigNumberish, + cancelPolicies( + _policyholders: string[], overrides?: Overrides & { from?: string | Promise }, ): Promise; + chargeCycle(overrides?: CallOverrides): Promise; + + coverLimitOf(arg0: BigNumberish, overrides?: CallOverrides): Promise; + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; - getReferrerFromReferralCode(referralCode: BytesLike, overrides?: CallOverrides): Promise; + getSigner(index: BigNumberish, overrides?: CallOverrides): Promise; governance(overrides?: CallOverrides): Promise; @@ -1516,11 +1324,9 @@ export interface SolaceCoverProduct extends BaseContract { isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; - isReferralCodeUsed(policyholder: string, overrides?: CallOverrides): Promise; + isSigner(signer: string, overrides?: CallOverrides): Promise; - isReferralCodeValid(referralCode: BytesLike, overrides?: CallOverrides): Promise; - - isReferralOn(overrides?: CallOverrides): Promise; + latestChargedTime(overrides?: CallOverrides): Promise; lockGovernance(overrides?: Overrides & { from?: string | Promise }): Promise; @@ -1530,31 +1336,57 @@ export interface SolaceCoverProduct extends BaseContract { maxRateNum(overrides?: CallOverrides): Promise; - minRequiredAccountBalance(coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + minRequiredAccountBalance(_coverLimit: BigNumberish, overrides?: CallOverrides): Promise; + + minScpRequired(_policyholder: string, overrides?: CallOverrides): Promise; name(overrides?: CallOverrides): Promise; + numSigners(overrides?: CallOverrides): Promise; + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; paused(overrides?: CallOverrides): Promise; - pendingGovernance(overrides?: CallOverrides): Promise; + paymentManager(overrides?: CallOverrides): Promise; - policyCount(overrides?: CallOverrides): Promise; + pendingGovernance(overrides?: CallOverrides): Promise; - policyOf(policyholder_: string, overrides?: CallOverrides): Promise; + policyOf(arg0: string, overrides?: CallOverrides): Promise; - policyStatus(policyID_: BigNumberish, overrides?: CallOverrides): Promise; + policyStatus(_policyID: BigNumberish, overrides?: CallOverrides): Promise; - premiumsPaidOf(policyholder_: string, overrides?: CallOverrides): Promise; + purchase( + _user: string, + _coverLimit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralReward(overrides?: CallOverrides): Promise; + purchaseWithNonStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + _price: BigNumberish, + _priceDeadline: BigNumberish, + _signature: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; - referralThreshold(overrides?: CallOverrides): Promise; + purchaseWithStable( + _user: string, + _coverLimit: BigNumberish, + _token: string, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; registry(overrides?: CallOverrides): Promise; - rewardPointsOf(policyholder_: string, overrides?: CallOverrides): Promise; + removeSigner( + signer: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; riskManager(overrides?: CallOverrides): Promise; @@ -1580,37 +1412,28 @@ export interface SolaceCoverProduct extends BaseContract { ): Promise; setBaseURI( - baseURI_: string, + _baseURI: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; setChargeCycle( - chargeCycle_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setCooldownPeriod( - cooldownPeriod_: BigNumberish, + _chargeCycle: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setIsReferralOn( - isReferralOn_: boolean, + setChargedTime( + _timestamp: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; - setMaxRateDenom( - maxRateDenom_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setMaxRateNum( - maxRateNum_: BigNumberish, + setMaxRate( + _maxRateNum: BigNumberish, + _maxRateDenom: BigNumberish, overrides?: Overrides & { from?: string | Promise }, ): Promise; setPaused( - paused_: boolean, + _paused: boolean, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -1619,24 +1442,8 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - setReferralReward( - referralReward_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setReferralThreshold( - referralThreshhold_: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - setRegistry( - registry_: string, - overrides?: Overrides & { from?: string | Promise }, - ): Promise; - - setRewardPoints( - policyholder_: string, - rewardPoints_: BigNumberish, + _registry: string, overrides?: Overrides & { from?: string | Promise }, ): Promise; @@ -1646,6 +1453,8 @@ export interface SolaceCoverProduct extends BaseContract { tokenURI(policyID: BigNumberish, overrides?: CallOverrides): Promise; + totalSupply(overrides?: CallOverrides): Promise; + transferFrom( from: string, to: string, @@ -1653,12 +1462,20 @@ export interface SolaceCoverProduct extends BaseContract { overrides?: Overrides & { from?: string | Promise }, ): Promise; - updateCoverLimit( - newCoverLimit_: BigNumberish, - referralCode_: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + verifyPremium( + premium: BigNumberish, + policyholder: string, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, ): Promise; - withdraw(overrides?: Overrides & { from?: string | Promise }): Promise; + verifyPrice( + token: string, + price: BigNumberish, + deadline: BigNumberish, + signature: BytesLike, + overrides?: CallOverrides, + ): Promise; }; } diff --git a/src/apps/solace/contracts/ethers/factories/SolaceCoverProductV2__factory.ts b/src/apps/solace/contracts/ethers/factories/SolaceCoverProductV2__factory.ts deleted file mode 100644 index d6f437d5e..000000000 --- a/src/apps/solace/contracts/ethers/factories/SolaceCoverProductV2__factory.ts +++ /dev/null @@ -1,1635 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import type { SolaceCoverProductV2, SolaceCoverProductV2Interface } from '../SolaceCoverProductV2'; - -const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'governance_', - type: 'address', - }, - { - internalType: 'address', - name: 'registry_', - type: 'address', - }, - { - internalType: 'string', - name: 'asset_', - type: 'string', - }, - { - internalType: 'string', - name: 'domain_', - type: 'string', - }, - { - internalType: 'string', - name: 'version_', - type: 'string', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'approved', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'operator', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'approved', - type: 'bool', - }, - ], - name: 'ApprovalForAll', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'string', - name: 'asset', - type: 'string', - }, - ], - name: 'AssetSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'string', - name: 'baseURI', - type: 'string', - }, - ], - name: 'BaseURISet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'chargeCycle', - type: 'uint256', - }, - ], - name: 'ChargeCycleSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'cooldownPeriod', - type: 'uint256', - }, - ], - name: 'CooldownPeriodSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'startTime', - type: 'uint256', - }, - ], - name: 'CooldownStarted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - ], - name: 'CooldownStopped', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'DepositMade', - type: 'event', - }, - { - anonymous: false, - inputs: [], - name: 'GovernanceLocked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'pendingGovernance', - type: 'address', - }, - ], - name: 'GovernancePending', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldGovernance', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newGovernance', - type: 'address', - }, - ], - name: 'GovernanceTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isReferralOn', - type: 'bool', - }, - ], - name: 'IsReferralOnSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'maxRateNum', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'maxRateDenom', - type: 'uint256', - }, - ], - name: 'MaxRateSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'pause', - type: 'bool', - }, - ], - name: 'PauseSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - name: 'PolicyCreated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - name: 'PolicyDeactivated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'activeCoverLimit', - type: 'uint256', - }, - ], - name: 'PolicyManagerUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - name: 'PolicyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'PremiumCharged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'actualPremium', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'chargedPremium', - type: 'uint256', - }, - ], - name: 'PremiumPartiallyCharged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'referralReward', - type: 'uint256', - }, - ], - name: 'ReferralRewardSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'rewardEarner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rewardPointsEarned', - type: 'uint256', - }, - ], - name: 'ReferralRewardsEarned', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'referralThreshold', - type: 'uint256', - }, - ], - name: 'ReferralThresholdSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'registry', - type: 'address', - }, - ], - name: 'RegistrySet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountGifted', - type: 'uint256', - }, - ], - name: 'RewardPointsSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - ], - name: 'SupportedChainRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - ], - name: 'SupportedChainSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'WithdrawMade', - type: 'event', - }, - { - inputs: [], - name: 'acceptGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - ], - name: 'accountBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: 'balance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'coverLimit_', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'referralCode_', - type: 'bytes', - }, - { - internalType: 'uint256[]', - name: 'chains_', - type: 'uint256[]', - }, - ], - name: 'activatePolicy', - outputs: [ - { - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'activeCoverLimit', - outputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: 'supportedChains', - type: 'uint256[]', - }, - ], - name: 'addSupportedChains', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'asset', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'availableCoverCapacity', - outputs: [ - { - internalType: 'uint256', - name: 'availableCoverCapacity_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'baseURI', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'chargeCycle', - outputs: [ - { - internalType: 'uint256', - name: 'chargeCycle_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'holders', - type: 'address[]', - }, - { - internalType: 'uint256[]', - name: 'premiums', - type: 'uint256[]', - }, - ], - name: 'chargePremiums', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'cooldownPeriod', - outputs: [ - { - internalType: 'uint256', - name: 'cooldownPeriod_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - ], - name: 'cooldownStart', - outputs: [ - { - internalType: 'uint256', - name: 'cooldownStart_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'policyID_', - type: 'uint256', - }, - ], - name: 'coverLimitOf', - outputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'deactivatePolicy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'deposit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'getApproved', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chainIndex', - type: 'uint256', - }, - ], - name: 'getChain', - outputs: [ - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - name: 'getPolicyChainInfo', - outputs: [ - { - internalType: 'uint256[]', - name: 'policyChains', - type: 'uint256[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'referralCode', - type: 'bytes', - }, - ], - name: 'getReferrerFromReferralCode', - outputs: [ - { - internalType: 'address', - name: 'referrer', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'governance', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'governanceIsLocked', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'operator', - type: 'address', - }, - ], - name: 'isApprovedForAll', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - ], - name: 'isReferralCodeUsed', - outputs: [ - { - internalType: 'bool', - name: 'isReferralCodeUsed_', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'referralCode', - type: 'bytes', - }, - ], - name: 'isReferralCodeValid', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isReferralOn', - outputs: [ - { - internalType: 'bool', - name: 'isReferralOn_', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - ], - name: 'isSupportedChain', - outputs: [ - { - internalType: 'bool', - name: 'status', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lockGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'maxCover', - outputs: [ - { - internalType: 'uint256', - name: 'cover', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxRate', - outputs: [ - { - internalType: 'uint256', - name: 'maxRateNum_', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxRateDenom_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'coverLimit', - type: 'uint256', - }, - ], - name: 'minRequiredAccountBalance', - outputs: [ - { - internalType: 'uint256', - name: 'minRequiredAccountBalance_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'numSupportedChains', - outputs: [ - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'ownerOf', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'paused', - outputs: [ - { - internalType: 'bool', - name: 'status', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pendingGovernance', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'policyCount', - outputs: [ - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - ], - name: 'policyOf', - outputs: [ - { - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'policyID_', - type: 'uint256', - }, - ], - name: 'policyStatus', - outputs: [ - { - internalType: 'bool', - name: 'status', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - ], - name: 'premiumsPaidOf', - outputs: [ - { - internalType: 'uint256', - name: 'premiumsPaid_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'referralReward', - outputs: [ - { - internalType: 'uint256', - name: 'referralReward_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'referralThreshold', - outputs: [ - { - internalType: 'uint256', - name: 'referralThreshold_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'registry', - outputs: [ - { - internalType: 'address', - name: 'registry_', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - ], - name: 'removeSupportedChain', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - ], - name: 'rewardPointsOf', - outputs: [ - { - internalType: 'uint256', - name: 'rewardPoints_', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'riskManager', - outputs: [ - { - internalType: 'address', - name: 'riskManager_', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'safeTransferFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'bytes', - name: '_data', - type: 'bytes', - }, - ], - 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: 'assetName', - type: 'string', - }, - ], - name: 'setAsset', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: 'baseURI_', - type: 'string', - }, - ], - name: 'setBaseURI', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chargeCycle_', - type: 'uint256', - }, - ], - name: 'setChargeCycle', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'cooldownPeriod_', - type: 'uint256', - }, - ], - name: 'setCooldownPeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'isReferralOn_', - type: 'bool', - }, - ], - name: 'setIsReferralOn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'maxRateNum_', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxRateDenom_', - type: 'uint256', - }, - ], - name: 'setMaxRate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'paused_', - type: 'bool', - }, - ], - name: 'setPaused', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pendingGovernance_', - type: 'address', - }, - ], - name: 'setPendingGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'referralReward_', - type: 'uint256', - }, - ], - name: 'setReferralReward', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'referralThreshhold_', - type: 'uint256', - }, - ], - name: 'setReferralThreshold', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'registry_', - type: 'address', - }, - ], - name: 'setRegistry', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'rewardPoints_', - type: 'uint256', - }, - ], - name: 'setRewardPoints', - 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: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, - ], - name: 'tokenURI', - outputs: [ - { - internalType: 'string', - name: 'tokenURI_', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newCoverLimit_', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'referralCode_', - type: 'bytes', - }, - ], - name: 'updateCoverLimit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: 'policyChains', - type: 'uint256[]', - }, - ], - name: 'updatePolicyChainInfo', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -]; - -export class SolaceCoverProductV2__factory { - static readonly abi = _abi; - static createInterface(): SolaceCoverProductV2Interface { - return new utils.Interface(_abi) as SolaceCoverProductV2Interface; - } - static connect(address: string, signerOrProvider: Signer | Provider): SolaceCoverProductV2 { - return new Contract(address, _abi, signerOrProvider) as SolaceCoverProductV2; - } -} diff --git a/src/apps/solace/contracts/ethers/factories/SolaceCoverProduct__factory.ts b/src/apps/solace/contracts/ethers/factories/SolaceCoverProductV3__factory.ts similarity index 75% rename from src/apps/solace/contracts/ethers/factories/SolaceCoverProduct__factory.ts rename to src/apps/solace/contracts/ethers/factories/SolaceCoverProductV3__factory.ts index 7f6547048..026b9b0ac 100644 --- a/src/apps/solace/contracts/ethers/factories/SolaceCoverProduct__factory.ts +++ b/src/apps/solace/contracts/ethers/factories/SolaceCoverProductV3__factory.ts @@ -4,31 +4,21 @@ import { Contract, Signer, utils } from 'ethers'; import type { Provider } from '@ethersproject/providers'; -import type { SolaceCoverProduct, SolaceCoverProductInterface } from '../SolaceCoverProduct'; +import type { SolaceCoverProductV3, SolaceCoverProductV3Interface } from '../SolaceCoverProductV3'; const _abi = [ { inputs: [ { internalType: 'address', - name: 'governance_', + name: '_governance', type: 'address', }, { internalType: 'address', - name: 'registry_', + name: '_registry', type: 'address', }, - { - internalType: 'string', - name: 'domain_', - type: 'string', - }, - { - internalType: 'string', - name: 'version_', - type: 'string', - }, ], stateMutability: 'nonpayable', type: 'constructor', @@ -109,19 +99,6 @@ const _abi = [ name: 'ChargeCycleSet', type: 'event', }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'cooldownPeriod', - type: 'uint256', - }, - ], - name: 'CooldownPeriodSet', - type: 'event', - }, { anonymous: false, inputs: [ @@ -134,49 +111,11 @@ const _abi = [ { indexed: false, internalType: 'uint256', - name: 'startTime', + name: 'debtAmount', type: 'uint256', }, ], - name: 'CooldownStarted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - ], - name: 'CooldownStopped', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'DepositMade', + name: 'DebtSet', type: 'event', }, { @@ -222,12 +161,12 @@ const _abi = [ inputs: [ { indexed: false, - internalType: 'bool', - name: 'isReferralOn', - type: 'bool', + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', }, ], - name: 'IsReferralOnSet', + name: 'LatestChargedTimeSet', type: 'event', }, { @@ -236,24 +175,17 @@ const _abi = [ { indexed: false, internalType: 'uint256', - name: 'maxRateDenom', + name: 'maxRateNum', type: 'uint256', }, - ], - name: 'MaxRateDenomSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ { indexed: false, internalType: 'uint256', - name: 'maxRateNum', + name: 'maxRateDenom', type: 'uint256', }, ], - name: 'MaxRateNumSet', + name: 'MaxRateSet', type: 'event', }, { @@ -279,7 +211,7 @@ const _abi = [ type: 'uint256', }, ], - name: 'PolicyCreated', + name: 'PolicyCanceled', type: 'event', }, { @@ -292,20 +224,7 @@ const _abi = [ type: 'uint256', }, ], - name: 'PolicyDeactivated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'activeCoverLimit', - type: 'uint256', - }, - ], - name: 'PolicyManagerUpdated', + name: 'PolicyCreated', type: 'event', }, { @@ -327,87 +246,11 @@ const _abi = [ { indexed: false, internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'PremiumCharged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'actualPremium', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'chargedPremium', - type: 'uint256', - }, - ], - name: 'PremiumPartiallyCharged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'referralReward', - type: 'uint256', - }, - ], - name: 'ReferralRewardSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'rewardEarner', + name: 'registry', type: 'address', }, - { - indexed: false, - internalType: 'uint256', - name: 'rewardPointsEarned', - type: 'uint256', - }, - ], - name: 'ReferralRewardsEarned', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'referralThreshold', - type: 'uint256', - }, ], - name: 'ReferralThresholdSet', + name: 'RegistrySet', type: 'event', }, { @@ -416,11 +259,11 @@ const _abi = [ { indexed: false, internalType: 'address', - name: 'registry', + name: 'signer', type: 'address', }, ], - name: 'RegistrySet', + name: 'SignerAdded', type: 'event', }, { @@ -429,17 +272,11 @@ const _abi = [ { indexed: false, internalType: 'address', - name: 'policyholder', + name: 'signer', type: 'address', }, - { - indexed: false, - internalType: 'uint256', - name: 'amountGifted', - type: 'uint256', - }, ], - name: 'RewardPointsSet', + name: 'SignerRemoved', type: 'event', }, { @@ -467,25 +304,6 @@ const _abi = [ name: 'Transfer', type: 'event', }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'WithdrawMade', - type: 'event', - }, { inputs: [], name: 'acceptGovernance', @@ -494,18 +312,12 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - ], - name: 'accountBalanceOf', + inputs: [], + name: 'activeCoverLimit', outputs: [ { internalType: 'uint256', - name: 'balance', + name: 'amount', type: 'uint256', }, ], @@ -516,49 +328,15 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'policyholder_', + name: 'signer', type: 'address', }, - { - internalType: 'uint256', - name: 'coverLimit_', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'referralCode_', - type: 'bytes', - }, - ], - name: 'activatePolicy', - outputs: [ - { - internalType: 'uint256', - name: 'policyID', - type: 'uint256', - }, ], + name: 'addSigner', + outputs: [], stateMutability: 'nonpayable', type: 'function', }, - { - inputs: [], - name: 'activeCoverLimit', - outputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, { inputs: [ { @@ -583,7 +361,7 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'availableCoverCapacity_', + name: 'capacity', type: 'uint256', }, ], @@ -623,62 +401,48 @@ const _abi = [ type: 'function', }, { - inputs: [], - name: 'chargeCycle', - outputs: [ + inputs: [ { internalType: 'uint256', - name: 'chargeCycle_', + name: '_premium', type: 'uint256', }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ { - internalType: 'address[]', - name: 'holders', - type: 'address[]', + internalType: 'uint256', + name: '_deadline', + type: 'uint256', }, { - internalType: 'uint256[]', - name: 'premiums', - type: 'uint256[]', + internalType: 'bytes', + name: '_signature', + type: 'bytes', }, ], - name: 'chargePremiums', + name: 'cancel', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { - inputs: [], - name: 'cooldownPeriod', - outputs: [ + inputs: [ { - internalType: 'uint256', - name: 'cooldownPeriod_', - type: 'uint256', + internalType: 'address[]', + name: '_policyholders', + type: 'address[]', }, ], - stateMutability: 'view', + name: 'cancelPolicies', + outputs: [], + stateMutability: 'nonpayable', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - ], - name: 'cooldownStart', + inputs: [], + name: 'chargeCycle', outputs: [ { internalType: 'uint256', - name: 'cooldownStart_', + name: '', type: 'uint256', }, ], @@ -689,7 +453,7 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'policyID_', + name: '', type: 'uint256', }, ], @@ -697,38 +461,13 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'amount', + name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, - { - inputs: [], - name: 'deactivatePolicy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'deposit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, { inputs: [ { @@ -751,16 +490,16 @@ const _abi = [ { inputs: [ { - internalType: 'bytes', - name: 'referralCode', - type: 'bytes', + internalType: 'uint256', + name: 'index', + type: 'uint256', }, ], - name: 'getReferrerFromReferralCode', + name: 'getSigner', outputs: [ { internalType: 'address', - name: 'referrer', + name: 'signer', type: 'address', }, ], @@ -821,30 +560,11 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'policyholder', + name: 'signer', type: 'address', }, ], - name: 'isReferralCodeUsed', - outputs: [ - { - internalType: 'bool', - name: 'isReferralCodeUsed_', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'referralCode', - type: 'bytes', - }, - ], - name: 'isReferralCodeValid', + name: 'isSigner', outputs: [ { internalType: 'bool', @@ -857,12 +577,12 @@ const _abi = [ }, { inputs: [], - name: 'isReferralOn', + name: 'latestChargedTime', outputs: [ { - internalType: 'bool', - name: 'isReferralOn_', - type: 'bool', + internalType: 'uint256', + name: '', + type: 'uint256', }, ], stateMutability: 'view', @@ -894,7 +614,7 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'maxRateDenom_', + name: '', type: 'uint256', }, ], @@ -907,7 +627,7 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'maxRateNum_', + name: '', type: 'uint256', }, ], @@ -918,7 +638,7 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'coverLimit', + name: '_coverLimit', type: 'uint256', }, ], @@ -926,7 +646,26 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'minRequiredAccountBalance_', + name: 'mrab', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_policyholder', + type: 'address', + }, + ], + name: 'minScpRequired', + outputs: [ + { + internalType: 'uint256', + name: 'amount', type: 'uint256', }, ], @@ -946,6 +685,19 @@ const _abi = [ stateMutability: 'view', type: 'function', }, + { + inputs: [], + name: 'numSigners', + outputs: [ + { + internalType: 'uint256', + name: 'count', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, { inputs: [ { @@ -971,7 +723,7 @@ const _abi = [ outputs: [ { internalType: 'bool', - name: 'status', + name: '', type: 'bool', }, ], @@ -980,7 +732,7 @@ const _abi = [ }, { inputs: [], - name: 'pendingGovernance', + name: 'paymentManager', outputs: [ { internalType: 'address', @@ -993,12 +745,12 @@ const _abi = [ }, { inputs: [], - name: 'policyCount', + name: 'pendingGovernance', outputs: [ { - internalType: 'uint256', - name: 'count', - type: 'uint256', + internalType: 'address', + name: '', + type: 'address', }, ], stateMutability: 'view', @@ -1008,7 +760,7 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'policyholder_', + name: '', type: 'address', }, ], @@ -1016,7 +768,7 @@ const _abi = [ outputs: [ { internalType: 'uint256', - name: 'policyID', + name: '', type: 'uint256', }, ], @@ -1027,7 +779,7 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'policyID_', + name: '_policyID', type: 'uint256', }, ], @@ -1046,45 +798,101 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'policyholder_', + name: '_user', type: 'address', }, - ], - name: 'premiumsPaidOf', - outputs: [ { internalType: 'uint256', - name: 'premiumsPaid_', + name: '_coverLimit', type: 'uint256', }, ], - stateMutability: 'view', + name: 'purchase', + outputs: [], + stateMutability: 'nonpayable', type: 'function', }, { - inputs: [], - name: 'referralReward', + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'uint256', + name: '_coverLimit', + type: 'uint256', + }, + { + internalType: 'address', + name: '_token', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_priceDeadline', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_signature', + type: 'bytes', + }, + ], + name: 'purchaseWithNonStable', outputs: [ { internalType: 'uint256', - name: 'referralReward_', + name: 'policyID', type: 'uint256', }, ], - stateMutability: 'view', + stateMutability: 'nonpayable', type: 'function', }, { - inputs: [], - name: 'referralThreshold', + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'uint256', + name: '_coverLimit', + type: 'uint256', + }, + { + internalType: 'address', + name: '_token', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'purchaseWithStable', outputs: [ { internalType: 'uint256', - name: 'referralThreshold_', + name: 'policyID', type: 'uint256', }, ], - stateMutability: 'view', + stateMutability: 'nonpayable', type: 'function', }, { @@ -1093,7 +901,7 @@ const _abi = [ outputs: [ { internalType: 'address', - name: 'registry_', + name: '', type: 'address', }, ], @@ -1104,19 +912,13 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'policyholder_', + name: 'signer', type: 'address', }, ], - name: 'rewardPointsOf', - outputs: [ - { - internalType: 'uint256', - name: 'rewardPoints_', - type: 'uint256', - }, - ], - stateMutability: 'view', + name: 'removeSigner', + outputs: [], + stateMutability: 'nonpayable', type: 'function', }, { @@ -1125,7 +927,7 @@ const _abi = [ outputs: [ { internalType: 'address', - name: 'riskManager_', + name: '', type: 'address', }, ], @@ -1205,7 +1007,7 @@ const _abi = [ inputs: [ { internalType: 'string', - name: 'baseURI_', + name: '_baseURI', type: 'string', }, ], @@ -1217,9 +1019,9 @@ const _abi = [ { inputs: [ { - internalType: 'uint256', - name: 'chargeCycle_', - type: 'uint256', + internalType: 'enum ISolaceCoverProductV3.ChargePeriod', + name: '_chargeCycle', + type: 'uint8', }, ], name: 'setChargeCycle', @@ -1231,24 +1033,11 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'cooldownPeriod_', + name: '_timestamp', type: 'uint256', }, ], - name: 'setCooldownPeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'isReferralOn_', - type: 'bool', - }, - ], - name: 'setIsReferralOn', + name: 'setChargedTime', outputs: [], stateMutability: 'nonpayable', type: 'function', @@ -1257,24 +1046,16 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'maxRateDenom_', + name: '_maxRateNum', type: 'uint256', }, - ], - name: 'setMaxRateDenom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ { internalType: 'uint256', - name: 'maxRateNum_', + name: '_maxRateDenom', type: 'uint256', }, ], - name: 'setMaxRateNum', + name: 'setMaxRate', outputs: [], stateMutability: 'nonpayable', type: 'function', @@ -1283,7 +1064,7 @@ const _abi = [ inputs: [ { internalType: 'bool', - name: 'paused_', + name: '_paused', type: 'bool', }, ], @@ -1305,37 +1086,11 @@ const _abi = [ stateMutability: 'nonpayable', type: 'function', }, - { - inputs: [ - { - internalType: 'uint256', - name: 'referralReward_', - type: 'uint256', - }, - ], - name: 'setReferralReward', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'referralThreshhold_', - type: 'uint256', - }, - ], - name: 'setReferralThreshold', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, { inputs: [ { internalType: 'address', - name: 'registry_', + name: '_registry', type: 'address', }, ], @@ -1344,24 +1099,6 @@ const _abi = [ stateMutability: 'nonpayable', type: 'function', }, - { - inputs: [ - { - internalType: 'address', - name: 'policyholder_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'rewardPoints_', - type: 'uint256', - }, - ], - name: 'setRewardPoints', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, { inputs: [ { @@ -1406,13 +1143,26 @@ const _abi = [ outputs: [ { internalType: 'string', - name: 'tokenURI_', + name: 'uri', type: 'string', }, ], stateMutability: 'view', type: 'function', }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, { inputs: [ { @@ -1440,35 +1190,78 @@ const _abi = [ inputs: [ { internalType: 'uint256', - name: 'newCoverLimit_', + name: 'premium', + type: 'uint256', + }, + { + internalType: 'address', + name: 'policyholder', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', type: 'uint256', }, { internalType: 'bytes', - name: 'referralCode_', + name: 'signature', type: 'bytes', }, ], - name: 'updateCoverLimit', - outputs: [], - stateMutability: 'nonpayable', + name: 'verifyPremium', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', type: 'function', }, { - inputs: [], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'signature', + type: 'bytes', + }, + ], + name: 'verifyPrice', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', type: 'function', }, ]; -export class SolaceCoverProduct__factory { +export class SolaceCoverProductV3__factory { static readonly abi = _abi; - static createInterface(): SolaceCoverProductInterface { - return new utils.Interface(_abi) as SolaceCoverProductInterface; + static createInterface(): SolaceCoverProductV3Interface { + return new utils.Interface(_abi) as SolaceCoverProductV3Interface; } - static connect(address: string, signerOrProvider: Signer | Provider): SolaceCoverProduct { - return new Contract(address, _abi, signerOrProvider) as SolaceCoverProduct; + static connect(address: string, signerOrProvider: Signer | Provider): SolaceCoverProductV3 { + return new Contract(address, _abi, signerOrProvider) as SolaceCoverProductV3; } } diff --git a/src/apps/solace/contracts/ethers/factories/index.ts b/src/apps/solace/contracts/ethers/factories/index.ts index 33291ff47..546ccb01b 100644 --- a/src/apps/solace/contracts/ethers/factories/index.ts +++ b/src/apps/solace/contracts/ethers/factories/index.ts @@ -6,8 +6,7 @@ export { BondTellerEth__factory } from './BondTellerEth__factory'; export { BondTellerMatic__factory } from './BondTellerMatic__factory'; export { Scp__factory } from './Scp__factory'; export { Solace__factory } from './Solace__factory'; -export { SolaceCoverProduct__factory } from './SolaceCoverProduct__factory'; -export { SolaceCoverProductV2__factory } from './SolaceCoverProductV2__factory'; +export { SolaceCoverProductV3__factory } from './SolaceCoverProductV3__factory'; export { StakingRewards__factory } from './StakingRewards__factory'; export { XSolacev1__factory } from './XSolacev1__factory'; export { XsLocker__factory } from './XsLocker__factory'; diff --git a/src/apps/solace/contracts/ethers/index.ts b/src/apps/solace/contracts/ethers/index.ts index 81022add5..b3c89c7f7 100644 --- a/src/apps/solace/contracts/ethers/index.ts +++ b/src/apps/solace/contracts/ethers/index.ts @@ -6,8 +6,7 @@ export type { BondTellerEth } from './BondTellerEth'; export type { BondTellerMatic } from './BondTellerMatic'; export type { Scp } from './Scp'; export type { Solace } from './Solace'; -export type { SolaceCoverProduct } from './SolaceCoverProduct'; -export type { SolaceCoverProductV2 } from './SolaceCoverProductV2'; +export type { SolaceCoverProductV3 } from './SolaceCoverProductV3'; export type { StakingRewards } from './StakingRewards'; export type { XSolacev1 } from './XSolacev1'; export type { XsLocker } from './XsLocker'; @@ -16,8 +15,7 @@ export { BondTellerErc20__factory } from './factories/BondTellerErc20__factory'; export { BondTellerEth__factory } from './factories/BondTellerEth__factory'; export { BondTellerMatic__factory } from './factories/BondTellerMatic__factory'; export { Scp__factory } from './factories/Scp__factory'; -export { SolaceCoverProductV2__factory } from './factories/SolaceCoverProductV2__factory'; -export { SolaceCoverProduct__factory } from './factories/SolaceCoverProduct__factory'; +export { SolaceCoverProductV3__factory } from './factories/SolaceCoverProductV3__factory'; export { Solace__factory } from './factories/Solace__factory'; export { StakingRewards__factory } from './factories/StakingRewards__factory'; export { XSolacev1__factory } from './factories/XSolacev1__factory'; diff --git a/src/apps/solace/contracts/index.ts b/src/apps/solace/contracts/index.ts index 5f0f38e14..fcf268de1 100644 --- a/src/apps/solace/contracts/index.ts +++ b/src/apps/solace/contracts/index.ts @@ -9,8 +9,7 @@ import { BondTellerEth__factory } from './ethers'; import { BondTellerMatic__factory } from './ethers'; import { Scp__factory } from './ethers'; import { Solace__factory } from './ethers'; -import { SolaceCoverProduct__factory } from './ethers'; -import { SolaceCoverProductV2__factory } from './ethers'; +import { SolaceCoverProductV3__factory } from './ethers'; import { StakingRewards__factory } from './ethers'; import { XSolacev1__factory } from './ethers'; import { XsLocker__factory } from './ethers'; @@ -39,11 +38,8 @@ export class SolaceContractFactory extends ContractFactory { solace({ address, network }: ContractOpts) { return Solace__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } - solaceCoverProduct({ address, network }: ContractOpts) { - return SolaceCoverProduct__factory.connect(address, this.appToolkit.getNetworkProvider(network)); - } - solaceCoverProductV2({ address, network }: ContractOpts) { - return SolaceCoverProductV2__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + solaceCoverProductV3({ address, network }: ContractOpts) { + return SolaceCoverProductV3__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } stakingRewards({ address, network }: ContractOpts) { return StakingRewards__factory.connect(address, this.appToolkit.getNetworkProvider(network)); @@ -61,8 +57,7 @@ export type { BondTellerEth } from './ethers'; export type { BondTellerMatic } from './ethers'; export type { Scp } from './ethers'; export type { Solace } from './ethers'; -export type { SolaceCoverProduct } from './ethers'; -export type { SolaceCoverProductV2 } from './ethers'; +export type { SolaceCoverProductV3 } from './ethers'; export type { StakingRewards } from './ethers'; export type { XSolacev1 } from './ethers'; export type { XsLocker } from './ethers'; diff --git a/src/apps/solace/helpers/SolacePolicyBalanceHelper.ts b/src/apps/solace/helpers/SolacePolicyBalanceHelper.ts index e1a21268e..c88552da9 100644 --- a/src/apps/solace/helpers/SolacePolicyBalanceHelper.ts +++ b/src/apps/solace/helpers/SolacePolicyBalanceHelper.ts @@ -8,6 +8,9 @@ import { Network } from '~types/network.interface'; import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; +const SOLACE_COVER_POINTS_ADDRESS = '0x501ace72166956f57b44dbbcc531a8e741449997'; +const SOLACE_COVER_PRODUCT_ADDRESS = '0x501ACeB72d62C9875825b71d9f78a27780B5624d'; + @Injectable() export class SolacePolicyBalanceHelper { constructor( @@ -22,13 +25,15 @@ export class SolacePolicyBalanceHelper { groupId: SOLACE_DEFINITION.groups.policies.id, network, resolveBalances: async ({ address, contractPosition }) => { + // does the user have a policy? + const spi = this.solaceContractFactory.solaceCoverProductV3({ address: SOLACE_COVER_PRODUCT_ADDRESS, network }); + const policyID = await spi.policyOf(address); + if(policyID.eq(0)) return []; // Resolve the staked token and reward token from the contract position object const stakedToken = contractPosition.tokens.find(t => t.metaType === MetaType.SUPPLIED)!; - - const product = this.solaceContractFactory.solaceCoverProduct({ address: contractPosition.address, network }); - const bal = await product.accountBalanceOf(address); - - return [drillBalance(stakedToken, bal.toString())]; + const scp = this.solaceContractFactory.erc20({ address: SOLACE_COVER_POINTS_ADDRESS, network }); + const balRaw = await scp.balanceOf(address); + return [drillBalance(stakedToken, balRaw.toString())]; }, }); } diff --git a/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts b/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts index 2c97ffcb9..119d74c23 100644 --- a/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts +++ b/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts @@ -15,7 +15,7 @@ const appId = SOLACE_DEFINITION.id; const groupId = SOLACE_DEFINITION.groups.policies.id; const network = Network.POLYGON_MAINNET; -const FRAX_ADDRESS = '0x45c32fa6df82ead1e2ef74d17b76547eddfaff89'; +const DAI_ADDRESS = '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063'; const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; @@ -25,8 +25,8 @@ export class PolygonSolacePoliciesContractPositionFetcher implements PositionFet async getPositions() { const baseTokens = await this.appToolkit.getBaseTokenPrices(network); - const frax = baseTokens.find(t => t.address === FRAX_ADDRESS)!; - const tokens = [supplied(frax)]; + const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; + const tokens = [supplied(dai)]; const position: ContractPosition = { type: ContractType.POSITION, From bb5ac86a90da3e13848b9237a632175a5f9787b5 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 28 Jun 2022 10:07:42 -0700 Subject: [PATCH 2/5] add aurora and fantom --- .../solace/aurora/solace.balance-fetcher.ts | 69 ++++++++++++++ .../solace.bonds.contract-position-fetcher.ts | 89 +++++++++++++++++++ ...lace.policies.contract-position-fetcher.ts | 47 ++++++++++ ...lace.xslocker.contract-position-fetcher.ts | 46 ++++++++++ .../solace/fantom/solace.balance-fetcher.ts | 69 ++++++++++++++ .../solace.bonds.contract-position-fetcher.ts | 88 ++++++++++++++++++ ...lace.policies.contract-position-fetcher.ts | 47 ++++++++++ ...lace.xslocker.contract-position-fetcher.ts | 46 ++++++++++ src/apps/solace/solace.definition.ts | 2 + src/apps/solace/solace.module.ts | 33 ++++++- 10 files changed, 532 insertions(+), 4 deletions(-) create mode 100644 src/apps/solace/aurora/solace.balance-fetcher.ts create mode 100644 src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts create mode 100644 src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts create mode 100644 src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts create mode 100644 src/apps/solace/fantom/solace.balance-fetcher.ts create mode 100644 src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts create mode 100644 src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts create mode 100644 src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts diff --git a/src/apps/solace/aurora/solace.balance-fetcher.ts b/src/apps/solace/aurora/solace.balance-fetcher.ts new file mode 100644 index 000000000..96e560aa4 --- /dev/null +++ b/src/apps/solace/aurora/solace.balance-fetcher.ts @@ -0,0 +1,69 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { SolaceBondBalanceHelper } from '../helpers/SolaceBondBalanceHelper'; +import { SolacePolicyBalanceHelper } from '../helpers/SolacePolicyBalanceHelper'; +import { SolaceXSBalanceHelper } from '../helpers/SolaceXSBalanceHelper'; +import { SOLACE_DEFINITION } from '../solace.definition'; + +const network = Network.AURORA_MAINNET; + +@Register.BalanceFetcher(SOLACE_DEFINITION.id, network) +export class AuroraSolaceBalanceFetcher implements BalanceFetcher { + constructor( + @Inject(SolaceBondBalanceHelper) + private readonly solaceBondBalanceHelper: SolaceBondBalanceHelper, + @Inject(SolacePolicyBalanceHelper) + private readonly solacePolicyBalanceHelper: SolacePolicyBalanceHelper, + @Inject(SolaceXSBalanceHelper) + private readonly solaceXSBalanceHelper: SolaceXSBalanceHelper, + ) {} + + async getXSLockerBalance(address: string) { + return this.solaceXSBalanceHelper.getBalances({ + address, + network, + }); + } + + async getBondBalance(address: string) { + return this.solaceBondBalanceHelper.getBalances({ + address, + network, + }); + } + + async getPolicyBalance(address: string) { + return this.solacePolicyBalanceHelper.getBalances({ + address, + network, + }); + } + + async getBalances(address: string) { + const [xslockerBal, bondBal, policyBal] = await Promise.all([ + this.getXSLockerBalance(address), + this.getBondBalance(address), + this.getPolicyBalance(address), + ]); + + return presentBalanceFetcherResponse([ + { + label: 'xsLocker', + assets: xslockerBal, + }, + { + label: 'Bonds', + assets: bondBal, + }, + { + label: 'Policies', + assets: policyBal, + }, + ]); + } +} diff --git a/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts new file mode 100644 index 000000000..f2c269caa --- /dev/null +++ b/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts @@ -0,0 +1,89 @@ +import { Inject } from '@nestjs/common'; +import { compact } from 'lodash'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; +import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { claimable, supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SolaceContractFactory } from '../contracts'; +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.bonds.id; +const network = Network.AURORA_MAINNET; + +export const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; + +const BOND_TELLER_ADDRESSES = [ + '0x501ace677634fd09a876e88126076933b686967a', // DAI Bond + '0x501ace95141f3eb59970dd64af0405f6056fb5d8', // ETH Bond + '0x501ace7e977e06a3cb55f9c28d5654c9d74d5ca9', // USDC Bond + '0x501acef0d0c73bd103337e6e9fd49d58c426dc27', // WBTC Bond + '0x501ace5ceec693df03198755ee80d4ce0b5c55fe', // USDT Bond + '0x501acef4f8397413c33b13cb39670ad2f17bfe62', // FRAX Bond + '0x501ace71a83cbe03b1467a6ffeaeb58645d844b4', // NEAR Bond + '0x501ace35f0b7fad91c199824b8fe555ee9037aa3', // AURORA Bond +]; + +@Register.ContractPositionFetcher({ appId, groupId, network, options: { includeInTvl: true } }) +export class AuroraSolaceBondsContractPositionFetcher implements PositionFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} + + async getPositions() { + const multicall = this.appToolkit.getMulticall(network); + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const solaceToken = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; + + const positions = await Promise.all( + BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { + const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); + + const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + multicall.wrap(bondTellerContract).principal(), + multicall.wrap(bondTellerContract).underwritingPool(), + ]); + + const underlyingAddress = underlyingAddressRaw.toLowerCase(); + + const depositToken = baseTokens.find(v => v.address === underlyingAddress); + if (!depositToken || !solaceToken) return null; + const tokens = [supplied(depositToken), claimable(solaceToken)]; + + const baseTokenContract = this.solaceContractFactory.erc20({ address: underlyingAddress, network }); + const balanceOfRaw = await multicall.wrap(baseTokenContract).balanceOf(underWritingPoolAddress); + const balanceOf = Number(balanceOfRaw) / 10 ** depositToken.decimals; + const liquidity = balanceOf * depositToken.price; + + const position: ContractPosition = { + type: ContractType.POSITION, + appId, + groupId, + address: bondTellerAddress, + network, + tokens, + dataProps: { + liquidity, + }, + displayProps: { + label: `${getLabelFromToken(depositToken)}`, + images: getImagesFromToken(depositToken), + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], + }, + }; + + return position; + }), + ); + + return compact(positions); + } +} diff --git a/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts new file mode 100644 index 000000000..ed7a290d5 --- /dev/null +++ b/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts @@ -0,0 +1,47 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.policies.id; +const network = Network.AURORA_MAINNET; + +const DAI_ADDRESS = '0xe3520349f477a5f6eb06107066048508498a291b'; +const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; +const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; + +@Register.ContractPositionFetcher({ appId, groupId, network }) +export class AuroraSolacePoliciesContractPositionFetcher implements PositionFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + async getPositions() { + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; + const tokens = [supplied(dai)]; + + const position: ContractPosition = { + type: ContractType.POSITION, + appId, + groupId, + address: SOLACE_COVER_PRODUCT_ADDRESS, + network, + tokens, + dataProps: {}, + displayProps: { + label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + images: [getTokenImg(SOLACE_ADDRESS, Network.AURORA_MAINNET)], + }, + }; + + return [position]; + } +} diff --git a/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts new file mode 100644 index 000000000..641cebf3c --- /dev/null +++ b/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts @@ -0,0 +1,46 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { claimable, supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.xslocker.id; +const network = Network.AURORA_MAINNET; + +const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const XSLOCKER_ADDRESS = '0x501ace47c5b0c2099c4464f681c3fa2ecd3146c1'; + +@Register.ContractPositionFetcher({ appId, groupId, network }) +export class AuroraSolaceXslockerContractPositionFetcher implements PositionFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + async getPositions() { + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const solace = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; + if (!solace) return []; + + const position: ContractPosition = { + type: ContractType.POSITION, + address: XSLOCKER_ADDRESS, + appId, + groupId, + network, + tokens: [supplied(solace), claimable(solace)], + dataProps: {}, + displayProps: { + label: `xsLOCK`, + images: getImagesFromToken(solace), + }, + }; + + return [position]; + } +} diff --git a/src/apps/solace/fantom/solace.balance-fetcher.ts b/src/apps/solace/fantom/solace.balance-fetcher.ts new file mode 100644 index 000000000..1c251044b --- /dev/null +++ b/src/apps/solace/fantom/solace.balance-fetcher.ts @@ -0,0 +1,69 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { SolaceBondBalanceHelper } from '../helpers/SolaceBondBalanceHelper'; +import { SolacePolicyBalanceHelper } from '../helpers/SolacePolicyBalanceHelper'; +import { SolaceXSBalanceHelper } from '../helpers/SolaceXSBalanceHelper'; +import { SOLACE_DEFINITION } from '../solace.definition'; + +const network = Network.FANTOM_OPERA_MAINNET; + +@Register.BalanceFetcher(SOLACE_DEFINITION.id, network) +export class FantomSolaceBalanceFetcher implements BalanceFetcher { + constructor( + @Inject(SolaceBondBalanceHelper) + private readonly solaceBondBalanceHelper: SolaceBondBalanceHelper, + @Inject(SolacePolicyBalanceHelper) + private readonly solacePolicyBalanceHelper: SolacePolicyBalanceHelper, + @Inject(SolaceXSBalanceHelper) + private readonly solaceXSBalanceHelper: SolaceXSBalanceHelper, + ) {} + + async getXSLockerBalance(address: string) { + return this.solaceXSBalanceHelper.getBalances({ + address, + network, + }); + } + + async getBondBalance(address: string) { + return this.solaceBondBalanceHelper.getBalances({ + address, + network, + }); + } + + async getPolicyBalance(address: string) { + return this.solacePolicyBalanceHelper.getBalances({ + address, + network, + }); + } + + async getBalances(address: string) { + const [xslockerBal, bondBal, policyBal] = await Promise.all([ + this.getXSLockerBalance(address), + this.getBondBalance(address), + this.getPolicyBalance(address), + ]); + + return presentBalanceFetcherResponse([ + { + label: 'xsLocker', + assets: xslockerBal, + }, + { + label: 'Bonds', + assets: bondBal, + }, + { + label: 'Policies', + assets: policyBal, + }, + ]); + } +} diff --git a/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts new file mode 100644 index 000000000..1d5d006fc --- /dev/null +++ b/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts @@ -0,0 +1,88 @@ +import { Inject } from '@nestjs/common'; +import { compact } from 'lodash'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; +import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { claimable, supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SolaceContractFactory } from '../contracts'; +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.bonds.id; +const network = Network.FANTOM_OPERA_MAINNET; + +export const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; + +const BOND_TELLER_ADDRESSES = [ + '0x501ace677634fd09a876e88126076933b686967a', // DAI Bond + '0x501ace367f1865dea154236d5a8016b80a49e8a9', // ETH Bond + '0x501ace7e977e06a3cb55f9c28d5654c9d74d5ca9', // USDC Bond + '0x501acef0d0c73bd103337e6e9fd49d58c426dc27', // WBTC Bond + '0x501ace5ceec693df03198755ee80d4ce0b5c55fe', // USDT Bond + '0x501acef4f8397413c33b13cb39670ad2f17bfe62', // FRAX Bond + '0x501ace43a70b62744037c0ec78dd043be35ef653', // FTM Bond +]; + +@Register.ContractPositionFetcher({ appId, groupId, network, options: { includeInTvl: true } }) +export class FantomSolaceBondsContractPositionFetcher implements PositionFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} + + async getPositions() { + const multicall = this.appToolkit.getMulticall(network); + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const solaceToken = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; + + const positions = await Promise.all( + BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { + const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); + + const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + multicall.wrap(bondTellerContract).principal(), + multicall.wrap(bondTellerContract).underwritingPool(), + ]); + + const underlyingAddress = underlyingAddressRaw.toLowerCase(); + + const depositToken = baseTokens.find(v => v.address === underlyingAddress); + if (!depositToken || !solaceToken) return null; + const tokens = [supplied(depositToken), claimable(solaceToken)]; + + const baseTokenContract = this.solaceContractFactory.erc20({ address: underlyingAddress, network }); + const balanceOfRaw = await multicall.wrap(baseTokenContract).balanceOf(underWritingPoolAddress); + const balanceOf = Number(balanceOfRaw) / 10 ** depositToken.decimals; + const liquidity = balanceOf * depositToken.price; + + const position: ContractPosition = { + type: ContractType.POSITION, + appId, + groupId, + address: bondTellerAddress, + network, + tokens, + dataProps: { + liquidity, + }, + displayProps: { + label: `${getLabelFromToken(depositToken)}`, + images: getImagesFromToken(depositToken), + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], + }, + }; + + return position; + }), + ); + + return compact(positions); + } +} diff --git a/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts new file mode 100644 index 000000000..0f83e7830 --- /dev/null +++ b/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts @@ -0,0 +1,47 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.policies.id; +const network = Network.FANTOM_OPERA_MAINNET; + +const DAI_ADDRESS = '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e'; +const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; +const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; + +@Register.ContractPositionFetcher({ appId, groupId, network }) +export class FantomSolacePoliciesContractPositionFetcher implements PositionFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + async getPositions() { + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; + const tokens = [supplied(dai)]; + + const position: ContractPosition = { + type: ContractType.POSITION, + appId, + groupId, + address: SOLACE_COVER_PRODUCT_ADDRESS, + network, + tokens, + dataProps: {}, + displayProps: { + label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + images: [getTokenImg(SOLACE_ADDRESS, Network.FANTOM_OPERA_MAINNET)], + }, + }; + + return [position]; + } +} diff --git a/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts new file mode 100644 index 000000000..a06ac649b --- /dev/null +++ b/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts @@ -0,0 +1,46 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { claimable, supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { SOLACE_DEFINITION } from '../solace.definition'; + +const appId = SOLACE_DEFINITION.id; +const groupId = SOLACE_DEFINITION.groups.xslocker.id; +const network = Network.FANTOM_OPERA_MAINNET; + +const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const XSLOCKER_ADDRESS = '0x501ace47c5b0c2099c4464f681c3fa2ecd3146c1'; + +@Register.ContractPositionFetcher({ appId, groupId, network }) +export class FantomSolaceXslockerContractPositionFetcher implements PositionFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + async getPositions() { + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const solace = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; + if (!solace) return []; + + const position: ContractPosition = { + type: ContractType.POSITION, + address: XSLOCKER_ADDRESS, + appId, + groupId, + network, + tokens: [supplied(solace), claimable(solace)], + dataProps: {}, + displayProps: { + label: `xsLOCK`, + images: getImagesFromToken(solace), + }, + }; + + return [position]; + } +} diff --git a/src/apps/solace/solace.definition.ts b/src/apps/solace/solace.definition.ts index c0104ed1d..60266689e 100644 --- a/src/apps/solace/solace.definition.ts +++ b/src/apps/solace/solace.definition.ts @@ -56,6 +56,8 @@ export const SOLACE_DEFINITION = appDefinition({ supportedNetworks: { [Network.ETHEREUM_MAINNET]: [AppAction.VIEW], [Network.POLYGON_MAINNET]: [AppAction.VIEW], + [Network.AURORA_MAINNET]: [AppAction.VIEW], + [Network.FANTOM_OPERA_MAINNET]: [AppAction.VIEW], }, primaryColor: '#fff', diff --git a/src/apps/solace/solace.module.ts b/src/apps/solace/solace.module.ts index 748a33cbd..8a5edb0fc 100644 --- a/src/apps/solace/solace.module.ts +++ b/src/apps/solace/solace.module.ts @@ -1,25 +1,40 @@ import { Register } from '~app-toolkit/decorators'; import { AbstractApp } from '~app/app.dynamic-module'; +// General +import SOLACE_DEFINITION, { SolaceAppDefinition } from './solace.definition'; import { SolaceContractFactory } from './contracts'; +// Helpers +import { SolaceBondBalanceHelper } from './helpers/SolaceBondBalanceHelper'; +import { SolacePolicyBalanceHelper } from './helpers/SolacePolicyBalanceHelper'; +import { SolaceXSBalanceHelper } from './helpers/SolaceXSBalanceHelper'; +// Ethereum import { EthereumSolaceBalanceFetcher } from './ethereum/solace.balance-fetcher'; import { EthereumSolaceBondsContractPositionFetcher } from './ethereum/solace.bonds.contract-position-fetcher'; import { EthereumSolacePoliciesContractPositionFetcher } from './ethereum/solace.policies.contract-position-fetcher'; import { EthereumSolaceScpTokenFetcher } from './ethereum/solace.scp.token-fetcher'; import { EthereumSolaceXslockerContractPositionFetcher } from './ethereum/solace.xslocker.contract-position-fetcher'; import { EthereumSolaceXsolacev1TokenFetcher } from './ethereum/solace.xsolacev1.token-fetcher'; -import { SolaceBondBalanceHelper } from './helpers/SolaceBondBalanceHelper'; -import { SolacePolicyBalanceHelper } from './helpers/SolacePolicyBalanceHelper'; -import { SolaceXSBalanceHelper } from './helpers/SolaceXSBalanceHelper'; +// Aurora +import { AuroraSolaceBalanceFetcher } from './aurora/solace.balance-fetcher'; +import { AuroraSolaceBondsContractPositionFetcher } from './aurora/solace.bonds.contract-position-fetcher'; +import { AuroraSolacePoliciesContractPositionFetcher } from './aurora/solace.policies.contract-position-fetcher'; +import { AuroraSolaceXslockerContractPositionFetcher } from './aurora/solace.xslocker.contract-position-fetcher'; +// Polygon import { PolygonSolaceBalanceFetcher } from './polygon/solace.balance-fetcher'; import { PolygonSolaceBondsContractPositionFetcher } from './polygon/solace.bonds.contract-position-fetcher'; import { PolygonSolacePoliciesContractPositionFetcher } from './polygon/solace.policies.contract-position-fetcher'; import { PolygonSolaceXslockerContractPositionFetcher } from './polygon/solace.xslocker.contract-position-fetcher'; -import SOLACE_DEFINITION, { SolaceAppDefinition } from './solace.definition'; +// Fantom +import { FantomSolaceBalanceFetcher } from './fantom/solace.balance-fetcher'; +import { FantomSolaceBondsContractPositionFetcher } from './fantom/solace.bonds.contract-position-fetcher'; +import { FantomSolacePoliciesContractPositionFetcher } from './fantom/solace.policies.contract-position-fetcher'; +import { FantomSolaceXslockerContractPositionFetcher } from './fantom/solace.xslocker.contract-position-fetcher'; @Register.AppModule({ appId: SOLACE_DEFINITION.id, providers: [ + // General SolaceAppDefinition, SolaceContractFactory, // Helpers @@ -33,11 +48,21 @@ import SOLACE_DEFINITION, { SolaceAppDefinition } from './solace.definition'; EthereumSolaceScpTokenFetcher, EthereumSolaceXslockerContractPositionFetcher, EthereumSolaceXsolacev1TokenFetcher, + // Aurora + AuroraSolaceBalanceFetcher, + AuroraSolaceBondsContractPositionFetcher, + AuroraSolacePoliciesContractPositionFetcher, + AuroraSolaceXslockerContractPositionFetcher, // Polygon PolygonSolaceBalanceFetcher, PolygonSolaceBondsContractPositionFetcher, PolygonSolacePoliciesContractPositionFetcher, PolygonSolaceXslockerContractPositionFetcher, + // Fantom + FantomSolaceBalanceFetcher, + FantomSolaceBondsContractPositionFetcher, + FantomSolacePoliciesContractPositionFetcher, + FantomSolaceXslockerContractPositionFetcher, ], }) export class SolaceAppModule extends AbstractApp() {} From 750fad45256f7df51c8f02a91f96964ec624d31c Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 28 Jun 2022 10:07:52 -0700 Subject: [PATCH 3/5] update solace definition --- src/apps/solace/solace.definition.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/solace/solace.definition.ts b/src/apps/solace/solace.definition.ts index 60266689e..1b698d518 100644 --- a/src/apps/solace/solace.definition.ts +++ b/src/apps/solace/solace.definition.ts @@ -7,7 +7,7 @@ export const SOLACE_DEFINITION = appDefinition({ id: 'solace', name: 'Solace', description: - 'Solace is an insurance protocol that is aiming to invent the future of DeFi Insurance. The protocol helps you to protect your funds against smart-contracts exploits across 180+ protocols with an intelligent single policy that automatically adjusts coverage to changes in your positions.', + 'Solace is an insurance protocol that is aiming to invent the future of DeFi Insurance. The protocol helps you to protect your funds against smart-contracts exploits across 200+ protocols with an intelligent single policy that automatically adjusts coverage to changes in your positions.', url: 'https://solace.fi', groups: { @@ -49,6 +49,7 @@ export const SOLACE_DEFINITION = appDefinition({ links: { github: 'https://github.com/solace-fi', twitter: 'https://twitter.com/SolaceFi/', + telegram: 'https://t.me/solacefi', discord: 'https://discord.com/invite/7v8qsyepfu/', medium: 'https://medium.com/solace-fi/', }, From 5809a838b13ed863466df0c38064bfb71e12dc17 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 28 Jun 2022 11:49:11 -0700 Subject: [PATCH 4/5] add name to bonds --- .../aurora/solace.bonds.contract-position-fetcher.ts | 5 +++-- .../ethereum/solace.bonds.contract-position-fetcher.ts | 7 ++++--- .../fantom/solace.bonds.contract-position-fetcher.ts | 5 +++-- .../polygon/solace.bonds.contract-position-fetcher.ts | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts index f2c269caa..29bf7cfc7 100644 --- a/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts +++ b/src/apps/solace/aurora/solace.bonds.contract-position-fetcher.ts @@ -47,9 +47,10 @@ export class AuroraSolaceBondsContractPositionFetcher implements PositionFetcher BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); - const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + const [underlyingAddressRaw, underWritingPoolAddress, name] = await Promise.all([ multicall.wrap(bondTellerContract).principal(), multicall.wrap(bondTellerContract).underwritingPool(), + multicall.wrap(bondTellerContract).name(), ]); const underlyingAddress = underlyingAddressRaw.toLowerCase(); @@ -74,7 +75,7 @@ export class AuroraSolaceBondsContractPositionFetcher implements PositionFetcher liquidity, }, displayProps: { - label: `${getLabelFromToken(depositToken)}`, + label: name, images: getImagesFromToken(depositToken), statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, diff --git a/src/apps/solace/ethereum/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/ethereum/solace.bonds.contract-position-fetcher.ts index 1e211d7da..240b9de38 100644 --- a/src/apps/solace/ethereum/solace.bonds.contract-position-fetcher.ts +++ b/src/apps/solace/ethereum/solace.bonds.contract-position-fetcher.ts @@ -53,14 +53,15 @@ export class EthereumSolaceBondsContractPositionFetcher implements PositionFetch BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); - const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + const [underlyingAddressRaw, underWritingPoolAddress, name] = await Promise.all([ multicall.wrap(bondTellerContract).principal(), multicall.wrap(bondTellerContract).underwritingPool(), + multicall.wrap(bondTellerContract).name(), ]); const underlyingAddress = underlyingAddressRaw.toLowerCase(); - const depositToken = allTokens.find(v => v.address === underlyingAddress); + const depositToken = baseTokens.find(v => v.address === underlyingAddress); if (!depositToken || !solaceToken) return null; const tokens = [supplied(depositToken), claimable(solaceToken)]; @@ -80,7 +81,7 @@ export class EthereumSolaceBondsContractPositionFetcher implements PositionFetch liquidity, }, displayProps: { - label: `${getLabelFromToken(depositToken)}`, + label: name, images: getImagesFromToken(depositToken), statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, diff --git a/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts index 1d5d006fc..73751cca7 100644 --- a/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts +++ b/src/apps/solace/fantom/solace.bonds.contract-position-fetcher.ts @@ -46,9 +46,10 @@ export class FantomSolaceBondsContractPositionFetcher implements PositionFetcher BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); - const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + const [underlyingAddressRaw, underWritingPoolAddress, name] = await Promise.all([ multicall.wrap(bondTellerContract).principal(), multicall.wrap(bondTellerContract).underwritingPool(), + multicall.wrap(bondTellerContract).name(), ]); const underlyingAddress = underlyingAddressRaw.toLowerCase(); @@ -73,7 +74,7 @@ export class FantomSolaceBondsContractPositionFetcher implements PositionFetcher liquidity, }, displayProps: { - label: `${getLabelFromToken(depositToken)}`, + label: name, images: getImagesFromToken(depositToken), statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, diff --git a/src/apps/solace/polygon/solace.bonds.contract-position-fetcher.ts b/src/apps/solace/polygon/solace.bonds.contract-position-fetcher.ts index 428ac3043..2c09d6b6c 100644 --- a/src/apps/solace/polygon/solace.bonds.contract-position-fetcher.ts +++ b/src/apps/solace/polygon/solace.bonds.contract-position-fetcher.ts @@ -46,9 +46,10 @@ export class PolygonSolaceBondsContractPositionFetcher implements PositionFetche BOND_TELLER_ADDRESSES.map(async bondTellerAddress => { const bondTellerContract = this.solaceContractFactory.bondTellerErc20({ address: bondTellerAddress, network }); - const [underlyingAddressRaw, underWritingPoolAddress] = await Promise.all([ + const [underlyingAddressRaw, underWritingPoolAddress, name] = await Promise.all([ multicall.wrap(bondTellerContract).principal(), multicall.wrap(bondTellerContract).underwritingPool(), + multicall.wrap(bondTellerContract).name(), ]); const underlyingAddress = underlyingAddressRaw.toLowerCase(); @@ -73,7 +74,7 @@ export class PolygonSolaceBondsContractPositionFetcher implements PositionFetche liquidity, }, displayProps: { - label: `${getLabelFromToken(depositToken)}`, + label: name, images: getImagesFromToken(depositToken), statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, From a7f3cfc5b0f81a972b7e07a7e66639edaff503db Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 28 Jun 2022 11:51:01 -0700 Subject: [PATCH 5/5] add liquidity to xslocker and policies --- ...lace.policies.contract-position-fetcher.ts | 38 +++++++++++++++++-- ...lace.xslocker.contract-position-fetcher.ts | 22 ++++++++++- ...lace.policies.contract-position-fetcher.ts | 37 ++++++++++++++++-- ...lace.policies.contract-position-fetcher.ts | 38 +++++++++++++++++-- ...lace.xslocker.contract-position-fetcher.ts | 22 ++++++++++- ...lace.policies.contract-position-fetcher.ts | 38 +++++++++++++++++-- ...lace.xslocker.contract-position-fetcher.ts | 22 ++++++++++- 7 files changed, 199 insertions(+), 18 deletions(-) diff --git a/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts index ed7a290d5..6e22aa3b9 100644 --- a/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts +++ b/src/apps/solace/aurora/solace.policies.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -19,15 +21,42 @@ const DAI_ADDRESS = '0xe3520349f477a5f6eb06107066048508498a291b'; const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const PREMIUM_POOL_ADDRESS = '0x0436c20030d0c2e278e7e8e4b42d304a6420d3bb'; +const PREMIUM_POOL_TOKENS = [ + '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40', // solace + '0xe3520349f477a5f6eb06107066048508498a291b', // dai + '0xb12bfca5a55806aaf64e99521918a4bf0fc40802', // usdc + '0x4988a896b1227218e4a686fde5eabdcabd91571f', // usdt + '0xda2585430fef327ad8ee44af8f1f989a2a91a3d2', // frax + '0xdfa46478f9e5ea86d57387849598dbfb2e964b02', // mimatic +]; + @Register.ContractPositionFetcher({ appId, groupId, network }) export class AuroraSolacePoliciesContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; const tokens = [supplied(dai)]; + let liquidity = 0; + for(var i = 0; i < PREMIUM_POOL_TOKENS.length; ++i) { + const tokenAddr = PREMIUM_POOL_TOKENS[i]; + const tokenContract = this.solaceContractFactory.erc20({ address: tokenAddr, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(tokenContract).balanceOf(PREMIUM_POOL_ADDRESS), + multicall.wrap(tokenContract).decimals(), + ]); + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const tokenZapper = baseTokens.find(t => t.address === tokenAddr)!; + if(!!tokenZapper) liquidity += balanceOf * tokenZapper.price; + } + const position: ContractPosition = { type: ContractType.POSITION, appId, @@ -35,10 +64,13 @@ export class AuroraSolacePoliciesContractPositionFetcher implements PositionFetc address: SOLACE_COVER_PRODUCT_ADDRESS, network, tokens, - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { - label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + label: `Solace Portfolio Insurance`, // @TODO Might be nice to include cover amount! images: [getTokenImg(SOLACE_ADDRESS, Network.AURORA_MAINNET)], + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts b/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts index 641cebf3c..be7ce24e1 100644 --- a/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts +++ b/src/apps/solace/aurora/solace.xslocker.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { claimable, supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -20,13 +22,26 @@ const XSLOCKER_ADDRESS = '0x501ace47c5b0c2099c4464f681c3fa2ecd3146c1'; @Register.ContractPositionFetcher({ appId, groupId, network }) export class AuroraSolaceXslockerContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const solace = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; if (!solace) return []; + const solaceTokenContract = this.solaceContractFactory.erc20({ address: SOLACE_ADDRESS, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(solaceTokenContract).balanceOf(XSLOCKER_ADDRESS), + multicall.wrap(solaceTokenContract).decimals(), + ]); + + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const liquidity = balanceOf * solace.price; + const position: ContractPosition = { type: ContractType.POSITION, address: XSLOCKER_ADDRESS, @@ -34,10 +49,13 @@ export class AuroraSolaceXslockerContractPositionFetcher implements PositionFetc groupId, network, tokens: [supplied(solace), claimable(solace)], - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { label: `xsLOCK`, images: getImagesFromToken(solace), + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/ethereum/solace.policies.contract-position-fetcher.ts b/src/apps/solace/ethereum/solace.policies.contract-position-fetcher.ts index 80d96345c..67bcad7f6 100644 --- a/src/apps/solace/ethereum/solace.policies.contract-position-fetcher.ts +++ b/src/apps/solace/ethereum/solace.policies.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -19,15 +21,41 @@ const DAI_ADDRESS = '0x6b175474e89094c44da98b954eedeac495271d0f'; const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acebe29eabc346779bcb5fd62eaf6bfb5320e'; const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const PREMIUM_POOL_ADDRESS = '0x88fddce9ad3c5a12c06b597f0948f8eaffc3862d'; +const PREMIUM_POOL_TOKENS = [ + '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40', // solace + '0x6b175474e89094c44da98b954eedeac495271d0f', // dai + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // usdc + '0xdac17f958d2ee523a2206206994597c13d831ec7', // usdt + '0x853d955acef822db058eb8505911ed77f175b99e', // frax +]; + @Register.ContractPositionFetcher({ appId, groupId, network }) export class EthereumSolacePoliciesContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; const tokens = [supplied(dai)]; + let liquidity = 0; + for(var i = 0; i < PREMIUM_POOL_TOKENS.length; ++i) { + const tokenAddr = PREMIUM_POOL_TOKENS[i]; + const tokenContract = this.solaceContractFactory.erc20({ address: tokenAddr, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(tokenContract).balanceOf(PREMIUM_POOL_ADDRESS), + multicall.wrap(tokenContract).decimals(), + ]); + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const tokenZapper = baseTokens.find(t => t.address === tokenAddr)!; + if(!!tokenZapper) liquidity += balanceOf * tokenZapper.price; + } + const position: ContractPosition = { type: ContractType.POSITION, appId, @@ -35,10 +63,13 @@ export class EthereumSolacePoliciesContractPositionFetcher implements PositionFe address: SOLACE_COVER_PRODUCT_ADDRESS, network, tokens, - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { - label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + label: `Solace Portfolio Insurance`, // @TODO Might be nice to include cover amount! images: [getTokenImg(SOLACE_ADDRESS, Network.ETHEREUM_MAINNET)], + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts index 0f83e7830..238dd933c 100644 --- a/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts +++ b/src/apps/solace/fantom/solace.policies.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -19,15 +21,42 @@ const DAI_ADDRESS = '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e'; const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const PREMIUM_POOL_ADDRESS = '0xbff26e5d913738d073c515bee32035f2aff8c40c'; +const PREMIUM_POOL_TOKENS = [ + '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40', // solace + '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e', // dai + '0x04068da6c83afcfa0e13ba15a6696662335d5b75', // usdc + '0x049d68029688eabf473097a2fc38ef61633a3c7a', // usdt + '0xdc301622e621166bd8e82f2ca0a26c13ad0be355', // frax + '0xfb98b335551a418cd0737375a2ea0ded62ea213b', // mimatic +]; + @Register.ContractPositionFetcher({ appId, groupId, network }) export class FantomSolacePoliciesContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; const tokens = [supplied(dai)]; + let liquidity = 0; + for(var i = 0; i < PREMIUM_POOL_TOKENS.length; ++i) { + const tokenAddr = PREMIUM_POOL_TOKENS[i]; + const tokenContract = this.solaceContractFactory.erc20({ address: tokenAddr, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(tokenContract).balanceOf(PREMIUM_POOL_ADDRESS), + multicall.wrap(tokenContract).decimals(), + ]); + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const tokenZapper = baseTokens.find(t => t.address === tokenAddr)!; + if(!!tokenZapper) liquidity += balanceOf * tokenZapper.price; + } + const position: ContractPosition = { type: ContractType.POSITION, appId, @@ -35,10 +64,13 @@ export class FantomSolacePoliciesContractPositionFetcher implements PositionFetc address: SOLACE_COVER_PRODUCT_ADDRESS, network, tokens, - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { - label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + label: `Solace Portfolio Insurance`, // @TODO Might be nice to include cover amount! images: [getTokenImg(SOLACE_ADDRESS, Network.FANTOM_OPERA_MAINNET)], + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts b/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts index a06ac649b..5485d58d3 100644 --- a/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts +++ b/src/apps/solace/fantom/solace.xslocker.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { claimable, supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -20,13 +22,26 @@ const XSLOCKER_ADDRESS = '0x501ace47c5b0c2099c4464f681c3fa2ecd3146c1'; @Register.ContractPositionFetcher({ appId, groupId, network }) export class FantomSolaceXslockerContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const solace = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; if (!solace) return []; + const solaceTokenContract = this.solaceContractFactory.erc20({ address: SOLACE_ADDRESS, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(solaceTokenContract).balanceOf(XSLOCKER_ADDRESS), + multicall.wrap(solaceTokenContract).decimals(), + ]); + + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const liquidity = balanceOf * solace.price; + const position: ContractPosition = { type: ContractType.POSITION, address: XSLOCKER_ADDRESS, @@ -34,10 +49,13 @@ export class FantomSolaceXslockerContractPositionFetcher implements PositionFetc groupId, network, tokens: [supplied(solace), claimable(solace)], - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { label: `xsLOCK`, images: getImagesFromToken(solace), + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts b/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts index 119d74c23..506bc8c3d 100644 --- a/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts +++ b/src/apps/solace/polygon/solace.policies.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -19,15 +21,42 @@ const DAI_ADDRESS = '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063'; const SOLACE_COVER_PRODUCT_ADDRESS = '0x501acec83d440c00644ca5c48d059e1840852a64'; const SOLACE_ADDRESS = '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40'; +const PREMIUM_POOL_ADDRESS = '0x37cd57c6c7243455ac66631ce37bb7f977c71442'; +const PREMIUM_POOL_TOKENS = [ + '0x501ace9c35e60f03a2af4d484f49f9b1efde9f40', // solace + '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063', // dai + '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // usdc + '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', // usdt + '0x45c32fa6df82ead1e2ef74d17b76547eddfaff89', // frax + '0xa3fa99a148fa48d14ed51d610c367c61876997f1', // mimatic +]; + @Register.ContractPositionFetcher({ appId, groupId, network }) export class PolygonSolacePoliciesContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const dai = baseTokens.find(t => t.address === DAI_ADDRESS)!; const tokens = [supplied(dai)]; + let liquidity = 0; + for(var i = 0; i < PREMIUM_POOL_TOKENS.length; ++i) { + const tokenAddr = PREMIUM_POOL_TOKENS[i]; + const tokenContract = this.solaceContractFactory.erc20({ address: tokenAddr, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(tokenContract).balanceOf(PREMIUM_POOL_ADDRESS), + multicall.wrap(tokenContract).decimals(), + ]); + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const tokenZapper = baseTokens.find(t => t.address === tokenAddr)!; + if(!!tokenZapper) liquidity += balanceOf * tokenZapper.price; + } + const position: ContractPosition = { type: ContractType.POSITION, appId, @@ -35,10 +64,13 @@ export class PolygonSolacePoliciesContractPositionFetcher implements PositionFet address: SOLACE_COVER_PRODUCT_ADDRESS, network, tokens, - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { - label: `Solace Cover Policy`, // @TODO Might be nice to include cover amount! + label: `Solace Portfolio Insurance`, // @TODO Might be nice to include cover amount! images: [getTokenImg(SOLACE_ADDRESS, Network.POLYGON_MAINNET)], + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, }; diff --git a/src/apps/solace/polygon/solace.xslocker.contract-position-fetcher.ts b/src/apps/solace/polygon/solace.xslocker.contract-position-fetcher.ts index 39c1dfc9f..4881e56c4 100644 --- a/src/apps/solace/polygon/solace.xslocker.contract-position-fetcher.ts +++ b/src/apps/solace/polygon/solace.xslocker.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; @@ -9,6 +10,7 @@ import { ContractPosition } from '~position/position.interface'; import { claimable, supplied } from '~position/position.utils'; import { Network } from '~types/network.interface'; +import { SolaceContractFactory } from '../contracts'; import { SOLACE_DEFINITION } from '../solace.definition'; const appId = SOLACE_DEFINITION.id; @@ -20,13 +22,26 @@ const XSLOCKER_ADDRESS = '0x501ace47c5b0c2099c4464f681c3fa2ecd3146c1'; @Register.ContractPositionFetcher({ appId, groupId, network }) export class PolygonSolaceXslockerContractPositionFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(SolaceContractFactory) private readonly solaceContractFactory: SolaceContractFactory, + ) {} async getPositions() { + const multicall = this.appToolkit.getMulticall(network); const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const solace = baseTokens.find(t => t.address === SOLACE_ADDRESS)!; if (!solace) return []; + const solaceTokenContract = this.solaceContractFactory.erc20({ address: SOLACE_ADDRESS, network }); + const [balanceOfRaw, decimals] = await Promise.all([ + multicall.wrap(solaceTokenContract).balanceOf(XSLOCKER_ADDRESS), + multicall.wrap(solaceTokenContract).decimals(), + ]); + + const balanceOf = Number(balanceOfRaw) / 10 ** decimals; + const liquidity = balanceOf * solace.price; + const position: ContractPosition = { type: ContractType.POSITION, address: XSLOCKER_ADDRESS, @@ -34,10 +49,13 @@ export class PolygonSolaceXslockerContractPositionFetcher implements PositionFet groupId, network, tokens: [supplied(solace), claimable(solace)], - dataProps: {}, + dataProps: { + liquidity, + }, displayProps: { label: `xsLOCK`, images: getImagesFromToken(solace), + statsItems: [{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }], }, };