Skip to main content

OsToken

Git Source ↗

Inherits: Ownable2Step ↗, ERC20Permit ↗, IOsToken

OsToken is an over-collateralized staked token

State Variables​

_vaultController​

address private immutable _vaultController

controllers​

mapping(address controller => bool enabled) public override controllers

Functions​

constructor​

Constructor

constructor(address _owner, address vaultController, string memory _name, string memory _symbol)
ERC20(_name, _symbol)
ERC20Permit(_name)
Ownable(_owner);

Parameters

NameTypeDescription
_owneraddressThe address of the contract owner
vaultControlleraddressThe address of the OsTokenVaultController contract
_namestringThe name of the ERC20 token
_symbolstringThe symbol of the ERC20 token

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