Blockwell

Olyseum

ERC20

This contract is an ERC20 token.

Name Olyseum
Symbol OLY
Decimals 18
Total Supply 5,000,000,000 OLY

About link description

Olyseum (OLY) is a cryptocurrency and operates on the Ethereum platform. Olyseum has a current supply of 5,000,000,000 with 1,166,187,285.615249 in circulation. The last known price of Olyseum is 0.01660545 USD and is down -0.72 over the last 24 hours. It is currently trading on 7 active market(s) with $658,793.39 traded over the last 24 hours. More information can be found at https://olyseum.com/.

Stats

Public Functions 13
Event Types 3
Code Size 19,369 bytes

Library Use

Uses SafeMath for uint256.

Events (3) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

DeferredTransfer Event

Parameters help
paymentSigner
address help
nonce
uint256 help
paymentAmount
uint256 help
paymentCollector
address help
paymentFee
uint256 help
feeCollector
address help
statusSuccessful
bool help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 help
Internal Variable

_initialized Variable

bool help
Internal Variable

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowances Variable

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

_totalSupply Variable

uint256 help
Internal Variable

usedNonces Variable

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

Functions Expand All Collapse All

initialize keyboard_arrow_up

Parameters help

Name Type
name
string help
symbol
string help
decimals
uint8 help
totalSupply
uint256 help
tokenHolder
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function initialize(
  string memory name,
  string memory symbol,
  uint8 decimals,
  uint256 totalSupply,
  address tokenHolder
) public {
  require(!_initialized, "This contract is already initialized");
  require(totalSupply > 0, "Total supply must be greater than 0");

  _name = name;
  _symbol = symbol;
  _decimals = decimals;
  _mint(tokenHolder, totalSupply);
  _initialized = true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() public view returns (string memory) {
  return _name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string memory) {
  return _symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  return _decimals;
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address account) public view returns (uint256) {
  return _balances[account];
}

Parameters help

Name Type
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address recipient, uint256 amount) public returns (bool) {
  _transfer(msg.sender, recipient, amount);
  return true;
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  public
  view
  returns (uint256)
{
  return _allowances[owner][spender];
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 value) public returns (bool) {
  _approve(msg.sender, spender, value);
  return true;
}

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address sender,
  address recipient,
  uint256 amount
) public returns (bool) {
  _transfer(sender, recipient, amount);
  _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

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;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

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;
}

publishMessages keyboard_arrow_up

Parameters help

Name Type
nonces
uint256[] help
paymentAmounts
uint256[] help
paymentCollectors
address[] help
paymentFees
uint256[] help
feeCollectors
address[] help
sigsR
bytes32[] help
sigsS
bytes32[] help
sigsV
uint8[] help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function publishMessages(
  uint256[] memory nonces,
  uint256[] memory paymentAmounts,
  address[] memory paymentCollectors,
  uint256[] memory paymentFees,
  address[] memory feeCollectors,
  bytes32[] memory sigsR,
  bytes32[] memory sigsS,
  uint8[] memory sigsV
) public {
  require(
    nonces.length == paymentAmounts.length &&
      paymentAmounts.length == paymentCollectors.length &&
      paymentCollectors.length == paymentFees.length &&
      paymentFees.length == feeCollectors.length &&
      feeCollectors.length == sigsR.length &&
      sigsR.length == sigsS.length &&
      sigsS.length == sigsV.length,
    "Inconsistent message data received"
  );

  for (uint256 i = 0; i < nonces.length; i++) {
    executeMessage(
      nonces[i],
      paymentAmounts[i],
      paymentCollectors[i],
      paymentFees[i],
      feeCollectors[i],
      sigsR[i],
      sigsS[i],
      sigsV[i]
    );
  }
}

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.

internal OlyToken._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

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 OlyToken._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

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 OlyToken._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

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 OlyToken._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

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 OlyToken._burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burnFrom(address account, uint256 amount) internal {
  _burn(account, amount);
  _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}

internal OlyToken.executeMessage keyboard_arrow_up

Parameters help

Name Type
nonce
uint256 help
paymentAmount
uint256 help
paymentCollector
address help
paymentFee
uint256 help
feeCollector
address help
sigR
bytes32 help
sigS
bytes32 help
sigV
uint8 help

Properties

Visibility help private
Mutability help transaction
Source Code
function executeMessage(
  uint256 nonce,
  uint256 paymentAmount,
  address paymentCollector,
  uint256 paymentFee,
  address feeCollector,
  bytes32 sigR,
  bytes32 sigS,
  uint8 sigV
) private {
  bytes32 hash = keccak256(
    abi.encodePacked(
      string("\x19Ethereum Signed Message:\n164Olyseum v1 Transfer Message:"),
      nonce,
      paymentAmount,
      paymentCollector,
      paymentFee,
      msg.sender
    )
  );

  address user = ecrecover(hash, sigV, sigR, sigS);
  uint256 balance = _balances[user];
  bool success = false;
  uint256 totalExpenditure = paymentAmount.add(paymentFee);

  if (
    balance >= totalExpenditure &&
    !usedNonces[user][nonce] &&
    paymentCollector != address(0) &&
    feeCollector != address(0)
  ) {
    success = true;
    usedNonces[user][nonce] = true;

    // Execute transfer
    _balances[user] = balance.sub(totalExpenditure);
    _balances[paymentCollector] = _balances[paymentCollector].add(
      paymentAmount
    );
    _balances[feeCollector] = _balances[feeCollector].add(paymentFee);

    emit Transfer(user, paymentCollector, paymentAmount);
    emit Transfer(user, feeCollector, paymentFee);
  }

  emit DeferredTransfer(
    user,
    nonce,
    paymentAmount,
    paymentCollector,
    paymentFee,
    feeCollector,
    success
  );
}