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

ERC20CappedUpgradeable

Inherits: Initializable, ERC20Upgradeable

Extension of {ERC20} that adds a cap to the supply of tokens.

State Variables

ERC20CappedStorageLocation

bytes32 private constant ERC20CappedStorageLocation = 0x0f070392f17d5f958cc1ac31867dabecfc5c9758b4a419a200803226d7155d00;

Functions

_getERC20CappedStorage

function _getERC20CappedStorage() private pure returns (ERC20CappedStorage storage $);

__ERC20Capped_init

Sets the value of the cap. This value is immutable, it can only be set once during construction.

function __ERC20Capped_init(uint256 cap_) internal onlyInitializing;

__ERC20Capped_init_unchained

function __ERC20Capped_init_unchained(uint256 cap_) internal onlyInitializing;

cap

Returns the cap on the token's total supply.

function cap() public view virtual returns (uint256);

_update

Transfers a value amount of tokens from from to to, or alternatively mints (or burns) if from (or to) is the zero address. All customizations to transfers, mints, and burns should be done by overriding this function. Emits a {Transfer} event.

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

Errors

ERC20ExceededCap

Total supply cap has been exceeded.

error ERC20ExceededCap(uint256 increasedSupply, uint256 cap);

ERC20InvalidCap

The supplied cap is not a valid cap.

error ERC20InvalidCap(uint256 cap);

Structs

ERC20CappedStorage

Note: storage-location: erc7201:openzeppelin.storage.ERC20Capped

struct ERC20CappedStorage {
    uint256 _cap;
}