LeverageToken
This contract implements a leverage token with upgradeable capabilities, access control, and pausability.
State Variables
MINTER_ROLE
Role identifier for accounts with minting privileges
GOV_ROLE
Role identifier for accounts with governance privileges
Functions
constructor
Note: constructor
initialize
Initializes the contract with a name, symbol, minter, and governance address.
Parameters
name
string
The name of the token
symbol
string
The symbol of the token
minter
address
The address that will have minting privileges
governance
address
The address that will have governance privileges
mint
Can only be called by addresses with the MINTER_ROLE.
Mints new tokens to the specified address.
Parameters
to
address
The address that will receive the minted tokens
amount
uint256
The amount of tokens to mint
burn
Can only be called by addresses with the MINTER_ROLE.
Burns tokens from the specified account.
Parameters
account
address
The account from which tokens will be burned
amount
uint256
The amount of tokens to burn
_update
This function is called during token transfer and is paused when the contract is paused.
Internal function to update user assets after a transfer.
Parameters
from
address
The address tokens are transferred from
to
address
The address tokens are transferred to
amount
uint256
The amount of tokens transferred
grantRole
Can only be called by addresses with the GOV_ROLE.
Grants a role to an account.
Parameters
role
bytes32
The role being granted
account
address
The account receiving the role
revokeRole
Can only be called by addresses with the GOV_ROLE.
Revokes a role from an account.
Parameters
role
bytes32
The role being revoked
account
address
The account losing the role
pause
Can only be called by addresses with the GOV_ROLE. Does not prevent contract upgrades.
Pauses all token transfers, mints, burns, and indexing updates.
unpause
Can only be called by addresses with the GOV_ROLE.
Unpauses all token transfers, mints, burns, and indexing updates.
_authorizeUpgrade
Can only be called by the owner of the contract.
Internal function to authorize an upgrade to a new implementation.
Parameters
Last updated