IProtocol

Functions

name() → string _name

Returns the name of the implementation

isSupported(bool isCall, address asset, address collateral) → bool _isSupported

This method checks whether the underlying protocol can mint options of the mentioned specs

hasSettled(bytes32 id) → bool _hasSettled

Returns whether the options have been settled from the protocol

getMintAmt(struct DataTypes.OptionData data, uint256 amt, bytes mintData) → uint256 _collateralNeeded

This method calculates the amount of collateral required to mint a specified number of options

getOptionToken(struct DataTypes.OptionData data) → address _subOption, enum DataTypes.TokenType _type

Returns the address of the option token used by the protocol, if any

balanceOf(struct DataTypes.OptionData data, address account) → uint256 _bal

Returns the amount of (sub)options held by an account. After taking care of protocols which doesn't use tokens to account

collateralBalanceOf(struct DataTypes.OptionData data, address account) → uint256 _bal

Returns the maximum amount of collateral that can be claimed by an account. After taking care of protocols which doesn't use tokens to account

mint(struct DataTypes.OptionData data, uint256 amt, address minter, bytes mintData) → bool _hasCreated

Mint (sub)options and transfer to polynomial option, if any

redeem(struct DataTypes.OptionData data, uint256 amt, address user, bytes redeemData) → bool _hasRedeemed

Redeem collateral before expiry

settle(struct DataTypes.OptionData data) → bool _hasSettled, uint256 _returnedAmt

Settle options and collateral after expiry + 6 hours

claimCollateral(struct DataTypes.OptionData data) → bool _isSuccess

Claim collateral after settlement is completed

claimCollateral(struct DataTypes.OptionData data, address user) → bool _isSuccess

Claim collateral after settlement is completed (called by rootToken)

transferCollateral(struct DataTypes.OptionData data, uint256 amt, address to) → bool _isSuccess

Transfer collateral

create(struct DataTypes.Option data) → bool _isSuccess

Create a (sub)option token if it is required by the protocol. Can be ignored for some protocols. Only called by optionRegistry