Blockwell

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

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Inflate Event

Parameters help
incentivesPoolValue
uint256 help

Lock Event

Parameters help
userAddress
address help
amount
uint256 help

RoleAdded Event

Parameters help
addr
address help
roleName
string help

RoleRemoved Event

Parameters help
addr
address help
roleName
string help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Unlock Event

Parameters help
userAddress
address help
amount
uint256 help

name Variable

string help

decimals Variable

uint256 help

symbol Variable

string help

version Variable

string help

totalSupply Variable

uint256 help

initialAmount Variable

uint256 help
Internal Variable

deployTime Variable

uint256 help
Internal Variable

lastInflationDayStart Variable

uint256 help
Internal Variable

incentivesPool Variable

uint256 help
Internal Variable

userLockedTokens Variable

mapping(address => uint256) help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

initialOwner Variable

address help
Internal Variable

roles Variable

mapping(string => Roles.Role) help
Internal Variable

Functions Expand All Collapse All

checkRole keyboard_arrow_up

Parameters help

Name Type
addr
address help
roleName
string help

Properties

Visibility help public
Mutability help view
Source Code
function checkRole(address addr, string roleName) public view {
  roles[roleName].check(addr);
}

hasRole keyboard_arrow_up

Parameters help

Name Type
addr
address help
roleName
string help

Properties

Visibility help public
Mutability help view
Source Code
function hasRole(address addr, string roleName) public view returns (bool) {
  return roles[roleName].has(addr);
}

addRole keyboard_arrow_up

Parameters help

Name Type
addr
address help
roleName
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function addRole(address addr, string roleName) public onlyOwner {
  roles[roleName].add(addr);
  emit RoleAdded(addr, roleName);
}

removeRole keyboard_arrow_up

Parameters help

Name Type
addr
address help
roleName
string help

Properties

Visibility help public
Mutability help transaction
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.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function getIncentivesPool() public view returns (uint256) {
  return incentivesPool;
}

incentivesIn keyboard_arrow_up

Parameters help

Name Type
_users
address[] help
_values
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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

Parameters help

Name Type
_users
address[] help
_values
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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

Parameters help

Name Type
_userAddress
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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

Name Type
_userAddress
address help
_amount
uint256 help
_to
address help
_toAmount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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

Parameters help

Name Type
_userAddress
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyRole checks for the following:
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);
}

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address _owner) public view returns (uint256 balance) {
  return balances[_owner] - userLockedTokens[_owner];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address _owner, address _spender)
  public
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.