Skip to main content

OsToken

Git Source ↗

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

NameTypeDescription
controlleraddressThe address of the controller
registeredboolWhether the controller is registered or not

Functions​

controllers​

Returns whether controller is registered or not

function controllers(address controller) external view returns (bool);

Parameters

NameTypeDescription
controlleraddressThe address of the controller

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
accountaddressThe address of the account to mint OsToken for
valueuint256The 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

NameTypeDescription
accountaddressThe address of the account to burn OsToken for
valueuint256The 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

NameTypeDescription
controlleraddressThe address of the controller
enabledbool