Token
Introduction
Each option series is integrated through an ACOToken contract, which is ERC20-compliant, making options transferable, fungible, and ready for further DeFi integrations. It inherits from an ERC20.sol base implementation. Like traditional options, after expiration, the token itself is worthless. 
Code
Address
Each ACO token has its own address. To check the available tokens, access https://aco.finance/#available-options.
Events
Transfer
event Transfer(address indexed from, address indexed to, uint256 value);
Emitted when tokens are moved from one account to another.
fromThe sender of the tokens.toThe destination of the tokens.valueThe token amount.
Approval
event Approval(address indexed owner, address indexed spender, uint256 value);
Emitted when the allowance of a spender for an owner is set.
ownerThe owner of the tokens.spenderWho receives the allowance.valueThe token amount authorized.
CollateralDeposit
event CollateralDeposit(address indexed account, uint256 amount);
Emitted when collateral is deposited on the contract.
accountAddress of the collateral owner.amountAmount of collateral deposited.
CollateralWithdraw
event CollateralWithdraw(address indexed account, address indexed recipient, uint256 amount, uint256 fee);
Emitted when collateral is withdrawn from the contract.
accountAddress of the account.recipientAddress of the collateral destination.amountAmount of collateral withdrawn.feeThe fee amount charged on the withdrawal.
Assigned
event Assigned(address indexed from, address indexed to, uint256 paidAmount, uint256 tokenAmount);
Emitted when the collateral is used on an assignment.
fromAddress of the account of the collateral owner.toAddress of the account that exercises tokens to get the collateral.paidAmountAmount paid to the collateral owner.tokenAmountAmount of tokens used to exercise.
Read-Only Functions
name
function name() external view returns(string memory);
Function to get the token name, that it is equal to the symbol.
symbol
function symbol() external view returns(string memory); 
Function to get the token symbol, see here for details about how it is defined.
decimals
function decimals() external view returns(uint8);
Function to get the token decimals, that it is equal to the underlying asset decimals.
totalSupply
function totalSupply() external view returns(uint256); 
Function to get the total supply of ACO tokens.
balanceOf
function balanceOf(address account) external view returns(uint256); 
Function to get the ACO tokens balance from an account.
accountThe account to check the balance.
allowance
function allowance(address owner, address spender) external view returns(uint256);
Function to get the allowance set for an account to another.
ownerWho set the allowance.spenderThe authorized spender.
underlying
function underlying() external view returns(address);
Returns the ERC20 token address for the underlying asset (address(0) for Ethereum).
strikeAsset
function strikeAsset() external view returns(address);
The ERC20 token address for the strike asset (address(0) for Ethereum).
strikePrice
function strikePrice() external view returns(uint256);
Returns the strike price for the ACO token with the strike asset precision.
isCall
function isCall() external view returns(bool);
Returns true if the option type is CALL, false for PUT.
expiryTime
function expiryTime() external view returns(uint256);
Returns the UNIX time for the ACO token expiration.
acoFee
function acoFee() external view returns(uint256);
Returns the ACO token fee value. It is a percentage value (100000 is 100%) that is charged on the token exercise.
feeDestination
function feeDestination() external view returns(address);
Returns the address of the fee destination charged on the exercise.
underlyingSymbol
function underlyingSymbol() external view returns(string memory);
Returns the symbol of the underlying asset.
strikeAssetSymbol
function strikeAssetSymbol() external view returns(string memory);
Returns the symbol of the strike asset.
underlyingDecimals
function underlyingDecimals() external view returns(uint8);
Returns the decimals for the underlying asset.
strikeAssetDecimals
function strikeAssetDecimals() external view returns(uint8);
Returns the decimals for the strike asset.
maxExercisedAccounts
function maxExercisedAccounts() external view returns(uint256);
Returns the maximum number of accounts that can be exercised by transaction using the exercise or exerciseFrom functions.
collateral
function collateral() external view returns(address);
Function to get the collateral asset. It is the underlying asset when is a CALL option or the strike asset when it is a PUT option.
totalCollateral
function totalCollateral() external view returns(uint256);
Returns the total amount of collateral on the contract.
numberOfAccountsWithCollateral
function numberOfAccountsWithCollateral() external view returns(uint256);
Function to get the number of addresses that have collateral deposited.
currentCollateral
function currentCollateral(address account) external view returns(uint256);
Function to get the current amount of collateral for an account.
accountAddress of the account.
unassignableCollateral
function unassignableCollateral(address account) external view returns(uint256);
Function to get the current amount of unassignable collateral for an account. After expiration, the unassignable collateral is equal to the account's collateral balance.
accountAddress of the account.
assignableCollateral
function assignableCollateral(address account) external view returns(uint256);
Function to get the current amount of assignable collateral for an account. After expiration, the assignable collateral is zero.
accountAddress of the account.
currentCollateralizedTokens
function currentCollateralizedTokens(address account) external view returns(uint256);
Function to get the current amount of collateralized ACO tokens for an account.
accountAddress of the account.
unassignableTokens
function unassignableTokens(address account) external view returns(uint256);
Function to get the current amount of unassignable ACO tokens for an account. After expiration, the unassignable tokens is equal to the account's collateralized tokens.
accountAddress of the account.
assignableTokens
function assignableTokens(address account) external view returns(uint256);
Function to get the current amount of assignable ACO tokens for an account. After expiration, the assignable tokens is zero.
accountAddress of the account.
getCollateralAmount
function getCollateralAmount(uint256 tokenAmount) external view returns(uint256);
Function to get the equivalent collateral amount for an ACO token amount.
tokenAmountAmount of tokens.
getTokenAmount
function getTokenAmount(uint256 collateralAmount) external view returns(uint256);
Function to get the equivalent token amount for a collateral amount.
collateralAmountAmount of collateral.
getBaseExerciseData
function getBaseExerciseData(uint256 tokenAmount) external view returns(address, uint256);
Function to get the base data for exercise of an amount of ACO tokens. It returns the asset address and the respective base amount that should be sent to get the collateral on exercise.
tokenAmountAmount of ACO tokens that intends to exercise.
getCollateralOnExercise
function getCollateralOnExercise(uint256 tokenAmount) external view returns(uint256, uint256);
Function to get the collateral to be received on an exercise and the respective fee to be charged. The first return is the collateral amount and the second the fee.
tokenAmountAmount of ACO tokens that intends to exercise.
State-Changing Functions
transfer
function transfer(address recipient, uint256 amount) external returns(bool); 
Function to transfer ACO tokens from the transaction sender to an address. Returns always true otherwise, an exception occurred.
recipientThe destination address.amountThe token amount to be transferred.
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns(bool); 
Function to transfer ACO tokens from an address to another. Allowance must be respected. Returns always true otherwise, an exception occurred.
senderThe owner of the tokens.recipientThe destination address.amountThe token amount to be transferred.
approve
function approve(address spender, uint256 amount) external returns(bool); 
Function for the transaction sender set an allowance. Returns always true otherwise, an exception occurred.
spenderWho receives the allowance.amountThe token amount authorized.
increaseAllowance
function increaseAllowance(address spender, uint256 amount) external returns(bool); 
Function for the transaction sender increases an allowance. Returns always true otherwise, an exception occurred.
spenderWho receives the allowance.amountThe token amount that will be increased to the allowance.
decreaseAllowance
function decreaseAllowance(address spender, uint256 amount) external returns(bool);
Function for the transaction sender decreases an allowance. Returns always true otherwise, an exception occurred.
spenderWho receives the allowance.amountThe token amount that will be decreased to the allowance.
init
function init(address _underlying, address _strikeAsset, bool _isCall, uint256 _strikePrice, uint256 _expiryTime, uint256 _acoFee, address payable _feeDestination, uint256 _maxExercisedAccounts) external;
Function to initialize the contract. It is called when creating the ACO token by the ACO Factory. It must be called only once. The first require is to guarantee that behavior.
_underlyingAddress of the underlying asset (address(0)for Ethereum)._strikeAssetAddress of the strike asset (address(0)for Ethereum)._isCallTrue if the type is CALL, false for PUT._strikePriceThe strike price with the strike asset precision._expiryTimeThe UNIX time for the token expiration._acoFeeValue of the ACO fee. It is a percentage value (100000 is 100%)._feeDestinationAddress of the fee destination charged on the exercise._maxExercisedAccountsThe maximum number of accounts that can be exercised by transaction.
mintPayable
function mintPayable() external payable; 
Function to mint ACO tokens when Ether is required as collateral. The transaction sender will receive the equivalent amount of tokens to the Ether deposited.
mintToPayable
function mintToPayable(address account) external payable; 
Function to mint ACO tokens when Ether is required as collateral but this collateral ownership is set to a specific account. The transaction sender, not the account informed, will receive the equivalent amount of tokens to the Ether deposited.
accountThe account that will be considered as the owner of the collateral deposited.
mint
function mint(uint256 collateralAmount) external; 
Function to mint ACO tokens when an ERC20 token is required as collateral. The transaction sender will receive the equivalent amount of tokens to the asset deposited.
collateralAmountAmount of collateral to be deposited.
mintTo
function mintTo(address account, uint256 collateralAmount) external; 
Function to mint ACO tokens when an ERC20 asset is required as collateral but this collateral ownership is set to a specific account. The transaction sender, not the account informed, will receive the equivalent amount of tokens to the asset deposited.
accountThe account that will be considered as the owner of the collateral deposited.collateralAmountAmount of collateral to be deposited.
burn
function burn(uint256 tokenAmount) external; 
Function to burn ACO tokens and get the equivalent collateral amount, not assigned, back. The transaction sender must have collateral deposited besides the ACO tokens.
tokenAmountAmount of tokens to be burned.
burnFrom
function burnFrom(address account, uint256 tokenAmount) external; 
Function to burn ACO tokens from a specific account and get the equivalent collateral amount, not assigned, back. The informed account must have collateral deposited besides the ACO tokens. The collateral is sent to the transaction sender, not to the account informed.
accountAddress of the account that has the ACO tokens and collateral deposited.tokenAmountAmount of tokens to be burned.
exercise
function exercise(uint256 tokenAmount, uint256 salt) external payable; 
Function to exercise the ACO tokens, paying to get the equivalent collateral. The paid amount is sent to the collateral owners that were assigned. See getBaseExerciseData to check which asset and the amount that should be paid. 
tokenAmountAmount of ACO tokens to be exercised.saltA random number used to calculate the start index of the array of accounts to be exercised.
exerciseFrom
function exerciseFrom(address account, uint256 tokenAmount, uint256 salt) external payable; 
Function to exercise the tokens from an account, paying to get the equivalent collateral. The paid amount is sent to the collateral owners that were assigned. The collateral is transferred to the transaction sender, not to the account informed. See getBaseExerciseData to check which asset and the amount that should be paid.
accountAddress of the account that has the ACO tokens.tokenAmountAmount of ACO tokens to be exercised.saltA random number used to calculate the start index of the array of accounts to be exercised.
exerciseAccounts
function exerciseAccounts(uint256 tokenAmount, address[] calldata accounts) external payable; 
Function to exercise the ACO tokens, paying to get the equivalent collateral. The paid amount is sent to the collateral owners that were assigned. See getBaseExerciseData to check which asset and the amount that should be paid. 
tokenAmountAmount of ACO tokens to be exercised.accountsThe array of addresses to try to exercise and get collateral from.
exerciseAccountsFrom
function exerciseAccountsFrom(address account, uint256 tokenAmount, address[] calldata accounts) external payable;
Function to exercise the tokens from an account, paying to get the equivalent collateral. The paid amount is sent to the collateral owners (on accounts array) that were assigned. The collateral is transferred to the transaction sender, not to the account informed. See getBaseExerciseData to check which asset and the amount that should be paid.
accountAddress of the account that has the ACO tokens.tokenAmountAmount of ACO tokens to be exercised.accountsThe array of addresses to try to exercise and get collateral from.
redeem
function redeem() external; 
Function to the transaction sender gets all the collateral deposited, not assigned, back.
redeemFrom
function redeemFrom(address account) external; 
Function to get all the collateral deposited from a specific account, not assigned, back. The collateral is sent to the transaction sender, not to the account informed.
accountAddress of the account that has the collateral deposited.
ABI
Last updated
Was this helpful?