unshETH - Dependencies
ERC20PermitPermissionedMint.sol
This file defines a smart contract ERC20PermitPermissionedMint
that extends OpenZeppelin's ERC20Permit
, ERC20Burnable
and Owned
. It includes functionalities to add and remove minters, mint new tokens, burn tokens, and change the timelock address. The contract is used for managing an ERC20 token with permit functionality and burnable feature, also allows permissioned minting by a list of authorized minters.
ERC20PermitPermissionedMint
The main contract that extends ERC20Permit, ERC20Burnable and Owned contracts. It includes functionalities to manage an ERC20 token with permit functionality and burnable feature. It also allows permissioned minting by a list of authorized minters.
Errors
- Not owner or timelock: This error occurs when the sender is not the owner or the timelock.
- Only minters: This error occurs when the sender is not a minter.
- Zero address detected: This error occurs when the provided address is zero.
- Address already exists: This error occurs when trying to add a minter that already exists.
- Address nonexistant: This error occurs when trying to remove a minter that does not exist.
minter_burn_from
function minter_burn_from(address b_address, uint256 b_amount) public
This function is used by minters to burn tokens from a given address.
Parameters
- b_address address: The address from which the tokens will be burned.
- b_amount uint256: The amount of tokens to be burned.
minter_mint
function minter_mint(address m_address, uint256 m_amount) public
This function is used by minters to mint new tokens to a given address.
Parameters
- m_address address: The address to which the tokens will be minted.
- m_amount uint256: The amount of tokens to be minted.
addMinter
function addMinter(address minter_address) public
This function is used to add a new minter to the list of authorized minters.
Parameters
- minter_address address: The address of the new minter.
removeMinter
function removeMinter(address minter_address) public
This function is used to remove a minter from the list of authorized minters.
Parameters
- minter_address address: The address of the minter to be removed.
setTimelock
function setTimelock(address _timelock_address) public
This function is used to change the timelock address.
Parameters
- _timelock_address address: The new timelock address.