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

ShareXToken

Git Source

Inherits: ERC20Burnable, ERC20Permit, ERC20Capped

Title: ShareX Token Contract

Implements an ERC20 token with a cap, burnability features

Functions

constructor

Initializes the contract with a name, symbol, cap

constructor(address _recipient)
    ERC20("ShareX Token", "SHARE")
    ERC20Permit("ShareX Token")
    ERC20Capped(10 ** 8 * 10 ** 18);

_update

Internal function to update state during transfers, respecting the cap

function _update(address from, address to, uint256 value)
    internal
    override(ERC20, ERC20Capped);

Parameters

NameTypeDescription
fromaddressThe address sending the tokens
toaddressThe address receiving the tokens
valueuint256The amount of tokens being transferred