OsToken
Inherits: Ownable2Step ↗, ERC20Permit ↗, IOsToken
OsToken is an over-collateralized staked token.
Events
ControllerUpdated
Emitted when a controller is updated
event ControllerUpdated(address indexed controller, bool registered);
Parameters
| Name | Type | Description |
|---|---|---|
controller | address | The address of the controller |
registered | bool | Whether the controller is registered or not |
Functions
controllers
Returns whether controller is registered or not
function controllers(address controller) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
controller | address | The address of the controller |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | Whether the controller is registered or not |
onlyController
Throws if called by any account other than the controller.
modifier onlyController() ;
mint
Mint OsToken. Can only be called by the controller.
function mint(address account, uint256 value) external override onlyController;
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the account to mint OsToken for |
value | uint256 | The amount of OsToken to mint |
burn
Burn OsToken. Can only be called by the controller.
function burn(address account, uint256 value) external override onlyController;
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the account to burn OsToken for |
value | uint256 | The amount of OsToken to burn |
nonces
Returns the current nonce for owner. This value must be
included whenever a signature is generated for permit.
Every successful call to permit increases owner's nonce by one. This
prevents a signature from being used multiple times.
function nonces(address owner) public view virtual override(ERC20Permit, IERC20Permit) returns (uint256);
setController
Enable or disable the controller. Can only be called by the contract owner.
function setController(address controller, bool enabled) external override onlyOwner;
Parameters
| Name | Type | Description |
|---|---|---|
controller | address | The address of the controller |
enabled | bool |