Minting a call option

Minting can happen via 3 methods:

  • mintWithEntitledVault Mints an option based on a vault where an entitlement entitling the option instrument that expires at the option expiration is already in place. This is the preferred mechanism for option minting when a smart contract is performing the minting because a signature is not required for this operation.
/// @notice Mints a new call option for the assets deposited in a particular vault given strike price and expiration.
/// That vault must already have a registered entitlement for this contract with the an expiration equal to {expirationTime}
/// @param vaultAddress the contract address of the vault currently holding the call option
/// @param assetId the id of the asset within the vault
/// @param strikePrice the strike price for the call option being written
/// @param expirationTime time the timestamp after which the option will be expired
function mintWithEntitledVault(
  address vaultAddress,
  uint32 assetId,
  uint128 strikePrice,
  uint32 expirationTime
) external returns (uint256);
  • mintWithVault Mints an option with an asset placed in a vault serves as the underlying. The signature allows the option instrument to place a relevant entitlement on the vault when minting the option.
/// @notice Mints a new call option for the assets deposited in a particular vault given strike price and expiration.
/// @param vaultAddress the contract address of the vault currently holding the call option
/// @param assetId the id of the asset within the vault
/// @param strikePrice the strike price for the call option being written
/// @param expirationTime time the timestamp after which the option will be expired
/// @param signature the signature used to place the entitlement onto the vault
function mintWithVault(
  address vaultAddress,
  uint32 assetId,
  uint128 strikePrice,
  uint32 expirationTime,
  Signatures.Signature calldata signature
) external returns (uint256);
  • mintWithErc721 is a convenience method that allows the user to approve the call option to transfer an NFT and then the protocol manages the creation of the option and the entitlement on their behalf. Hook's frontend and marketplace utilize this method for raw ERC-721 assets.
/// @notice Mints a new call option for a particular "underlying" ERC-721 NFT with a given strike price and expiration
/// @param tokenAddress the contract address of the ERC-721 token that serves as the underlying asset for the call
/// option
/// @param tokenId the tokenId of the underlying ERC-721 token
/// @param strikePrice the strike price for the call option being written
/// @param expirationTime time the timestamp after which the option will be expired
function mintWithErc721(
  address tokenAddress,
  uint256 tokenId,
  uint128 strikePrice,
  uint32 expirationTime
) external returns (uint256);

When the option is minted, the internal state is updated to track the parameters of the option, and an option ERC-721 NFT is minted into the writer's wallet.