import { Contract , Signer } from "ethers" ; import { Provider } from "@ethersproject/providers" ; import type { RibbonCoveredCall } from "./RibbonCoveredCall" ; export class RibbonCoveredCallFactory { static connect ( address , signerOrProvider ) { return new Contract ( address , _abi , signerOrProvider ) as RibbonCoveredCall ; } } const _abi = [ { inputs : [ { internalType : "address" , name : "_asset" , type : "address" , } , { internalType : "address" , name : "_factory" , type : "address" , } , { internalType : "address" , name : "_registry" , type : "address" , } , { internalType : "address" , name : "_weth" , type : "address" , } , { internalType : "address" , name : "_usdc" , type : "address" , } , { internalType : "address" , name : "_swapContract" , type : "address" , } , { internalType : "uint8" , name : "_tokenDecimals" , type : "uint8" , } , { internalType : "uint256" , name : "_minimumSupply" , type : "uint256" , } , { internalType : "bool" , name : "_isPut" , type : "bool" , } , ] , 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 : "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 : false , internalType : "address" , name : "manager" , type : "address" , } , ] , name : "CloseShort" , 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 : "share" , type : "uint256" , } , ] , name : "Deposit" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "address" , name : "oldManager" , type : "address" , } , { indexed : false , internalType : "address" , name : "newManager" , type : "address" , } , ] , name : "ManagerChanged" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "address" , name : "replacement" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "shares" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "amount" , type : "uint256" , } , ] , name : "Migrate" , type : "event" , } , { anonymous : false , inputs : [ { indexed : true , internalType : "address" , name : "options" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "depositAmount" , type : "uint256" , } , { indexed : false , 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 : 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 : false , internalType : "address" , name : "replacement" , type : "address" , } , ] , name : "VaultSunset" , 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 : "share" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "fee" , type : "uint256" , } , ] , name : "Withdraw" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "address" , name : "account" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "oldShares" , type : "uint256" , } , { indexed : false , internalType : "address" , name : "to" , type : "address" , } , { indexed : false , internalType : "uint256" , name : "newShares" , type : "uint256" , } , ] , name : "WithdrawToV1Vault" , type : "event" , } , { anonymous : false , inputs : [ { indexed : false , internalType : "uint256" , name : "oldFee" , type : "uint256" , } , { indexed : false , internalType : "uint256" , name : "newFee" , type : "uint256" , } , ] , name : "WithdrawalFeeSet" , type : "event" , } , { inputs : [ ] , name : "MINIMUM_SUPPLY" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "SWAP_CONTRACT" , outputs : [ { internalType : "contract ISwap" , name : "" , type : "address" , } , ] , 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 : [ ] , name : "adapter" , outputs : [ { internalType : "contract IProtocolAdapter" , name : "" , type : "address" , } , ] , 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 : "asset" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "assetAmount" , type : "uint256" , } , ] , name : "assetAmountToShares" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "assetBalance" , 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 : "cap" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "closeShort" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { components : [ { internalType : "address" , name : "underlying" , type : "address" , } , { internalType : "address" , name : "strikeAsset" , type : "address" , } , { internalType : "address" , name : "collateralAsset" , type : "address" , } , { internalType : "uint256" , name : "expiry" , type : "uint256" , } , { internalType : "uint256" , name : "strikePrice" , type : "uint256" , } , { internalType : "enum ProtocolAdapterTypes.OptionType" , name : "optionType" , type : "uint8" , } , { internalType : "address" , name : "paymentToken" , type : "address" , } , ] , internalType : "struct ProtocolAdapterTypes.OptionTerms" , name : "optionTerms" , type : "tuple" , } , ] , name : "commitAndClose" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "currentOption" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "currentOptionExpiry" , 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 : [ ] , name : "delay" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , 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 : [ ] , name : "emergencyWithdrawFromShort" , outputs : [ ] , stateMutability : "nonpayable" , 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 : "address" , name : "_owner" , type : "address" , } , { internalType : "address" , name : "_feeRecipient" , type : "address" , } , { internalType : "uint256" , name : "_initCap" , type : "uint256" , } , { internalType : "string" , name : "_tokenName" , type : "string" , } , { internalType : "string" , name : "_tokenSymbol" , type : "string" , } , ] , name : "initialize" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "instantWithdrawalFee" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "isPut" , outputs : [ { internalType : "bool" , name : "" , type : "bool" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "lockedAmount" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "lockedRatio" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "manager" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "address" , name : "account" , type : "address" , } , ] , name : "maxWithdrawAmount" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "maxWithdrawableShares" , outputs : [ { internalType : "uint256" , name : "" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "migrate" , 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 : "owner" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "registry" , outputs : [ { internalType : "contract IVaultRegistry" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "renounceOwnership" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ ] , name : "replacementVault" , outputs : [ { internalType : "contract IRibbonV2Vault" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ ] , name : "rollToNextOption" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { components : [ { internalType : "uint256" , name : "nonce" , type : "uint256" , } , { internalType : "uint256" , name : "expiry" , type : "uint256" , } , { components : [ { internalType : "bytes4" , name : "kind" , type : "bytes4" , } , { internalType : "address" , name : "wallet" , type : "address" , } , { internalType : "address" , name : "token" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , { internalType : "uint256" , name : "id" , type : "uint256" , } , ] , internalType : "struct Types.Party" , name : "signer" , type : "tuple" , } , { components : [ { internalType : "bytes4" , name : "kind" , type : "bytes4" , } , { internalType : "address" , name : "wallet" , type : "address" , } , { internalType : "address" , name : "token" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , { internalType : "uint256" , name : "id" , type : "uint256" , } , ] , internalType : "struct Types.Party" , name : "sender" , type : "tuple" , } , { components : [ { internalType : "bytes4" , name : "kind" , type : "bytes4" , } , { internalType : "address" , name : "wallet" , type : "address" , } , { internalType : "address" , name : "token" , type : "address" , } , { internalType : "uint256" , name : "amount" , type : "uint256" , } , { internalType : "uint256" , name : "id" , type : "uint256" , } , ] , internalType : "struct Types.Party" , name : "affiliate" , type : "tuple" , } , { components : [ { internalType : "address" , name : "signatory" , type : "address" , } , { internalType : "address" , name : "validator" , type : "address" , } , { internalType : "bytes1" , name : "version" , type : "bytes1" , } , { internalType : "uint8" , name : "v" , type : "uint8" , } , { internalType : "bytes32" , name : "r" , type : "bytes32" , } , { internalType : "bytes32" , name : "s" , type : "bytes32" , } , ] , internalType : "struct Types.Signature" , name : "signature" , type : "tuple" , } , ] , internalType : "struct Types.Order" , name : "order" , type : "tuple" , } , ] , name : "sellOptions" , 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 : "address" , name : "newManager" , type : "address" , } , ] , name : "setManager" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "newWithdrawalFee" , type : "uint256" , } , ] , name : "setWithdrawalFee" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "address" , name : "upgradeTo" , type : "address" , } , ] , name : "sunset" , outputs : [ ] , stateMutability : "nonpayable" , 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 : "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 : "underlying" , outputs : [ { internalType : "address" , name : "" , type : "address" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "share" , type : "uint256" , } , ] , name : "withdraw" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "share" , type : "uint256" , } , ] , name : "withdrawAmountWithShares" , outputs : [ { internalType : "uint256" , name : "amountAfterFee" , type : "uint256" , } , { internalType : "uint256" , name : "feeAmount" , type : "uint256" , } , ] , stateMutability : "view" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "share" , type : "uint256" , } , ] , name : "withdrawETH" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , { inputs : [ { internalType : "uint256" , name : "share" , type : "uint256" , } , { internalType : "address" , name : "vault" , type : "address" , } , ] , name : "withdrawToV1Vault" , outputs : [ ] , stateMutability : "nonpayable" , type : "function" , } , ] ;