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

EspToken

Git Source

Inherits: Initializable, ERC20Upgradeable, OwnableUpgradeable, UUPSUpgradeable

Title: EspToken

ERC20 token for the Espresso network, upgradeable via UUPS.

Upgradeability & storage layout (frozen-inheritance pattern) We intentionally do not use __gap slots. Once a version is deployed, its storage layout is frozen and never modified. New state variables are added only in a new child contract (V2, V3, …) that inherits from the previous version and appends fields at the end. This preserves slot order across upgrades without relying on gaps. (Note: upstream OZ parents may include their own gaps—those remain untouched.)

Functions

constructor

since the constructor initializes storage on this contract we disable it

storage is on the proxy contract since it calls this contract via delegatecall

Note: oz-upgrades-unsafe-allow: constructor

constructor() ;

initialize

This contract is called by the proxy when you deploy this contract

function initialize(
    address owner,
    address initialRecipient,
    uint256 initialSupply,
    string memory name,
    string memory symbol
) public initializer;

_authorizeUpgrade

only the owner can authorize an upgrade

function _authorizeUpgrade(address newImplementation) internal virtual override onlyOwner;

renounceOwnership

Cannot renounce ownership

Override renounceOwnership() to revert, preventing accidental or malicious ownership renunciation

function renounceOwnership() public virtual override onlyOwner;

getVersion

Use this to get the implementation contract version

function getVersion()
    public
    pure
    virtual
    returns (uint8 majorVersion, uint8 minorVersion, uint8 patchVersion);

Errors

OwnershipCannotBeRenounced

Cannot renounce ownership

error OwnershipCannotBeRenounced();