Tokenomics
Technical Specification
Version: 1.0.0 Solidity: ^0.8.20 (OpenZeppelin v5)
Overview
Neurons is an ERC‑20 token with:
A fixed max supply cap of 10,000,000 NEURONS
Minting gated by roles (MINTER_ROLE)
Burn (self-burn) and burnFrom (allowed for BURNER_ROLE)
Pausability (ERC20Pausable) to halt transfers/mints/burns during incidents
Permit (EIP‑2612) support via ERC20Permit
Integration with external systems: PoK and bridge (LayerZero OFT Adapter)
Contract: contracts/src/tokens/Neurons.sol
Interfaces and inheritance
OpenZeppelin v5:
ERC20ERC20CappedERC20PermitERC20PausableOwnableAccessControl
Internal library:
Errors.sol
Constants and roles
MAX_SUPPLY = 10_000_000 etherMINTER_ROLE = keccak256("MINTER_ROLE")BURNER_ROLE = keccak256("BURNER_ROLE")
Events
MinterUpdated(address minter, bool allowed)BurnerUpdated(address burner, bool allowed)TokensMinted(address to, uint256 amount, address minter)TokensBurned(address from, uint256 amount, address burner)
Relevant errors (Errors.sol)
ZeroAddress()InvalidAmount()CapExceeded()(in batch mint when the sum exceeds the cap)ArrayLengthMismatch()
Functions — Neurons contract
Administration (owner):
setMinter(address minter, bool allowed)setBurner(address burner, bool allowed)pause()/unpause()
Mint/Burn:
mint(address to, uint256 amount)— requiresMINTER_ROLEbatchMint(address[] recipients, uint256[] amounts)— requiresMINTER_ROLEburn(uint256 amount)— burns frommsg.senderburnFrom(address account, uint256 amount)— requiresBURNER_ROLE
View:
remainingSupply() -> uint256isMinter(address) -> boolisBurner(address) -> bool
Permit (EIP‑2612):
Inherited from
ERC20Permit(name: "Neurons")permit(owner, spender, value, deadline, v, r, s)nonces(owner)andDOMAIN_SEPARATOR()
Internal overrides:
_update(OZ v5):override(ERC20, ERC20Pausable, ERC20Capped)— keeps cap/pause logic centralized in_update.
Usage flows
Mint is controlled by orchestrators (e.g.,
PoKMinter) havingMINTER_ROLE.Burn to reduce a user balance or operationally via
BURNER_ROLE(e.g., bridge adapter in burn/mint mode).Pause for incident response; pauses block transfer/mint/burn.
Permit for off-chain signed approvals.
Security considerations
Only the
ownermanages minter/burner roles.Avoid granting
MINTER_ROLEto more entities than necessary.Audit
TokensMinted/TokensBurnedevents for traceability.Pause as an emergency mechanism.
Integrations
PoKMintercallsmint(); it must holdMINTER_ROLE.NeuronsOFTAdaptermay callburnFrom()andmint()on the destination; ensureBURNER_ROLE/MINTER_ROLEaccording to the bridge mode.
Last updated
Was this helpful?