Blockwell

Gifto

ERC20

This contract is an ERC20 token.

Name Gifto
Symbol GTO
Decimals 5
Total Supply 1,000,000,000 GTO

About

Stats

Public Functions 19
Event Types 2
Code Size 11,321 bytes

Events (2) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

decimals Constant

uint256 help
5

symbol Constant

string help
GTO

name Constant

string help
Gifto

_selling Variable

bool help

_totalSupply Variable

uint256 help

_originalBuyPrice Variable

uint256 help

owner Variable

address help

_icoPercent Variable

uint256 help

_icoSupply Variable

uint256 help

_minimumBuy Variable

uint256 help

_maximumBuy Variable

uint256 help

totalTokenSold Variable

uint256 help

tradable Variable

bool help

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

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

approvedInvestorList Variable

mapping(address => bool) help
Internal Variable

deposit Variable

mapping(address => uint256) help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
_addr
address help

Properties

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

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _amount)
  public
  isTradable
  returns (bool)
{
  // if sender's balance has enough unit and amount >= 0,
  //      and the sum is not overflow,
  // then do transfer
  if (
    (balances[msg.sender] >= _amount) &&
    (_amount >= 0) &&
    (balances[_to] + _amount > balances[_to])
  ) {
    balances[msg.sender] -= _amount;
    balances[_to] += _amount;
    Transfer(msg.sender, _to, _amount);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
) public isTradable returns (bool success) {
  if (
    balances[_from] >= _amount &&
    allowed[_from][msg.sender] >= _amount &&
    _amount > 0 &&
    balances[_to] + _amount > balances[_to]
  ) {
    balances[_from] -= _amount;
    allowed[_from][msg.sender] -= _amount;
    balances[_to] += _amount;
    Transfer(_from, _to, _amount);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _amount)
  public
  isTradable
  returns (bool success)
{
  allowed[msg.sender][_spender] = _amount;
  Approval(msg.sender, _spender, _amount);
  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];
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() public payable {
  buyGifto();
}

buyGifto keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Modifiers help

validValue checks for the following:
validInvestor checks for the following:
Source Code
function buyGifto() public payable onSale validValue validInvestor {
  uint256 requestedUnits = (msg.value * _originalBuyPrice) / 10**18;
  require(balances[owner] >= requestedUnits);
  // prepare transfer data
  balances[owner] -= requestedUnits;
  balances[msg.sender] += requestedUnits;

  // increase total deposit amount
  deposit[msg.sender] += msg.value;

  // check total and auto turnOffSale
  totalTokenSold += requestedUnits;
  if (totalTokenSold >= _icoSupply) {
    _selling = false;
  }

  // submit transfer
  Transfer(owner, msg.sender, requestedUnits);
  owner.transfer(msg.value);
}

turnOnSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

turnOffSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function turnOffSale() public onlyOwner {
  _selling = false;
}

turnOnTradable keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

setIcoPercent keyboard_arrow_up

Parameters help

Name Type
newIcoPercent
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setIcoPercent(uint256 newIcoPercent) public onlyOwner {
  _icoPercent = newIcoPercent;
  _icoSupply = (_totalSupply * _icoPercent) / 100;
}

setMaximumBuy keyboard_arrow_up

Parameters help

Name Type
newMaximumBuy
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setMaximumBuy(uint256 newMaximumBuy) public onlyOwner {
  _maximumBuy = newMaximumBuy;
}

setBuyPrice keyboard_arrow_up

Parameters help

Name Type
newBuyPrice
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setBuyPrice(uint256 newBuyPrice) public onlyOwner {
  require(newBuyPrice > 0);
  _originalBuyPrice = newBuyPrice; // 3000 Gifto = 3000 00000 unit
  // control _maximumBuy_USD = 10,000 USD, Gifto price is 0.1USD
  // maximumBuy_Gifto = 100,000 Gifto = 100,000,00000 unit
  // 3000 Gifto = 1ETH => maximumETH = 100,000,00000 / _originalBuyPrice
  // 100,000,00000/3000 0000 ~ 33ETH => change to wei
  _maximumBuy = (10**18 * 10000000000) / _originalBuyPrice;
}

isApprovedInvestor keyboard_arrow_up

Parameters help

Name Type
_addr
address help

Properties

Visibility help public
Mutability help constant
Source Code
function isApprovedInvestor(address _addr) public constant returns (bool) {
  return approvedInvestorList[_addr];
}

getDeposit keyboard_arrow_up

Parameters help

Name Type
_addr
address help

Properties

Visibility help public
Mutability help constant
Source Code
function getDeposit(address _addr) public constant returns (uint256) {
  return deposit[_addr];
}

addInvestorList keyboard_arrow_up

Parameters help

Name Type
newInvestorList
address[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function addInvestorList(address[] newInvestorList) public onlyOwner {
  for (uint256 i = 0; i < newInvestorList.length; i++) {
    approvedInvestorList[newInvestorList[i]] = true;
  }
}

removeInvestorList keyboard_arrow_up

Parameters help

Name Type
investorList
address[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function removeInvestorList(address[] investorList) public onlyOwner {
  for (uint256 i = 0; i < investorList.length; i++) {
    approvedInvestorList[investorList[i]] = false;
  }
}

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function withdraw() public onlyOwner returns (bool) {
  return owner.send(this.balance);
}

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.