sElUSD
Inherits: ElaraBase, IsElUSD, ERC20PermitUpgradeable
Title: Staked Elara USD Token Contract
ERC20 token representing shares in the ElUSD staking pool
Implements a simple share token with permit and pause functionality Invariants:
Only authorized staking contracts can mint or burn tokens
Token transfers are paused when contract is paused
Total supply increases only when users stake ElUSD
Total supply decreases only when users unstake ElUSD Upgradeability:
Uses ElaraBase for UUPS upgradeability
Initializer must be called exactly once; preserve storage layout
Note: security-contact: [email protected]
State Variables
__gap
Reserved storage gap for future upgrades to prevent storage collisions
uint256[50] private __gapFunctions
initialize
Initializes the sElUSD token contract with core parameters
Security:
Only callable during initialization via {initializer} modifier
Sets up ERC20 token with name and symbol via {__ERC20_init}
Enables permit functionality via {__ERC20Permit_init}
Establishes access control via {__ElaraBase_init}
Critical for token initialization; must be called exactly once per proxy
Parameters
_accessManager
address
Address of the AccessManager contract
_name
string
The name of the token
_symbol
string
The symbol of the token
mint
Reverts if to is zero address. Emits {Minted} event on success.
burn
Reverts if from is zero address. Emits {Burned} event on success.
_update
Hook called before any token transfer to enforce pause
Security:
Protected by {whenNotPaused} modifier to prevent transfers when paused
Overrides ERC20Upgradeable-_update to add custom transfer restrictions
Parameters
from
address
Source address (address(0) for minting)
to
address
Destination address (address(0) for burning)
value
uint256
Amount to transfer (18 decimals)
Last updated
Was this helpful?