BTSE Token
ERC20
This contract is an ERC20 token.
About link description
Stats
Events (6) keyboard_arrow_up
Constants (4) keyboard_arrow_up
State Variables (17) keyboard_arrow_up
Functions
paused keyboard_arrow_up
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;
}
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
burn keyboard_arrow_up
Requirements help
Source Code
function burn(address from, uint256 amount) public {
require(
hasRole(BURNER_ROLE, msg.sender),
"BTSE: must have burner role to burn"
); // _msgSender() ?
_burn(from, amount);
}
mint keyboard_arrow_up
Source Code
function mint(address to, uint256 amount) public {
require(
hasRole(MINTER_ROLE, msg.sender),
"BTSE: must have minter role to mint"
);
_mint(to, amount);
}
pause keyboard_arrow_up
unpause keyboard_arrow_up
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 BTSE.__BTSE_init keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __BTSE_init(
string memory name,
string memory symbol,
address admin
) internal initializer {
__Context_init_unchained();
__AccessControl_init_unchained();
__ERC20_init_unchained(name, symbol);
__ERC20Burnable_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
__BTSE_init_unchained(name, symbol, admin);
}
internal BTSE.__BTSE_init_unchained keyboard_arrow_up
Modifiers help
initializer checks for the following:
Source Code
function __BTSE_init_unchained(
string memory name,
string memory symbol,
address admin
) internal initializer {
_setupRole(DEFAULT_ADMIN_ROLE, admin);
_setupRole(MINTER_ROLE, admin);
_setupRole(BURNER_ROLE, admin);
_setupRole(PAUSER_ROLE, admin);
_setupDecimals(8);
}
internal BTSE._beforeTokenTransfer keyboard_arrow_up
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal override(ERC20UpgradeSafe, 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;
}