Ultra Token
ERC20
This contract is an ERC20 token.
Name
Ultra Token
Symbol
UOS
Decimals
4
Total Supply
1,000,000,000 UOS
About link description
Ultra (UOS) is a cryptocurrency and operates on the Ethereum platform. Ultra has a current supply of 1,000,000,000 with 282,789,762.3439 in circulation. The last known price of Ultra is 0.50661333 USD and is up 0.54 over the last 24 hours. It is currently trading on 17 active market(s) with $1,783,331.17 traded over the last 24 hours. More information can be found at https://ultra.io/.
Stats
Public Functions
35
Event Types
12
Code Size
31,176 bytes
Library Use
Uses SafeMath for uint256.
Events (12) keyboard_arrow_up
State Variables (15) keyboard_arrow_up
Functions
owner keyboard_arrow_up
isOwner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Source Code
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
isPauser keyboard_arrow_up
addPauser keyboard_arrow_up
renouncePauser keyboard_arrow_up
paused keyboard_arrow_up
pause keyboard_arrow_up
unpause keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address to, uint256 value)
public
whenNotPaused
returns (bool)
{
return super.transfer(to, value);
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 value)
public
whenNotPaused
returns (bool)
{
return super.approve(spender, value);
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address from,
address to,
uint256 value
) public whenNotPaused returns (bool) {
return super.transferFrom(from, to, value);
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].add(addedValue)
);
return true;
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].sub(subtractedValue)
);
return true;
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
public
whenNotPaused
returns (bool)
{
return super.increaseAllowance(spender, addedValue);
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
public
whenNotPaused
returns (bool)
{
return super.decreaseAllowance(spender, subtractedValue);
}
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
deployTime keyboard_arrow_up
buyerInformation keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function buyerInformation()
public
view
returns (
uint256,
uint256,
string memory
)
{
BuyerInfo storage buyerInfo = _buyerInfos[msg.sender];
return (buyerInfo.total, buyerInfo.claimed, buyerInfo.contractName);
}
nextVestingDate keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function nextVestingDate() public view returns (uint256) {
BuyerInfo storage buyerInfo = _buyerInfos[msg.sender];
require(buyerInfo.total > 0, "Buyer does not exist");
VestingContract storage vestingContract = _vestingContracts[
buyerInfo.contractName
];
uint256 currentMonth = block.timestamp.sub(_deployTime).div(_month);
if (currentMonth < vestingContract.startMonth) {
return _deployTime.add(vestingContract.startMonth.mul(_month));
} else if (currentMonth >= vestingContract.endMonth) {
return _deployTime.add(vestingContract.endMonth.mul(_month));
} else {
return _deployTime.add(currentMonth.add(1).mul(_month));
}
}
setVestingContract keyboard_arrow_up
Parameters help
Modifiers help
onlyOwner checks for the following:
null
whenNotPaused checks for the following:
Requirements help
Source Code
function setVestingContract(
string memory contractName,
uint256[] memory basisPoints,
uint256 startMonth
) public onlyOwner whenNotPaused returns (bool) {
VestingContract storage vestingContract = _vestingContracts[contractName];
require(
vestingContract.basisPoints.length == 0,
"can't change an existing contract"
);
uint256 totalBPs = 0;
for (uint256 i = 0; i < basisPoints.length; i++) {
totalBPs = totalBPs.add(basisPoints[i]);
}
require(totalBPs == 10000, "invalid basis points array"); // this also ensures array length is not zero
vestingContract.basisPoints = basisPoints;
vestingContract.startMonth = startMonth;
vestingContract.endMonth = startMonth.add(basisPoints.length).sub(1);
emit SetVestingContract(contractName, basisPoints, startMonth);
return true;
}
importBalance keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
whenNotPaused checks for the following:
Requirements help
Source Code
function importBalance(
address[] memory buyers,
uint256[] memory tokens,
string memory contractName
) public onlyOwner whenNotPaused returns (bool) {
require(buyers.length == tokens.length, "buyers and balances mismatch");
VestingContract storage vestingContract = _vestingContracts[contractName];
require(vestingContract.basisPoints.length > 0, "contract does not exist");
for (uint256 i = 0; i < buyers.length; i++) {
require(tokens[i] > 0, "cannot import zero balance");
BuyerInfo storage buyerInfo = _buyerInfos[buyers[i]];
require(
buyerInfo.total == 0,
"have already imported balance for this buyer"
);
buyerInfo.total = tokens[i];
buyerInfo.contractName = contractName;
}
emit ImportBalance(buyers, tokens, contractName);
return true;
}
claim keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function claim() public whenNotPaused returns (bool) {
uint256 canClaim = claimableToken();
require(canClaim > 0, "No token is available to claim");
_buyerInfos[msg.sender].claimed = _buyerInfos[msg.sender].claimed.add(
canClaim
);
_transfer(address(this), msg.sender, canClaim);
emit Claim(msg.sender, canClaim);
return true;
}
claimableToken keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function claimableToken() public view returns (uint256) {
BuyerInfo storage buyerInfo = _buyerInfos[msg.sender];
if (buyerInfo.claimed < buyerInfo.total) {
VestingContract storage vestingContract = _vestingContracts[
buyerInfo.contractName
];
uint256 currentMonth = block.timestamp.sub(_deployTime).div(_month);
if (currentMonth < vestingContract.startMonth) {
return uint256(0);
}
if (currentMonth >= vestingContract.endMonth) {
// vest the unclaimed token all at once so there's no remainder
return buyerInfo.total.sub(buyerInfo.claimed);
} else {
uint256 claimableIndex = currentMonth.sub(vestingContract.startMonth);
uint256 canClaim = 0;
for (uint256 i = 0; i <= claimableIndex; ++i) {
canClaim = canClaim.add(vestingContract.basisPoints[i]);
}
return canClaim.mul(buyerInfo.total).div(10000).sub(buyerInfo.claimed);
}
}
return uint256(0);
}
register keyboard_arrow_up
Requirements help
Source Code
function register(string memory EOSKey) public whenNotPaused returns (bool) {
_register(EOSKey);
return true;
}
keyOf keyboard_arrow_up
setUpdateApproval keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Requirements help
One or more of the following:
-
undefined.total
must be greater than
0
- OR
the result of calling balanceOf with buyer
must be greater than
0
Source Code
function setUpdateApproval(address buyer, bool isApproved)
public
onlyOwner
returns (bool)
{
require(
balanceOf(buyer) > 0 || _buyerInfos[buyer].total > 0,
"This account has no token"
); // allowance will not be considered
_updateApproval[buyer] = isApproved;
emit SetUpdateApproval(buyer, isApproved);
return true;
}
updateApproved keyboard_arrow_up
update keyboard_arrow_up
Requirements help
Source Code
function update(string memory EOSKey) public returns (bool) {
require(
_updateApproval[msg.sender],
"Need approval from ultra after contract is frozen"
);
_register(EOSKey);
return true;
}
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 UltraToken._register keyboard_arrow_up
Requirements help
Source Code
function _register(string memory EOSKey) internal {
require(
bytes(EOSKey).length > 0 && bytes(EOSKey).length <= 64,
"EOS public key length should be less than 64 characters"
);
_keys[msg.sender] = EOSKey;
emit SetKey(msg.sender, EOSKey);
}
internal ERC20._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal ERC20._mint keyboard_arrow_up
Source Code
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
internal ERC20._burn keyboard_arrow_up
Source Code
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
internal ERC20._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 value
) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
internal ERC20._burnFrom keyboard_arrow_up
Requirements help
Source Code
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
internal Pausable.constructor keyboard_arrow_up
internal PauserRole.constructor keyboard_arrow_up
internal PauserRole._addPauser keyboard_arrow_up
internal PauserRole._removePauser keyboard_arrow_up
internal Ownable.constructor keyboard_arrow_up
internal Ownable._transferOwnership keyboard_arrow_up
Source Code
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}