Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OptionToken

Git Source

Title: OptionToken

EIP-1167 Minimal Proxy Implementation for Option Series.

Constants

decimals

uint8 public constant decimals = 18

State Variables

name

string public name

symbol

string public symbol

totalSupply

uint256 public totalSupply

balanceOf

mapping(address => uint256) public balanceOf

allowance

mapping(address => mapping(address => uint256)) public allowance

marginEngine

address public marginEngine

_initialized

bool private _initialized

Functions

constructor

constructor() ;

onlyEngine

modifier onlyEngine() ;

initialize

Initialize the proxy (called once by MarginEngine).

function initialize(
    string memory _name,
    string memory _symbol,
    address _marginEngine
) external;

mint

function mint(
    address to,
    uint256 amount
) external onlyEngine;

burn

function burn(
    address from,
    uint256 amount
) external onlyEngine;

approve

function approve(
    address spender,
    uint256 amount
) external returns (bool);

transfer

function transfer(
    address to,
    uint256 amount
) external returns (bool);

transferFrom

function transferFrom(
    address from,
    address to,
    uint256 amount
) external returns (bool);

Events

Transfer

event Transfer(address indexed from, address indexed to, uint256 value);

Approval

event Approval(address indexed owner, address indexed spender, uint256 value);

Initialized

event Initialized(string name, string symbol, address marginEngine);

Errors

OptionToken__AlreadyInitialized

error OptionToken__AlreadyInitialized();

OptionToken__Unauthorized

error OptionToken__Unauthorized();

OptionToken__InsufficientBalance

error OptionToken__InsufficientBalance();

OptionToken__InsufficientAllowance

error OptionToken__InsufficientAllowance();

OptionToken__ZeroAddress

error OptionToken__ZeroAddress();