Blockwell

GAT Token

ERC20

This contract is an ERC20 token.

Name GAT Token
Symbol GAT
Decimals 18
Total Supply 1,000,000,000 GAT

About

Stats

Public Functions 18
Event Types 12
Code Size 17,791 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

BonusAmountUpdated Event

Parameters help
newAmount
uint256 help

ContractTokensReclaimed Event

Parameters help
amount
uint256 help

ContributionMinimumUpdated Event

Parameters help
newAmount
uint256 help

OwnerChanged Event

Parameters help
_newOwner
address help

SaleResumed Event

Parameters help

SaleSuspended Event

Parameters help

TimeWindowUpdated Event

Parameters help
newStartTime
uint256 help
newEndTime
uint256 help

TokenFinalized Event

Parameters help

TokensPerKEtherUpdated Event

Parameters help
newAmount
uint256 help

TokensPurchased Event

Parameters help
beneficiary
address help
cost
uint256 help
tokens
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferOwnership(address _newOwner) public onlyOwner returns (bool) {
        require(_newOwner != address(0));
        require(_newOwner != owner);

        newOwner = _newOwner;

        return true;
    }

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function acceptOwnership() public returns (bool) {
        require(msg.sender == newOwner);

        owner = msg.sender;

        OwnerChanged(msg.sender);

        return true;
    }

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

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

transfer keyboard_arrow_up

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 returns (bool success) {
        if (!isTransferAllowed(msg.sender, _to)) {
            return false;
        }

        return super.transfer(_to, _amount);
    }

transferFrom keyboard_arrow_up

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 returns (bool success) {
        if (!isTransferAllowed(_from, _to)) {
            return false;
        }

        return super.transferFrom(_from, _to, _amount);
    }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
     function approve(address _spender, uint256 _value) public returns (bool success) {
         allowed[msg.sender][_spender] = _value;

         Approval(msg.sender, _spender, _value);

         return true;
     }

allowance keyboard_arrow_up

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

currentTime keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

setTokensPerKEther keyboard_arrow_up

Parameters help

Name Type
_tokensPerKEther
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setTokensPerKEther(uint256 _tokensPerKEther) external onlyOwner returns(bool) {
        require(_tokensPerKEther > 0);

        // Set the tokensPerKEther amount for any new sale.
        tokensPerKEther = _tokensPerKEther;

        TokensPerKEtherUpdated(_tokensPerKEther);

        return true;
    }

setContributionMinimum keyboard_arrow_up

Parameters help

Name Type
_contributionMinimum
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setContributionMinimum(uint256 _contributionMinimum) external onlyOwner returns(bool) {
        require(_contributionMinimum > 0);

        // Set the tokensPerKEther amount for any new sale.
        contributionMinimum = _contributionMinimum;

        ContributionMinimumUpdated(_contributionMinimum);

        return true;
    }

setBonus keyboard_arrow_up

Parameters help

Name Type
_bonus
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setBonus(uint256 _bonus) external onlyOwner returns(bool) {
        // 100 means no bonus
        require(_bonus >= 100);

        // 200 means 100% bonus
        require(_bonus <= 200);

        bonus = _bonus;

        BonusAmountUpdated(_bonus);

        return true;
    }

setTimeWindow keyboard_arrow_up

Parameters help

Name Type
_startTime
uint256 help
_endTime
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setTimeWindow(uint256 _startTime, uint256 _endTime) external onlyOwner returns(bool) {
        require(_startTime >= START_TIME);
        require(_endTime > _startTime);

        startTime = _startTime;
        endTime   = _endTime;

        TimeWindowUpdated(_startTime, _endTime);

        return true;
    }

suspend keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function suspend() external onlyOwner returns(bool) {
        if (suspended == true) {
            return false;
        }

        suspended = true;

        SaleSuspended();

        return true;
    }

resume keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function resume() external onlyOwner returns(bool) {
        if (suspended == false) {
            return false;
        }

        suspended = false;

        SaleResumed();

        return true;
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function () payable public {
        buyTokens(msg.sender);
    }

buyTokens keyboard_arrow_up

Parameters help

Name Type
beneficiary
address help

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function buyTokens(address beneficiary) public payable returns (uint256) {
        require(!suspended);
        require(beneficiary != address(0x0));
        require(beneficiary != address(this));
        require(currentTime() >= startTime);
        require(currentTime() <= endTime);
        require(msg.value >= contributionMinimum);
        require(msg.sender != fundingAddress);

        // Check if the sale contract still has tokens for sale.
        uint256 saleBalance = balanceOf(address(this));
        require(saleBalance > 0);

        // Calculate the number of tokens that the ether should convert to.
        uint256 tokens = msg.value.mul(tokensPerKEther).mul(bonus).div(10**(18 - DECIMALS + 3 + 2));
        require(tokens > 0);

        uint256 cost = msg.value;
        uint256 refund = 0;

        if (tokens > saleBalance) {
            // Not enough tokens left for sale to fulfill the full order.
            tokens = saleBalance;

            // Calculate the actual cost for the tokens that can be purchased.
            cost = tokens.mul(10**(18 - DECIMALS + 3 + 2)).div(tokensPerKEther.mul(bonus));

            // Calculate the amount of ETH refund to the contributor.
            refund = msg.value.sub(cost);
        }

        totalTokensSold = totalTokensSold.add(tokens);

        // Move tokens from the sale contract to the beneficiary
        balances[address(this)] = balances[address(this)].sub(tokens);
        balances[beneficiary]   = balances[beneficiary].add(tokens);
        Transfer(address(this), beneficiary, tokens);

        if (refund > 0) {
           msg.sender.transfer(refund);
        }

        // Transfer the contributed ether to the crowdsale wallets.
        uint256 contribution      = msg.value.sub(refund);

        fundingAddress.transfer(contribution);

        TokensPurchased(beneficiary, cost, tokens);

        return tokens;
    }

reclaimContractTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function reclaimContractTokens() external onlyOwner returns (bool) {
        uint256 tokens = balanceOf(address(this));

        if (tokens == 0) {
            return false;
        }

        balances[address(this)] = balances[address(this)].sub(tokens);
        balances[bankAddress]   = balances[bankAddress].add(tokens);
        Transfer(address(this), bankAddress, tokens);

        ContractTokensReclaimed(tokens);

        return true;
    }

finalize keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function finalize() external onlyOwner returns (bool) {
        require(!finalized);

        finalized = true;

        TokenFinalized();

        return true;
    }