Contract Guide
These guidelines are fully hardcoded into the Helemet Smart Contract(s).The various parameters of the helmet platform are fully market-priced and contracts are automatically executed. Helmet team will not intervene in the policy price at any time or make changes to the contract unless it is necessary.
Guide book to Helmet Smart Contracts
Helmet.insurance's smart contracts are divided into core and peripheral two parts. The option logic is implemented in the core, including the OptionFactory, LongOption, and ShortOption contracts, the periphery implements policy buying and selling and flat-rate farming and harvesting, including the OptionOrder, HELMET Token, and Farm contracts.
OptionFactory is used for creating insurance policy contracts, minting Tokens, destroying Tokens, enabling policy activated and settlement.
LongOption is the buyer's certificate to activate the policy.
ShortOption is the seller's certificate for clearing back the denominated and the underlying assets.
OptionOrder is the policy marketplace, where supplier publish policies and holders buy policies, as well as the entry point for buyers to activate policy.
OptionFactory main function:
function createOption(bool _private, address _collateral, address _underlying, uint _strikePrice, uint _expiry) public returns (address long, address short);
function mint(bool _private, address _collateral, address _underlying, uint _strikePrice, uint _expiry, uint volume) public returns (address long, address short, uint vol);
function burn(address _creator, address _collateral, address _underlying, uint _strikePrice, uint _expiry, uint volume) public returns (address long, address short, uint vol);
function calcExerciseAmount(address _long, uint volume) public view returns (uint);
function exercise(address _long, uint volume, address[] memory path) public returns (uint vol, uint fee, uint amt);
function settleable(address short, uint volume) public view returns (uint vol, uint col, uint fee, uint und);
function settle(address short, uint volume) public returns (uint vol, uint col, uint fee, uint und);
LongOption main function:
function exercise(uint volume, address[] memory path) public returns (uint vol, uint fee, uint amt);
ShortOption main function:
function settleable(address seller) public view returns (uint vol, uint col, uint fee, uint und);
function settle(uint volume) external returns (uint vol, uint col, uint fee, uint und);
OptionOrder main function:
function sell(bool _private, address _collateral, address _underlying, uint _strikePrice, uint _expiry, uint volume, address settleToken, uint price) virtual public returns (uint askID);
function reprice(uint askID, uint newPrice) virtual external returns (uint newAskID);
function cancel(uint askID) virtual external returns (uint vol);
function buy(uint askID, uint volume) virtual public returns (uint bidID, uint vol, uint amt);
function exercise(uint bidID, uint volume, address[] memory path) virtual public returns (uint vol, uint fee, uint amt);
function waive(uint bidID, uint volume) virtual public returns (uint vol);
Buy&Sell
sell a policy
Using the sell function
of the OptionOrder contract.:
Example
Denominated
Asset
Underlying
Asset
Policy
Price
Premium
Amount
Expeir
At
BNB
HELMET
0.1BNB
0.2 Helmet
10 BNB
2021/1/1 0:0:0 UMT
Buy a policy
Using the buy function
of the OptionOrder contract.:
Example
ID
Policy price
456
123bnb
Activate the policy
Using the exercise function
of the OptionOrder contract.:
Example:
if it's a cover off policy
If it's a cover up policy
Get back the settlement
Using the settle function
of the OptionFactory contract:
Example
Last updated