Stats
Public Functions
7
Event Types
3
Code Size
28,363 bytes
Events (3)
keyboard_arrow_up
AdminAdded
Event
Parameters
help
Event parameters list the data that an event contains.
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
AdminRemoved
Event
Parameters
help
Event parameters list the data that an event contains.
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
TokenDeployed
Event
Parameters
help
Event parameters list the data that an event contains.
contractAddress |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
owner |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
name |
string help
The type of this value is string, which is basically just plain text. It's called a string because it is a 'string' of letters.
|
symbol |
string help
The type of this value is string, which is basically just plain text. It's called a string because it is a 'string' of letters.
|
State Variables (3)
keyboard_arrow_up
tokenAdmin
Variable
address
help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
price
Variable
uint256
help
The type of this value is uint, which stands for unsigned integer. Integer means it's a whole number (such as 1, 12, 52) without fractions or decimals. Unsigned means it can't have a negative or positive sign, so it's always a positive number.
admins
Variable
Roles.Role
help
The type of this value is other.
isAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
view
Source Code
function isAdmin(address account) public view returns (bool) {
return admins.has(account);
}
addAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Modifiers
help
Modifiers are additions to a function that typically make various checks before
the function is run.
onlyAdmin
checks for the following:
Source Code
function addAdmin(address account) public onlyAdmin {
_addAdmin(account);
}
removeAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Modifiers
help
Modifiers are additions to a function that typically make various checks before
the function is run.
onlyAdmin
checks for the following:
Source Code
function removeAdmin(address account) public onlyAdmin {
_removeAdmin(account);
}
setPrice
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
newPrice |
uint256 help
The type of this value is uint, which stands for unsigned integer. Integer means it's a whole number (such as 1, 12, 52) without fractions or decimals. Unsigned means it can't have a negative or positive sign, so it's always a positive number.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Modifiers
help
Modifiers are additions to a function that typically make various checks before
the function is run.
onlyAdmin
checks for the following:
Source Code
function setPrice(uint256 newPrice) public onlyAdmin {
price = newPrice;
}
setTokenAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Modifiers
help
Modifiers are additions to a function that typically make various checks before
the function is run.
onlyAdmin
checks for the following:
Source Code
function setTokenAdmin(address account) public onlyAdmin {
tokenAdmin = account;
}
deployToken
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
name |
string help
The type of this value is string, which is basically just plain text. It's called a string because it is a 'string' of letters.
|
symbol |
string help
The type of this value is string, which is basically just plain text. It's called a string because it is a 'string' of letters.
|
burnable |
bool help
The type of this value is other.
|
enumerable |
bool help
The type of this value is other.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
payable
Requirements
help
Requirements are checks that the function makes when it runs, and give you
insight on what conditions are required for the function to succeed.
Source Code
function deployToken(
string name,
string symbol,
bool burnable,
bool enumerable
) public payable returns (address) {
require(msg.value == price, "Must send price in ether to create a token");
NfToken token = new NfToken(
name,
symbol,
burnable,
enumerable,
msg.sender,
tokenAdmin
);
emit TokenDeployed(token, msg.sender, name, symbol);
return token;
}
withdraw
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
This function has no parameters.
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
public
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Modifiers
help
Modifiers are additions to a function that typically make various checks before
the function is run.
onlyAdmin
checks for the following:
Source Code
function withdraw() public onlyAdmin {
msg.sender.transfer(address(this).balance);
}
Internal functions are parts of the contract that can't be used directly, but instead are used by
the public functions listed above.
internal AdminRole._addAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
internal
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Source Code
function _addAdmin(address account) internal {
admins.add(account);
emit AdminAdded(account);
}
internal AdminRole._removeAdmin
keyboard_arrow_up
Parameters
help
Function parameters list what input the function expects from the user. Each
parameter must be given a value.
Name |
Type |
account |
address help
The type of this value is address, which means it stores an Ethereum address, such as a wallet address.
|
Properties
Visibility
help
Visibility determines if the function is visible to users and other contracts.
Only functions that are public can be used.
internal
Mutability
help
Mutability tells you if a function can make changes on the blockchain.
View means the function can be called by anyone without
a wallet and without submitting a transaction.
transaction
Source Code
function _removeAdmin(address account) internal {
admins.remove(account);
emit AdminRemoved(account);
}