Primas Token
ERC20
This contract is an ERC20 token.
Name
Primas Token
Symbol
PST
Decimals
18
Total Supply
120,980,822 PST
About link description
Primas (PST) is a cryptocurrency and operates on the Ethereum platform. Primas has a current supply of 101,342,465.753 with 52,692,564.7534 in circulation. The last known price of Primas is 0.01987922 USD and is up 0.93 over the last 24 hours. It is currently trading on 4 active market(s) with $2,804,640.17 traded over the last 24 hours. More information can be found at https://primas.io/.
Stats
Public Functions
16
Event Types
7
Code Size
8,757 bytes
Library Use
Uses SafeMath for uint256.
Events (7) keyboard_arrow_up
State Variables (14) keyboard_arrow_up
Functions
checkRole keyboard_arrow_up
hasRole keyboard_arrow_up
addRole keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function addRole(address addr, string roleName) public onlyOwner {
roles[roleName].add(addr);
emit RoleAdded(addr, roleName);
}
removeRole keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function removeRole(address addr, string roleName) public onlyOwner {
roles[roleName].remove(addr);
emit RoleRemoved(addr, roleName);
}
inflate keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function inflate() public onlyRole("InflationOperator") returns (uint256) {
uint256 currentTime = block.timestamp;
uint256 currentDayStart = currentTime / 1 days;
uint256 inflationAmount;
require(lastInflationDayStart != currentDayStart);
lastInflationDayStart = currentDayStart;
uint256 createDurationYears = (currentTime - deployTime) / 1 years;
if (createDurationYears < 1) {
inflationAmount = initialAmount / 10 / 365;
} else if (createDurationYears >= 20) {
inflationAmount = 0;
} else {
inflationAmount =
(initialAmount * (100 - (5 * createDurationYears))) /
365 /
1000;
}
incentivesPool = incentivesPool.add(inflationAmount);
totalSupply = totalSupply.add(inflationAmount);
emit Inflate(incentivesPool);
return incentivesPool;
}
getIncentivesPool keyboard_arrow_up
incentivesIn keyboard_arrow_up
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function incentivesIn(address[] _users, uint256[] _values)
public
onlyRole("IncentivesCollector")
returns (bool success)
{
require(_users.length == _values.length);
for (uint256 i = 0; i < _users.length; i++) {
userLockedTokens[_users[i]] = userLockedTokens[_users[i]].sub(_values[i]);
balances[_users[i]] = balances[_users[i]].sub(_values[i]);
incentivesPool = incentivesPool.add(_values[i]);
emit Transfer(_users[i], address(0), _values[i]);
}
return true;
}
incentivesOut keyboard_arrow_up
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function incentivesOut(address[] _users, uint256[] _values)
public
onlyRole("IncentivesDistributor")
returns (bool success)
{
require(_users.length == _values.length);
for (uint256 i = 0; i < _users.length; i++) {
incentivesPool = incentivesPool.sub(_values[i]);
balances[_users[i]] = balances[_users[i]].add(_values[i]);
emit Transfer(address(0), _users[i], _values[i]);
}
return true;
}
tokenLock keyboard_arrow_up
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function tokenLock(address _userAddress, uint256 _amount)
public
onlyRole("Locker")
{
require(balanceOf(_userAddress) >= _amount);
userLockedTokens[_userAddress] = userLockedTokens[_userAddress].add(_amount);
emit Lock(_userAddress, _amount);
}
tokenUnlock keyboard_arrow_up
Parameters help
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function tokenUnlock(
address _userAddress,
uint256 _amount,
address _to,
uint256 _toAmount
) public onlyRole("Unlocker") {
require(_amount >= _toAmount);
require(userLockedTokens[_userAddress] >= _amount);
userLockedTokens[_userAddress] = userLockedTokens[_userAddress].sub(_amount);
emit Unlock(_userAddress, _amount);
if (_to != address(0) && _toAmount != 0) {
balances[_userAddress] = balances[_userAddress].sub(_toAmount);
balances[_to] = balances[_to].add(_toAmount);
emit Transfer(_userAddress, _to, _toAmount);
}
}
transferAndLock keyboard_arrow_up
Modifiers help
onlyRole checks for the following:
Requirements help
Source Code
function transferAndLock(
address _userAddress,
address _to,
uint256 _amount
) public onlyRole("Locker") {
require(balanceOf(_userAddress) >= _amount);
balances[_userAddress] = balances[_userAddress].sub(_amount);
balances[_to] = balances[_to].add(_amount);
userLockedTokens[_to] = userLockedTokens[_to].add(_amount);
emit Transfer(_userAddress, _to, _amount);
emit Lock(_to, _amount);
}
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf(msg.sender) >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) public returns (bool success) {
require(balanceOf(_from) >= _value && allowed[_from][msg.sender] >= _value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value)
public
returns (bool success)
{
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
allowance 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.