Blockwell

WINGS

ERC20

This contract is an ERC20 token.

Name WINGS
Symbol WINGS
Decimals 18
Total Supply 100,000,000 WINGS

About link description

Wings (WINGS) is a cryptocurrency and operates on the Ethereum platform. Wings has a current supply of 100,000,000 with 99,999,993.8460583 in circulation. The last known price of Wings is 0.03719835 USD and is down -0.27 over the last 24 hours. It is currently trading on 6 active market(s) with $10,630.39 traded over the last 24 hours. More information can be found at https://wings.ai/.

Stats

Public Functions 13
Event Types 7
Code Size 10,070 bytes

Events (7) keyboard_arrow_up

ALLOCATION Event

Parameters help
account
address help
amount
uint help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

PREMINER_ADDED Event

Parameters help
owner
address help
account
address help
amount
uint help

PREMINER_CHANGED Event

Parameters help
oldPreminer
address help
newPreminer
address help
newRecipient
address help

PREMINE_ALLOCATION_ADDED Event

Parameters help
account
address help
time
uint help

PREMINE_RELEASE Event

Parameters help
account
address help
timestamp
uint help
amount
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

Preminer Struct

Members
account
address help
monthlyPayment
uint help
latestAllocation
uint help
disabled
bool help
allocationsCount
uint help
allocations
mapping(uint => uint) help

name Variable

string help

symbol Variable

string help

decimals Variable

uint help

totalSupply Variable

uint help

DAYS_28 Variable

uint help

DAYS_31 Variable

uint help

MAX_ALLOCATIONS_COUNT Variable

uint help

accountsToAllocate Variable

uint help

multisignature Variable

address help

totalSupply Variable

uint help

owner Variable

address help

preminers Variable

mapping(address => Preminer) help
Internal Variable

balances Variable

mapping(address => uint) help
Internal Variable

allowed Variable

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

Functions Expand All Collapse All

transferOwner keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function transferOwner(address newOwner) onlyOwner {
  if (newOwner != address(0)) owner = newOwner;
}

Parameters help

Name Type
_owner
address help

Properties

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

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)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

whenAllocation checks for the following:
Source Code
function transfer(address _to, uint256 _value)
  whenAllocation(false)
  returns (bool success)
{
  return super.transfer(_to, _value);
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

whenAllocation checks for the following:
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) whenAllocation(false) returns (bool success) {
  return super.transferFrom(_from, _to, _value);
}

Parameters help

Name Type
_spender
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

whenAllocation checks for the following:
Source Code
function approve(address _spender, uint256 _value)
  whenAllocation(false)
  returns (bool success)
{
  return super.approve(_spender, _value);
}

allocate keyboard_arrow_up

Parameters help

Name Type
user
address help
balance
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
whenAllocation checks for the following:
whenAccountHasntAllocated checks for the following:
Source Code
function allocate(address user, uint256 balance)
  onlyOwner()
  whenAllocation(true)
  whenAccountHasntAllocated(user)
{
  balances[user] = balance;

  accountsToAllocate--;
  ALLOCATION(user, balance);
}

addPreminer keyboard_arrow_up

Parameters help

Name Type
preminer
address help
recipient
address help
initialBalance
uint help
monthlyPayment
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
whenAllocation checks for the following:
whenPremineHasntAllocated checks for the following:
Source Code
function addPreminer(
  address preminer,
  address recipient,
  uint256 initialBalance,
  uint256 monthlyPayment
) onlyOwner() whenAllocation(true) whenPremineHasntAllocated(preminer) {
  var premine = Preminer(recipient, monthlyPayment, 0, false, 0);

  balances[recipient] = safeAdd(balances[recipient], initialBalance);
  preminers[preminer] = premine;
  accountsToAllocate--;
  PREMINER_ADDED(preminer, premine.account, initialBalance);
}

disablePreminer keyboard_arrow_up

Parameters help

Name Type
_preminer
address help
_newPreminer
address help
_newRecipient
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function disablePreminer(
  address _preminer,
  address _newPreminer,
  address _newRecipient
) onlyMultisignature() whenPreminerIsntDisabled(_preminer) {
  var oldPreminer = preminers[_preminer];

  if (
    oldPreminer.account == address(0) ||
    preminers[_newPreminer].account != address(0)
  ) {
    throw;
  }

  preminers[_newPreminer] = oldPreminer;
  preminers[_newPreminer].account = _newRecipient;
  oldPreminer.disabled = true;

  if (preminers[_newPreminer].disabled == true) {
    throw;
  }

  for (uint256 i = 0; i < preminers[_newPreminer].allocationsCount; i++) {
    preminers[_newPreminer].allocations[i] = oldPreminer.allocations[i];
  }

  PREMINER_CHANGED(_preminer, _newPreminer, _newRecipient);
}

addPremineAllocation keyboard_arrow_up

Parameters help

Name Type
_preminer
address help
_time
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
whenAllocation checks for the following:
whenPreminerIsntDisabled checks for the following:
Source Code
function addPremineAllocation(address _preminer, uint256 _time)
  onlyOwner()
  whenAllocation(true)
  whenPreminerIsntDisabled(_preminer)
{
  var preminer = preminers[_preminer];

  if (
    preminer.account == address(0) ||
    _time == 0 ||
    preminer.allocationsCount == MAX_ALLOCATIONS_COUNT
  ) {
    throw;
  }

  if (preminer.allocationsCount > 0) {
    var previousAllocation = preminer.allocations[
      preminer.allocationsCount - 1
    ];

    if (previousAllocation > _time) {
      throw;
    }

    if (previousAllocation + DAYS_28 > _time) {
      throw;
    }

    if (previousAllocation + DAYS_31 < _time) {
      throw;
    }
  }

  preminer.allocations[preminer.allocationsCount++] = _time;
  PREMINE_ALLOCATION_ADDED(_preminer, _time);
}

getPreminer keyboard_arrow_up

Parameters help

Name Type
_preminer
address help

Properties

Visibility help public
Mutability help constant
Source Code
function getPreminer(address _preminer)
  constant
  returns (
    address,
    bool,
    uint256,
    uint256,
    uint256
  )
{
  var preminer = preminers[_preminer];

  return (
    preminer.account,
    preminer.disabled,
    preminer.monthlyPayment,
    preminer.latestAllocation,
    preminer.allocationsCount
  );
}

getPreminerAllocation keyboard_arrow_up

Parameters help

Name Type
_preminer
address help
_index
uint help

Properties

Visibility help public
Mutability help constant
Source Code
function getPreminerAllocation(address _preminer, uint256 _index)
  constant
  returns (uint256)
{
  return preminers[_preminer].allocations[_index];
}

releasePremine keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

whenAllocation checks for the following:
whenPreminerIsntDisabled checks for the following:

Requirements help

Source Code
function releasePremine()
  whenAllocation(false)
  whenPreminerIsntDisabled(msg.sender)
{
  var preminer = preminers[msg.sender];

  if (preminer.account == address(0)) {
    throw;
  }

  for (
    uint256 i = preminer.latestAllocation;
    i < preminer.allocationsCount;
    i++
  ) {
    if (preminer.allocations[i] < block.timestamp) {
      if (preminer.allocations[i] == 0) {
        continue;
      }

      balances[preminer.account] = safeAdd(
        balances[preminer.account],
        preminer.monthlyPayment
      );
      preminer.latestAllocation = i;

      PREMINE_RELEASE(
        preminer.account,
        preminer.allocations[i],
        preminer.monthlyPayment
      );
      preminer.allocations[i] = 0;
    } else {
      break;
    }
  }
}

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 SafeMath.safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || c / a == b);
  return c;
}

internal SafeMath.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal SafeMath.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a + b;
  assert(c >= a && c >= b);
  return c;
}

internal SafeMath.assert keyboard_arrow_up

Parameters help

Name Type
assertion
bool help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function assert(bool assertion) internal {
  if (!assertion) throw;
}