Blockwell

Gimli Token

ERC20

This contract is an ERC20 token.

Name Gimli Token
Symbol GIM
Decimals 8
Total Supply 150,000,000 GIM

About

Stats

Public Functions 17
Event Types 6
Code Size 14,905 bytes

Events (6) keyboard_arrow_up

AdminstratorAdded Event

Parameters help
adminAddress
address help

AdminstratorRemoved Event

Parameters help
adminAddress
address help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

OwnershipTransferred Event

Parameters help
_from
address help
_to
address help

StreamerContractChanged Event

Parameters help
newContractAddress
address help
newMaxAmount
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

MULTISIG_WALLET_ADDRESS Constant

address help

LOCKED_ADDRESS Constant

address help

CROWDSALE_AMOUNT Constant

uint256 help

START_DATE Constant

uint256 help
1505736000

END_DATE Constant

uint256 help
1508500800

CROWDSALE_PRICE Constant

uint256 help
700

VESTING_1_AMOUNT Constant

uint256 help

VESTING_1_DATE Constant

uint256 help
1537272000

VESTING_2_AMOUNT Constant

uint256 help

VESTING_2_DATE Constant

uint256 help
1568808000

decimals Constant

uint8 help
8

name Constant

string help
Gimli Token

symbol Constant

string help
GIM

version Constant

string help
v1

UNIT Constant

uint256 help
UNKNOWN VALUE

MILLION_GML Constant

uint256 help

TOTAL_SUPPLY Constant

uint256 help

streamerContract Variable

address help

streamerContractMaxAmount Variable

uint256 help

vesting1Withdrawn Variable

bool help

vesting2Withdrawn Variable

bool help

crowdsaleCanceled Variable

bool help

soldAmount Variable

uint256 help

paidAmount Variable

uint256 help

transferable Variable

bool help

totalSupply Variable

uint256 help

owner Variable

address help

newOwner Variable

address help

administrators Variable

mapping(address => bool) help

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

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

Functions Expand All Collapse All

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address _newOwner) onlyOwner {
  if (_newOwner != address(0)) {
    newOwner = _newOwner;
  }
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() {
  require(msg.sender == newOwner);
  OwnershipTransferred(owner, newOwner);
  owner = newOwner;
}

Parameters help

Name Type
_adminAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function addAdministrators(address _adminAddress) onlyOwner {
  administrators[_adminAddress] = true;
  AdminstratorAdded(_adminAddress);
}

Parameters help

Name Type
_adminAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function removeAdministrators(address _adminAddress) onlyOwner {
  delete administrators[_adminAddress];
  AdminstratorRemoved(_adminAddress);
}

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 success) {
  require(transferable);

  require(balances[msg.sender] >= _value && _value >= 0);

  balances[msg.sender] = safeSub(balances[msg.sender], _value);
  balances[_to] = safeAdd(balances[_to], _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

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) returns (bool success) {
  require(transferable);

  require(
    balances[_from] >= _value &&
      allowed[_from][msg.sender] >= _value &&
      _value >= 0
  );

  balances[_from] = safeSub(balances[_from], _value);
  balances[_to] = safeAdd(balances[_to], _value);
  allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender], _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 success) {
  // 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;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() payable {
  require(!crowdsaleCanceled);

  require(msg.value > 0);
  // check date
  require(block.timestamp >= START_DATE && block.timestamp <= END_DATE);

  // calculate and check quantity
  uint256 quantity = safeDiv(
    safeMul(msg.value, CROWDSALE_PRICE),
    10**(18 - uint256(decimals))
  );
  require(safeSub(balances[this], quantity) >= 0);

  require(MULTISIG_WALLET_ADDRESS.send(msg.value));

  // update balances
  balances[this] = safeSub(balances[this], quantity);
  balances[msg.sender] = safeAdd(balances[msg.sender], quantity);
  soldAmount = safeAdd(soldAmount, quantity);
  paidAmount = safeAdd(paidAmount, msg.value);

  Transfer(this, msg.sender, quantity);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function closeCrowdsale() onlyOwner {
  // check if closable
  require(
    block.timestamp > END_DATE || crowdsaleCanceled || balances[this] == 0
  );

  // enable token transfer
  transferable = true;

  // update balances
  if (balances[this] > 0) {
    uint256 amount = balances[this];
    balances[MULTISIG_WALLET_ADDRESS] = safeAdd(
      balances[MULTISIG_WALLET_ADDRESS],
      amount
    );
    balances[this] = 0;
    Transfer(this, MULTISIG_WALLET_ADDRESS, amount);
  }
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function cancelCrowdsale() onlyOwner {
  crowdsaleCanceled = true;
}

Parameters help

Name Type
_to
address help
_value
uint256 help
_price
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function preAllocate(
  address _to,
  uint256 _value,
  uint256 _price
) onlyOwner {
  require(block.timestamp < START_DATE);

  balances[this] = safeSub(balances[this], _value);
  balances[_to] = safeAdd(balances[_to], _value);
  soldAmount = safeAdd(soldAmount, _value);
  paidAmount = safeAdd(paidAmount, _price);

  Transfer(this, _to, _value);
}

Parameters help

Name Type
_destination
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function releaseVesting(address _destination) onlyOwner returns (bool success) {
  if (block.timestamp > VESTING_1_DATE && vesting1Withdrawn == false) {
    balances[LOCKED_ADDRESS] = safeSub(
      balances[LOCKED_ADDRESS],
      VESTING_1_AMOUNT
    );
    balances[_destination] = safeAdd(balances[_destination], VESTING_1_AMOUNT);
    vesting1Withdrawn = true;
    Transfer(LOCKED_ADDRESS, _destination, VESTING_1_AMOUNT);
    return true;
  }
  if (block.timestamp > VESTING_2_DATE && vesting2Withdrawn == false) {
    balances[LOCKED_ADDRESS] = safeSub(
      balances[LOCKED_ADDRESS],
      VESTING_2_AMOUNT
    );
    balances[_destination] = safeAdd(balances[_destination], VESTING_2_AMOUNT);
    vesting2Withdrawn = true;
    Transfer(LOCKED_ADDRESS, _destination, VESTING_2_AMOUNT);
    return true;
  }
  return false;
}

Parameters help

Name Type
tokenAddress
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOtherERC20Token(address tokenAddress, uint256 amount)
  onlyOwner
  returns (bool success)
{
  // can't be used for GIM token
  require(tokenAddress != address(this) || transferable);
  return ERC20(tokenAddress).transfer(owner, amount);
}

Parameters help

Name Type
_contractAddress
address help
_maxAmount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function setStreamerContract(address _contractAddress, uint256 _maxAmount)
  onlyAdministrator
{
  // To change the maximum amount you first have to reduce it to 0`
  require(_maxAmount == 0 || streamerContractMaxAmount == 0);

  streamerContract = _contractAddress;
  streamerContractMaxAmount = _maxAmount;

  StreamerContractChanged(streamerContract, streamerContractMaxAmount);
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferGIM(
  address _from,
  address _to,
  uint256 _amount
) returns (bool success) {
  require(msg.sender == streamerContract);
  require(tx.origin == _from);
  require(_amount <= streamerContractMaxAmount);

  if (balances[_from] < _amount || _amount <= 0) return false;

  balances[_from] = safeSub(balances[_from], _amount);
  balances[_to] = safeAdd(balances[_to], _amount);

  Transfer(_from, _to, _amount);

  return true;
}

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.safeDiv keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
  assert(b > 0);
  uint256 c = a / b;
  assert(a == b * 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.max64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a >= b ? a : b;
}

internal SafeMath.min64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a < b ? a : b;
}

internal SafeMath.max256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a >= b ? a : b;
}

internal SafeMath.min256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a < b ? a : b;
}

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.safeDiv keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
  assert(b > 0);
  uint256 c = a / b;
  assert(a == b * 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.max64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a >= b ? a : b;
}

internal SafeMath.min64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a < b ? a : b;
}

internal SafeMath.max256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a >= b ? a : b;
}

internal SafeMath.min256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a < b ? a : b;
}