import { Contract , Signer } from "ethers" ; import { Provider } from "@ethersproject/providers" ; import type { RibbonV2ThetaVault } from "./RibbonV2ThetaVault" ; export class RibbonV2ThetaVaultFactory { static connect ( address , signerOrProvider ) { return new Contract ( address , _abi , signerOrProvider ) as RibbonV2ThetaVault ; } } const _abi = [ { inputs : [ { internalType : "address" , name : "_weth" , type : "address" , } , { internalType : "address" , name : "_usdc" , type : "address" , } , { internalType : "address" , name : "_oTokenFactory" , type : "address" , } , { internalType : "address" , name : "_gammaController" , type : "address" , } , { internalType : "address" , name : "_marginPool" , type : "address" , } , { internalType : "address" , name : "_gnosisEasyAuction" , type : "address" , } , ] , stateMutability : "nonpayable" , type : "constructor" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "owner" , type : "address" , } , { indexed : true , internalType : "address" , name : "spender" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "value" , type : "uint256" , } , ] , name : "Approval" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "auctionDuration" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newAuctionDuration" , type : "uint256" , } , ] , name : "AuctionDurationSet" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "oldCap" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newCap" , type : "uint256" , } , { indexed : false , internalType : "address" , name : "manager" , type : "address" , } , ] , name : "CapSet" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "options" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "withdrawAmount" , type : "uint256" , } , { indexed : true , internalType : "address" , name : "manager" , type : "address" , } , ] , name : "CloseShort" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "performanceFee" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "vaultFee" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "round" , type : "uint256" , } , { indexed : true , internalType : "address" , name : "feeRecipient" , type : "address" , } , ] , name : "CollectVaultFees" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "amount" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "round" , type : "uint256" , } , ] , name : "Deposit" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "auctioningToken" , type : "address" , } , { indexed : true , internalType : "address" , name : "biddingToken" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "auctionCounter" , type : "uint256" , } , { indexed : true , internalType : "address" , name : "manager" , type : "address" , } , ] , name : "InitiateGnosisAuction" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "shares" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "round" , type : "uint256" , } , ] , name : "InitiateWithdraw" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "amount" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "round" , type : "uint256" , } , ] , name : "InstantWithdraw" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "managementFee" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newManagementFee" , type : "uint256" , } , ] , name : "ManagementFeeSet" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "strikePrice" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "delta" , type : "uint256" , } , ] , name : "NewOptionStrikeSelected" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "options" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "depositAmount" , type : "uint256" , } , { indexed : true , internalType : "address" , name : "manager" , type : "address" , } , ] , name : "OpenShort" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "previousOwner" , type : "address" , } , { indexed : true , internalType : "address" , name : "newOwner" , type : "address" , } , ] , name : "OwnershipTransferred" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "performanceFee" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newPerformanceFee" , type : "uint256" , } , ] , name : "PerformanceFeeSet" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "premiumDiscount" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newPremiumDiscount" , type : "uint256" , } , ] , name : "PremiumDiscountSet" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "share" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "round" , type : "uint256" , } , ] , name : "Redeem" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "from" , type : "address" , } , { indexed : true , internalType : "address" , name : "to" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "value" , type : "uint256" , } , ] , name : "Transfer" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "amount" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "shares" , type : "uint256" , } , ] , name : "Withdraw" , type : "event" , } , { inputs : [ ] , name : "DELAY" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "GAMMA_CONTROLLER" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "GNOSIS_EASY_AUCTION" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "MARGIN_POOL" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "OTOKEN_FACTORY" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "PERIOD" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "USDC" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "WETH" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "account" , type : "address" , } , ] , name : "accountVaultBalance" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "owner" , type : "address" , } , { internalType : "address" , name : "spender" , type : "address" , } , ] , name : "allowance" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "spender" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "approve" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "auctionDuration" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "account" , type : "address" , } , ] , name : "balanceOf" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "burnRemainingOTokens" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "cap" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "commitAndClose" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "completeWithdraw" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "currentOption" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "currentOtokenPremium" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "decimals" , outputs : [ { internalType : "uint8" , name : "" , type : "uint8" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "spender" , type : "address" , } , { internalType : "uint256" , name : "subtractedValue" , type : "uint256" , } , ] , name : "decreaseAllowance" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "deposit" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "depositETH" , outputs : [ ] , stateMutability : "payable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "amount" , type : "uint256" , } , { internalType : "address" , name : "creditor" , type : "address" , } , ] , name : "depositFor" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , name : "depositReceipts" , outputs : [ { internalType : "uint16" , name : "round" , type : "uint16" , } , { internalType : "uint104" , name : "amount" , type : "uint104" , } , { internalType : "uint128" , name : "unredeemedShares" , type : "uint128" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "feeRecipient" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "spender" , type : "address" , } , { internalType : "uint256" , name : "addedValue" , type : "uint256" , } , ] , name : "increaseAllowance" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "numRounds" , type : "uint256" , } , ] , name : "initRounds" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "_owner" , type : "address" , } , { internalType : "address" , name : "_keeper" , type : "address" , } , { internalType : "address" , name : "_feeRecipient" , type : "address" , } , { internalType : "uint256" , name : "_managementFee" , type : "uint256" , } , { internalType : "uint256" , name : "_performanceFee" , type : "uint256" , } , { internalType : "string" , name : "_tokenName" , type : "string" , } , { internalType : "string" , name : "_tokenSymbol" , type : "string" , } , { internalType : "address" , name : "_optionsPremiumPricer" , type : "address" , } , { internalType : "address" , name : "_strikeSelection" , type : "address" , } , { internalType : "uint32" , name : "_premiumDiscount" , type : "uint32" , } , { internalType : "uint256" , name : "_auctionDuration" , type : "uint256" , } , { components : [ { internalType : "bool" , name : "isPut" , type : "bool" , } , { internalType : "uint8" , name : "decimals" , type : "uint8" , } , { internalType : "address" , name : "asset" , type : "address" , } , { internalType : "address" , name : "underlying" , type : "address" , } , { internalType : "uint56" , name : "minimumSupply" , type : "uint56" , } , { internalType : "uint104" , name : "cap" , type : "uint104" , } , ] , internalType : "struct Vault.VaultParams" , name : "_vaultParams" , type : "tuple" , } , ] , name : "initialize" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "numShares" , type : "uint256" , } , ] , name : "initiateWithdraw" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "keeper" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "lastStrikeOverrideRound" , outputs : [ { internalType : "uint16" , name : "" , type : "uint16" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "managementFee" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "maxRedeem" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "name" , outputs : [ { internalType : "string" , name : "" , type : "string" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "nextOption" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "nextOptionReadyAt" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "optionAuctionID" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "optionState" , outputs : [ { internalType : "address" , name : "nextOption" , type : "address" , } , { internalType : "address" , name : "currentOption" , type : "address" , } , { internalType : "uint32" , name : "nextOptionReadyAt" , type : "uint32" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "optionsPremiumPricer" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "overriddenStrikePrice" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "owner" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "performanceFee" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "premiumDiscount" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "pricePerShare" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "numShares" , type : "uint256" , } , ] , name : "redeem" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "renounceOwnership" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "rollToNextOption" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , name : "roundPricePerShare" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newAuctionDuration" , type : "uint256" , } , ] , name : "setAuctionDuration" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newCap" , type : "uint256" , } , ] , name : "setCap" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "newFeeRecipient" , type : "address" , } , ] , name : "setFeeRecipient" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newManagementFee" , type : "uint256" , } , ] , name : "setManagementFee" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "newKeeper" , type : "address" , } , ] , name : "setNewKeeper" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "newOptionsPremiumPricer" , type : "address" , } , ] , name : "setOptionsPremiumPricer" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newPerformanceFee" , type : "uint256" , } , ] , name : "setPerformanceFee" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newPremiumDiscount" , type : "uint256" , } , ] , name : "setPremiumDiscount" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint128" , name : "strikePrice" , type : "uint128" , } , ] , name : "setStrikePrice" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "newStrikeSelection" , type : "address" , } , ] , name : "setStrikeSelection" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "account" , type : "address" , } , ] , name : "shareBalances" , outputs : [ { internalType : "uint256" , name : "heldByAccount" , type : "uint256" , } , { internalType : "uint256" , name : "heldByVault" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "account" , type : "address" , } , ] , name : "shares" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "startAuction" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "strikeSelection" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "symbol" , outputs : [ { internalType : "string" , name : "" , type : "string" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "totalBalance" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "totalPending" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "totalSupply" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "recipient" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "transfer" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "sender" , type : "address" , } , { internalType : "address" , name : "recipient" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "transferFrom" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "newOwner" , type : "address" , } , ] , name : "transferOwnership" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "vaultParams" , outputs : [ { internalType : "bool" , name : "isPut" , type : "bool" , } , { internalType : "uint8" , name : "decimals" , type : "uint8" , } , { internalType : "address" , name : "asset" , type : "address" , } , { internalType : "address" , name : "underlying" , type : "address" , } , { internalType : "uint56" , name : "minimumSupply" , type : "uint56" , } , { internalType : "uint104" , name : "cap" , type : "uint104" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "vaultState" , outputs : [ { internalType : "uint16" , name : "round" , type : "uint16" , } , { internalType : "uint104" , name : "lockedAmount" , type : "uint104" , } , { internalType : "uint104" , name : "lastLockedAmount" , type : "uint104" , } , { internalType : "uint128" , name : "totalPending" , type : "uint128" , } , { internalType : "uint128" , name : "queuedWithdrawShares" , type : "uint128" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "withdrawInstantly" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , name : "withdrawals" , outputs : [ { internalType : "uint16" , name : "round" , type : "uint16" , } , { internalType : "uint128" , name : "shares" , type : "uint128" , } , ] , stateMutability : "view" , type : "function" , } , ] ;