Blockwell

Snetwork

ERC20

This contract is an ERC20 token.

Name Snetwork
Symbol SNET
Decimals 8
Total Supply 1,000,000,000 SNET

About link

Snetwork (SNET) is a cryptocurrency and operates on the Ethereum platform. Snetwork has a current supply of 1,000,000,000 with 233,054,447.59859058 in circulation. The last known price of Snetwork is 0.0026078 USD and is down -9.42 over the last 24 hours. It is currently trading on 6 active market(s) with $28,793.52 traded over the last 24 hours. More information can be found at https://www.snetwork.io/.

Stats

Public Functions 15
Event Types 6
Code Size 21,761 bytes

Events (6) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

ReleaseLockedBalance Event

Parameters help
owner
address help
value
uint256 help
releaseTime
uint256 help

ReleaseSupply Event

Parameters help
receiver
address help
value
uint256 help
releaseTime
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

TransferLockedToken Event

Parameters help
from
address help
to
address help
value
uint256 help
releaseTime
uint256 help

UnfreezeAmount Event

Parameters help
receiver
address help
amount
uint256 help
unfreezeTime
uint256 help

standard Variable

string help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

releasedSupply Variable

uint256 help

createTime Variable

uint256 help

totalSupply Variable

uint256 help

limitSupplyPerYear Variable

uint256 help

dailyLimit Variable

uint256 help

frozenRecordsCount Variable

uint help

operator Variable

address help

pendingOwner Variable

address help

owner Variable

address help

lockedBalanceCount Variable

uint help

totalSupply Variable

uint256 help

secondYearUpdate Variable

bool help
Internal Variable

standardDecimals Variable

uint256 help
Internal Variable

frozenRecords Variable

mapping(uint => FrozenRecord) help
Internal Variable

lockedBalances Variable

mapping(uint => LockedBalance) help
Internal Variable

allowed Variable

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

balances Variable

mapping(address => uint256) help
Internal Variable

rentrancy_lock Variable

bool help
Internal Variable

Functions Expand All Collapse All

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
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _value) returns (bool) {
  balances[msg.sender] = balances[msg.sender].sub(_value);
  balances[_to] = balances[_to].add(_value);
  Transfer(msg.sender, _to, _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)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

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
) returns (bool) {
  var _allowance = allowed[_from][msg.sender];

  // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
  // require (_value <= _allowance);

  balances[_to] = balances[_to].add(_value);
  balances[_from] = balances[_from].sub(_value);
  allowed[_from][msg.sender] = _allowance.sub(_value);
  Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value) returns (bool) {
  // To change the approve amount you first have to reduce the addresses`
  //  allowance to zero by calling `approve(_spender, 0)` if it is not
  //  already 0 to mitigate the race condition described here:
  //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
  require((_value == 0) || (allowed[msg.sender][_spender] == 0));

  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

batchTransfer keyboard_arrow_up

Parameters help

Name Type
_to
address[] help
_bonus
uint256[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function batchTransfer(address[] _to, uint256[] _bonus) returns (bool) {
  for (uint256 i = 0; i < _to.length; i++) {
    require(transfer(_to[i], _bonus[i]));
  }
  return true;
}

transferLockedToken keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help
_releaseTime
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferLockedToken(
  address _to,
  uint256 _value,
  uint256 _releaseTime
) nonReentrant returns (bool) {
  require(_releaseTime > now);
  require(_releaseTime.sub(1 years) < now);
  balances[msg.sender] = balances[msg.sender].sub(_value);
  lockedBalances[lockedBalanceCount] = LockedBalance({
    owner: _to,
    value: _value,
    releaseTime: _releaseTime
  });
  lockedBalanceCount++;
  TransferLockedToken(msg.sender, _to, _value, _releaseTime);
  return true;
}

lockedBalanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function lockedBalanceOf(address _owner) constant returns (uint256 value) {
  for (uint256 i = 0; i < lockedBalanceCount; i++) {
    LockedBalance lockedBalance = lockedBalances[i];
    if (_owner == lockedBalance.owner) {
      value = value.add(lockedBalance.value);
    }
  }
  return value;
}

releaseLockedBalance keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function releaseLockedBalance() returns (uint256 releaseAmount) {
  uint256 index = 0;
  while (index < lockedBalanceCount) {
    if (now >= lockedBalances[index].releaseTime) {
      releaseAmount += lockedBalances[index].value;
      unlockBalanceByIndex(index);
    } else {
      index++;
    }
  }
  return releaseAmount;
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address newOwner) onlyOwner {
  pendingOwner = newOwner;
}

claimOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function claimOwnership() onlyPendingOwner {
  owner = pendingOwner;
  pendingOwner = 0x0;
}

transferOperator keyboard_arrow_up

Parameters help

Name Type
newOperator
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOperator(address newOperator) onlyOwner {
  require(newOperator != address(0));
  operator = newOperator;
}

releaseSupply keyboard_arrow_up

Parameters help

Name Type
releaseAmount
uint256 help
timestamp
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function releaseSupply(uint256 releaseAmount, uint256 timestamp)
  onlyOperator
  returns (uint256 _actualRelease)
{
  require(timestamp >= createTime && timestamp <= now);
  require(!judgeReleaseRecordExist(timestamp));
  require(releaseAmount <= dailyLimit);
  updateLimit();
  require(limitSupplyPerYear > 0);
  if (releaseAmount > limitSupplyPerYear) {
    if (releasedSupply.add(limitSupplyPerYear) > totalSupply) {
      releasedSupply = totalSupply;
      releaseAmount = totalSupply.sub(releasedSupply);
    } else {
      releasedSupply = releasedSupply.add(limitSupplyPerYear);
      releaseAmount = limitSupplyPerYear;
    }
    limitSupplyPerYear = 0;
  } else {
    if (releasedSupply.add(releaseAmount) > totalSupply) {
      releasedSupply = totalSupply;
      releaseAmount = totalSupply.sub(releasedSupply);
    } else {
      releasedSupply = releasedSupply.add(releaseAmount);
    }
    limitSupplyPerYear = limitSupplyPerYear.sub(releaseAmount);
  }
  frozenRecords[frozenRecordsCount] = FrozenRecord(
    releaseAmount,
    timestamp.add(26 * 1 weeks)
  );
  frozenRecordsCount++;
  ReleaseSupply(msg.sender, releaseAmount, timestamp);
  return releaseAmount;
}

unfreeze keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unfreeze() onlyOperator returns (uint256 _unfreezeAmount) {
  uint256 unfreezeAmount = 0;
  uint256 index = 0;
  while (index < frozenRecordsCount) {
    if (frozenRecords[index].unfreezeTime < now) {
      unfreezeAmount += frozenRecords[index].amount;
      unfreezeByIndex(index);
    } else {
      index++;
    }
  }
  return unfreezeAmount;
}

setDailyLimit keyboard_arrow_up

Parameters help

Name Type
_dailyLimit
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setDailyLimit(uint256 _dailyLimit) onlyOwner {
  dailyLimit = _dailyLimit;
}

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 ReleaseableToken.judgeReleaseRecordExist keyboard_arrow_up

Parameters help

Name Type
timestamp
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function judgeReleaseRecordExist(uint256 timestamp)
  internal
  returns (bool _exist)
{
  bool exist = false;
  if (frozenRecordsCount > 0) {
    for (uint256 index = 0; index < frozenRecordsCount; index++) {
      if (
        (frozenRecords[index].unfreezeTime.parseTimestamp().year ==
          (timestamp.add(26 * 1 weeks)).parseTimestamp().year) &&
        (frozenRecords[index].unfreezeTime.parseTimestamp().month ==
          (timestamp.add(26 * 1 weeks)).parseTimestamp().month) &&
        (frozenRecords[index].unfreezeTime.parseTimestamp().day ==
          (timestamp.add(26 * 1 weeks)).parseTimestamp().day)
      ) {
        exist = true;
      }
    }
  }
  return exist;
}

internal ReleaseableToken.updateLimit keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
function updateLimit() internal {
  if (createTime.add(1 years) < now && !secondYearUpdate) {
    limitSupplyPerYear = standardDecimals.mul(120000000);
    secondYearUpdate = true;
  }
  if (createTime.add(2 * 1 years) < now) {
    if (releasedSupply < totalSupply) {
      limitSupplyPerYear = totalSupply.sub(releasedSupply);
    }
  }
}

internal ReleaseableToken.unfreezeByIndex keyboard_arrow_up

Parameters help

Name Type
index
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function unfreezeByIndex(uint256 index) internal {
  FrozenRecord unfreezeRecord = frozenRecords[index];
  balances[owner] = balances[owner].add(unfreezeRecord.amount);
  UnfreezeAmount(owner, unfreezeRecord.amount, unfreezeRecord.unfreezeTime);
  frozenRecords[index] = frozenRecords[frozenRecordsCount - 1];
  delete frozenRecords[frozenRecordsCount - 1];
  frozenRecordsCount--;
}

internal LockableToken.unlockBalanceByIndex keyboard_arrow_up

Parameters help

Name Type
index
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function unlockBalanceByIndex(uint256 index) internal {
  LockedBalance lockedBalance = lockedBalances[index];
  balances[lockedBalance.owner] = balances[lockedBalance.owner].add(
    lockedBalance.value
  );
  ReleaseLockedBalance(
    lockedBalance.owner,
    lockedBalance.value,
    lockedBalance.releaseTime
  );
  lockedBalances[index] = lockedBalances[lockedBalanceCount - 1];
  delete lockedBalances[lockedBalanceCount - 1];
  lockedBalanceCount--;
}