TrustSwap Token
ERC20
This contract is an ERC20 token.
About link
Identical Contracts
The following contracts have identical source code.
Stats
Library Use
Events (10) keyboard_arrow_up
State Variables (28) keyboard_arrow_up
Functions
owner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
);
return true;
}
registerLockableAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function registerLockableAccount(
address newMemberAddress,
uint256 _lockedUntilDate
) external onlyOwner {
require(
newMemberAddress != address(0),
"ERC20Lockable: Registered account cannot be from address(0)"
);
_lockableAccounts[newMemberAddress] = Account(_lockedUntilDate, true);
emit RegisteredNewLockableAccount(newMemberAddress);
}
registerUnlockableAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function registerUnlockableAccount(address newUnlockableAddress)
external
onlyOwner
{
require(
newUnlockableAddress != address(0),
"ERC20Lockable: Registered account cannot be from address(0)"
);
_unlockableAddresses[newUnlockableAddress] = true;
emit RegisteredNewUnlockableAccount(newUnlockableAddress);
}
getLockDateForAccount keyboard_arrow_up
Source Code
function getLockDateForAccount(address lockedAccountAddress)
external
view
returns (uint256)
{
require(
_lockableAccounts[lockedAccountAddress].exists,
"ERC20Lockable: This address does not exist."
);
return _lockableAccounts[lockedAccountAddress].lockedUntilDate;
}
disableUnlockableAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function disableUnlockableAccount(address unlockableAddress)
external
onlyOwner
{
require(
_unlockableAddresses[unlockableAddress],
"ERC20Lockable: This address does not exists or it is already disabled."
);
_unlockableAddresses[unlockableAddress] = false;
emit DisabledUnlockableAccount(unlockableAddress);
}
token keyboard_arrow_up
beneficiary keyboard_arrow_up
releaseTime keyboard_arrow_up
release keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function release() public virtual {
// solhint-disable-next-line not-rely-on-time
require(
block.timestamp >= _releaseTime,
"TokenTimelock: current time is before release time"
);
uint256 amount = _token.balanceOf(address(this));
require(amount > 0, "TokenTimelock: no tokens to release");
_token.safeTransfer(_beneficiary, amount);
}
cap keyboard_arrow_up
paused keyboard_arrow_up
burn keyboard_arrow_up
burnFrom keyboard_arrow_up
Requirements help
Source Code
function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(
amount,
"ERC20: burn amount exceeds allowance"
);
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
hasRole keyboard_arrow_up
getRoleMemberCount keyboard_arrow_up
getRoleMember keyboard_arrow_up
getRoleAdmin keyboard_arrow_up
grantRole keyboard_arrow_up
Requirements help
Source Code
function grantRole(bytes32 role, address account) public virtual {
require(
hasRole(_roles[role].adminRole, _msgSender()),
"AccessControl: sender must be an admin to grant"
);
_grantRole(role, account);
}
revokeRole keyboard_arrow_up
Requirements help
Source Code
function revokeRole(bytes32 role, address account) public virtual {
require(
hasRole(_roles[role].adminRole, _msgSender()),
"AccessControl: sender must be an admin to revoke"
);
_revokeRole(role, account);
}
renounceRole keyboard_arrow_up
Requirements help
Source Code
function renounceRole(bytes32 role, address account) public virtual {
require(
account == _msgSender(),
"AccessControl: can only renounce roles for self"
);
_revokeRole(role, account);
}
initialize keyboard_arrow_up
Source Code
function initialize(
string memory name,
string memory symbol,
uint256 cap
) public override {
super.initialize(name, symbol, cap);
__ERC20UpgradeBase_init();
}
mint keyboard_arrow_up
Source Code
function mint(address to, uint256 amount) public {
require(
hasRole(MINTER_ROLE, _msgSender()),
"ERC20PresetMinterPauser: must have minter role to mint"
);
_mint(to, amount);
}
pause keyboard_arrow_up
unpause keyboard_arrow_up
__ERC20UpgradeBase_init keyboard_arrow_up
initialize keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
initializer checks for the following:
Source Code
function initialize() public initializer {
ERC20UpgradeBase.initialize(
"Next Innovation",
"NIN",
1000000000 * (10**uint256(decimals()))
);
_setupDecimals(6);
mint(msg.sender, 1000000000 * (10**uint256(decimals())));
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20UpgradeBase._beforeTokenTransfer keyboard_arrow_up
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
)
internal
override(ERC20PresetMinterPauserUpgradeSafe, ERC20LockableUpgradeSafe)
{
super._beforeTokenTransfer(from, to, amount);
}
internal ERC20PresetMinterPauserUpgradeSafe.__ERC20PresetMinterPauser_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20PresetMinterPauser_init(
string memory name,
string memory symbol,
uint256 cap
) internal initializer {
__Context_init_unchained();
__AccessControl_init_unchained();
__ERC20_init_unchained(name, symbol);
__ERC20Burnable_init_unchained();
__ERC20Capped_init_unchained(cap);
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
// __ERC20PresetMinterPauser_init_unchained(name, symbol); // Removed args to prevent compiler warning
__ERC20PresetMinterPauser_init_unchained();
}
internal ERC20PresetMinterPauserUpgradeSafe.__ERC20PresetMinterPauser_init_unchained keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
initializer checks for the following:
Source Code
function __ERC20PresetMinterPauser_init_unchained() internal initializer {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(MINTER_ROLE, _msgSender());
_setupRole(PAUSER_ROLE, _msgSender());
}
internal ERC20PresetMinterPauserUpgradeSafe._beforeTokenTransfer keyboard_arrow_up
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
)
internal
virtual
override(ERC20UpgradeSafe, ERC20CappedUpgradeSafe, ERC20PausableUpgradeSafe)
{
super._beforeTokenTransfer(from, to, amount);
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal AccessControlUpgradeSafe.__AccessControl_init keyboard_arrow_up
internal AccessControlUpgradeSafe.__AccessControl_init_unchained keyboard_arrow_up
internal AccessControlUpgradeSafe._setupRole keyboard_arrow_up
internal AccessControlUpgradeSafe._setRoleAdmin keyboard_arrow_up
internal AccessControlUpgradeSafe._grantRole keyboard_arrow_up
internal AccessControlUpgradeSafe._revokeRole keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20BurnableUpgradeSafe.__ERC20Burnable_init keyboard_arrow_up
internal ERC20BurnableUpgradeSafe.__ERC20Burnable_init_unchained keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20UpgradeSafe.__ERC20_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init(string memory name, string memory symbol)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
internal ERC20UpgradeSafe.__ERC20_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init_unchained(string memory name, string memory symbol)
internal
initializer
{
_name = name;
_symbol = symbol;
_decimals = 18;
}
internal ERC20UpgradeSafe._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal ERC20UpgradeSafe._mint keyboard_arrow_up
Source Code
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
internal ERC20UpgradeSafe._burn keyboard_arrow_up
Requirements help
Source Code
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(
amount,
"ERC20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
internal ERC20UpgradeSafe._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal ERC20UpgradeSafe._setupDecimals keyboard_arrow_up
internal ERC20UpgradeSafe._beforeTokenTransfer keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20PausableUpgradeSafe.__ERC20Pausable_init keyboard_arrow_up
internal ERC20PausableUpgradeSafe.__ERC20Pausable_init_unchained keyboard_arrow_up
internal ERC20PausableUpgradeSafe._beforeTokenTransfer keyboard_arrow_up
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
require(!paused(), "ERC20Pausable: token transfer while paused");
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20UpgradeSafe.__ERC20_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init(string memory name, string memory symbol)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
internal ERC20UpgradeSafe.__ERC20_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init_unchained(string memory name, string memory symbol)
internal
initializer
{
_name = name;
_symbol = symbol;
_decimals = 18;
}
internal ERC20UpgradeSafe._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal ERC20UpgradeSafe._mint keyboard_arrow_up
Source Code
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
internal ERC20UpgradeSafe._burn keyboard_arrow_up
Requirements help
Source Code
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(
amount,
"ERC20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
internal ERC20UpgradeSafe._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal ERC20UpgradeSafe._setupDecimals keyboard_arrow_up
internal ERC20UpgradeSafe._beforeTokenTransfer keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal PausableUpgradeSafe.__Pausable_init keyboard_arrow_up
internal PausableUpgradeSafe.__Pausable_init_unchained keyboard_arrow_up
internal PausableUpgradeSafe._pause keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
internal PausableUpgradeSafe._unpause keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20CappedUpgradeSafe.__ERC20Capped_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20Capped_init(uint256 cap) internal initializer {
__Context_init_unchained();
__ERC20Capped_init_unchained(cap);
}
internal ERC20CappedUpgradeSafe.__ERC20Capped_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20Capped_init_unchained(uint256 cap) internal initializer {
require(cap > 0, "ERC20Capped: cap is 0");
_cap = cap;
}
internal ERC20CappedUpgradeSafe._beforeTokenTransfer keyboard_arrow_up
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) {
// When minting tokens
require(totalSupply().add(amount) <= _cap, "ERC20Capped: cap exceeded");
}
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20UpgradeSafe.__ERC20_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init(string memory name, string memory symbol)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
internal ERC20UpgradeSafe.__ERC20_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init_unchained(string memory name, string memory symbol)
internal
initializer
{
_name = name;
_symbol = symbol;
_decimals = 18;
}
internal ERC20UpgradeSafe._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal ERC20UpgradeSafe._mint keyboard_arrow_up
Source Code
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
internal ERC20UpgradeSafe._burn keyboard_arrow_up
Requirements help
Source Code
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(
amount,
"ERC20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
internal ERC20UpgradeSafe._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal ERC20UpgradeSafe._setupDecimals keyboard_arrow_up
internal ERC20UpgradeSafe._beforeTokenTransfer keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal TokenTimelockUpgradeSafe.__TokenTimelock_init keyboard_arrow_up
internal TokenTimelockUpgradeSafe.__TokenTimelock_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Requirements help
Source Code
function __TokenTimelock_init_unchained(
IERC20 token,
address beneficiary,
uint256 releaseTime
) internal initializer {
// solhint-disable-next-line not-rely-on-time
require(
releaseTime > block.timestamp,
"TokenTimelock: release time is before current time"
);
_token = token;
_beneficiary = beneficiary;
_releaseTime = releaseTime;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal OwnableUpgradeSafe.__Ownable_init keyboard_arrow_up
internal OwnableUpgradeSafe.__Ownable_init_unchained keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20LockableUpgradeSafe.__ERC20Lockable_init keyboard_arrow_up
internal ERC20LockableUpgradeSafe.__ERC20Lockable_init_unchained keyboard_arrow_up
internal ERC20LockableUpgradeSafe._beforeTokenTransfer keyboard_arrow_up
Requirements help
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
// Locked accounts could transfer token to other empty locked accounts
//(_lockableAccounts[from].exists && _lockableAccounts[to].exists && balanceOf(to) == 0) ||
// Receiver requirements:
require(
(_unlockableAddresses[from]) ||
// Receiver must be either anonymous or an expired locked account
(!_lockableAccounts[to].exists ||
(_lockableAccounts[to].exists &&
_lockableAccounts[to].lockedUntilDate < block.timestamp)),
"ERC20Lockable: Receiver's wallet is locked. This transaction is not permitted."
);
// Sender requirements:
require(
(_unlockableAddresses[from]) ||
// Sender must be either anonymous or an expired account.
(!_lockableAccounts[from].exists ||
(_lockableAccounts[from].exists &&
_lockableAccounts[from].lockedUntilDate < block.timestamp)),
"ERC20Lockable: Sender's wallet is locked. This transaction is not permitted."
);
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ERC20UpgradeSafe.__ERC20_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init(string memory name, string memory symbol)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
internal ERC20UpgradeSafe.__ERC20_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __ERC20_init_unchained(string memory name, string memory symbol)
internal
initializer
{
_name = name;
_symbol = symbol;
_decimals = 18;
}
internal ERC20UpgradeSafe._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal ERC20UpgradeSafe._mint keyboard_arrow_up
Source Code
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
internal ERC20UpgradeSafe._burn keyboard_arrow_up
Requirements help
Source Code
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(
amount,
"ERC20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
internal ERC20UpgradeSafe._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal ERC20UpgradeSafe._setupDecimals keyboard_arrow_up
internal ERC20UpgradeSafe._beforeTokenTransfer keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal OwnableUpgradeSafe.__Ownable_init keyboard_arrow_up
internal OwnableUpgradeSafe.__Ownable_init_unchained keyboard_arrow_up
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
internal ContextUpgradeSafe.__Context_init keyboard_arrow_up
internal ContextUpgradeSafe.__Context_init_unchained keyboard_arrow_up
internal ContextUpgradeSafe._msgSender keyboard_arrow_up
internal ContextUpgradeSafe._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
internal Initializable.isConstructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}