ERC20.sol
base implementation. Like traditional options, after expiration, the token itself is worthless. event Transfer(address indexed from, address indexed to, uint256 value);
from
The sender of the tokens.to
The destination of the tokens.value
The token amount.event Approval(address indexed owner, address indexed spender, uint256 value);
spender
for an owner
is set.owner
The owner of the tokens.spender
Who receives the allowance.value
The token amount authorized.event CollateralDeposit(address indexed account, uint256 amount);
account
Address of the collateral owner.amount
Amount of collateral deposited.event CollateralWithdraw(address indexed account, address indexed recipient, uint256 amount, uint256 fee);
account
Address of the account. recipient
Address of the collateral destination. amount
Amount of collateral withdrawn. fee
The fee amount charged on the withdrawal.event Assigned(address indexed from, address indexed to, uint256 paidAmount, uint256 tokenAmount);
from
Address of the account of the collateral owner. to
Address of the account that exercises tokens to get the collateral. paidAmount
Amount paid to the collateral owner. tokenAmount
Amount of tokens used to exercise.function name() external view returns(string memory);
function symbol() external view returns(string memory);
function decimals() external view returns(uint8);
function totalSupply() external view returns(uint256);
function balanceOf(address account) external view returns(uint256);
account
The account to check the balance. function allowance(address owner, address spender) external view returns(uint256);
owner
Who set the allowance.spender
The authorized spender.function underlying() external view returns(address);
address(0)
for Ethereum).function strikeAsset() external view returns(address);
address(0)
for Ethereum).function strikePrice() external view returns(uint256);
function isCall() external view returns(bool);
function expiryTime() external view returns(uint256);
function acoFee() external view returns(uint256);
function feeDestination() external view returns(address);
function underlyingSymbol() external view returns(string memory);
function strikeAssetSymbol() external view returns(string memory);
function underlyingDecimals() external view returns(uint8);
function strikeAssetDecimals() external view returns(uint8);
function maxExercisedAccounts() external view returns(uint256);
exercise
or exerciseFrom
functions.function collateral() external view returns(address);
function totalCollateral() external view returns(uint256);
function numberOfAccountsWithCollateral() external view returns(uint256);
function currentCollateral(address account) external view returns(uint256);
account
Address of the account.function unassignableCollateral(address account) external view returns(uint256);
account
Address of the account.function assignableCollateral(address account) external view returns(uint256);
account
Address of the account.function currentCollateralizedTokens(address account) external view returns(uint256);
account
Address of the account.function unassignableTokens(address account) external view returns(uint256);
account
Address of the account.function assignableTokens(address account) external view returns(uint256);
account
Address of the account.function getCollateralAmount(uint256 tokenAmount) external view returns(uint256);
tokenAmount
Amount of tokens.function getTokenAmount(uint256 collateralAmount) external view returns(uint256);
collateralAmount
Amount of collateral.function getBaseExerciseData(uint256 tokenAmount) external view returns(address, uint256);
tokenAmount
Amount of ACO tokens that intends to exercise.exercise
or exerciseFrom
functions to exercise this base value must be added by maxExercisedAccounts
.exerciseAccounts
or exerciseAccountsFrom
functions to exercise this base value must be added by the number of accounts presented on the array sent as the function argument.function getCollateralOnExercise(uint256 tokenAmount) external view returns(uint256, uint256);
tokenAmount
Amount of ACO tokens that intends to exercise.function transfer(address recipient, uint256 amount) external returns(bool);
recipient
The destination address.amount
The token amount to be transferred.function transferFrom(address sender, address recipient, uint256 amount) external returns(bool);
sender
The owner of the tokens.recipient
The destination address.amount
The token amount to be transferred.function approve(address spender, uint256 amount) external returns(bool);
spender
Who receives the allowance.amount
The token amount authorized.function increaseAllowance(address spender, uint256 amount) external returns(bool);
spender
Who receives the allowance.amount
The token amount that will be increased to the allowance.function decreaseAllowance(address spender, uint256 amount) external returns(bool);
spender
Who receives the allowance.amount
The token amount that will be decreased to the allowance.function init(address _underlying, address _strikeAsset, bool _isCall, uint256 _strikePrice, uint256 _expiryTime, uint256 _acoFee, address payable _feeDestination, uint256 _maxExercisedAccounts) external;
require
is to guarantee that behavior._underlying
Address of the underlying asset (address(0)
for Ethereum). _strikeAsset
Address of the strike asset (address(0)
for Ethereum). _isCall
True if the type is CALL, false for PUT. _strikePrice
The strike price with the strike asset precision. _expiryTime
The UNIX time for the token expiration. _acoFee
Value of the ACO fee. It is a percentage value (100000 is 100%). _feeDestination
Address of the fee destination charged on the exercise. _maxExercisedAccounts
The maximum number of accounts that can be exercised by transaction.function mintPayable() external payable;
function mintToPayable(address account) external payable;
account
The account that will be considered as the owner of the collateral deposited.function mint(uint256 collateralAmount) external;
collateralAmount
Amount of collateral to be deposited.function mintTo(address account, uint256 collateralAmount) external;
account
The account that will be considered as the owner of the collateral deposited.collateralAmount
Amount of collateral to be deposited.function burn(uint256 tokenAmount) external;
tokenAmount
Amount of tokens to be burned.function burnFrom(address account, uint256 tokenAmount) external;
account
Address of the account that has the ACO tokens and collateral deposited.tokenAmount
Amount of tokens to be burned.function exercise(uint256 tokenAmount, uint256 salt) external payable;
getBaseExerciseData
to check which asset and the amount that should be paid. tokenAmount
Amount of ACO tokens to be exercised.salt
A random number used to calculate the start index of the array of accounts to be exercised.function exerciseFrom(address account, uint256 tokenAmount, uint256 salt) external payable;
getBaseExerciseData
to check which asset and the amount that should be paid.account
Address of the account that has the ACO tokens.tokenAmount
Amount of ACO tokens to be exercised.salt
A random number used to calculate the start index of the array of accounts to be exercised.function exerciseAccounts(uint256 tokenAmount, address[] calldata accounts) external payable;
getBaseExerciseData
to check which asset and the amount that should be paid. tokenAmount
Amount of ACO tokens to be exercised.accounts
The array of addresses to try to exercise and get collateral from.function exerciseAccountsFrom(address account, uint256 tokenAmount, address[] calldata accounts) external payable;
getBaseExerciseData
to check which asset and the amount that should be paid.account
Address of the account that has the ACO tokens.tokenAmount
Amount of ACO tokens to be exercised.accounts
The array of addresses to try to exercise and get collateral from.function redeem() external;
function redeemFrom(address account) external;
account
Address of the account that has the collateral deposited.