Blockwell

PTest2

ERC20

This contract is an ERC20 token.

Name PTest2
Symbol PT2
Decimals 18
Total Supply 250,000,000 PT2

About

Stats

Public Functions 26
Event Types 11
Code Size 14,514 bytes

Library Use

Uses SafeMath for uint256.

AdminAdded Event

Parameters help
account
address help

AdminRemoved Event

Parameters help
account
address help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

Frozen Event

Parameters help
account
address help

Membership Event

Parameters help
account
address help
eth
uint256 help
tokens
uint256 help

MultiTransferPrevented Event

Parameters help
from
address help
to
address help
value
uint256 help

Paused Event

Parameters help
account
address help

PriceSet Event

Parameters help
price
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Unfrozen Event

Parameters help
account
address help

Unpaused Event

Parameters help
account
address help

Functions Expand All Collapse All

paused keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function paused() public view returns (bool) {
        return _paused;
    }

isFrozen keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isFrozen(address account) public view returns (bool) {
        return frozen.has(account);
    }

isAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isAdmin(address account) public view returns (bool) {
        return admins.has(account);
    }

addAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function addAdmin(address account) public onlyAdmin {
        _addAdmin(account);
    }

removeAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function removeAdmin(address account) public onlyAdmin {
        _removeAdmin(account);
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
    function () payable external {
        uint256 tokens = msg.value.div(price).mul(1 ether);

        _transfer(this, msg.sender, tokens);
        emit Membership(msg.sender, msg.value, tokens);
    }

tokensAvailable keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function tokensAvailable() public view returns (uint256) {
        return balanceOf(this);
    }

setPrice keyboard_arrow_up

Parameters help

Name Type
newPrice
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function setPrice(uint256 newPrice) public onlyAdmin {
        price = newPrice;
        emit PriceSet(price);
    }

withdrawTokens keyboard_arrow_up

Parameters help

Name Type
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function withdrawTokens(uint256 value) public onlyAdmin {
        _transfer(this, msg.sender, value);
    }

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function withdraw() public onlyAdmin {
        msg.sender.transfer(address(this).balance);
    }

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function pause() public whenNotPaused onlyAdmin {
        _pause();
    }

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function unpause() public whenPaused onlyAdmin {
        _unpause();
    }

freeze keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function freeze(address account) public onlyAdmin {
        _freeze(account);
    }

unfreeze keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function unfreeze(address account) public onlyAdmin {
        _unfreeze(account);
    }

multiFreeze keyboard_arrow_up

Parameters help

Name Type
account
address[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null

Requirements help

Source Code
    function multiFreeze(address[] account) public onlyAdmin {
        require(account.length > 0, "Account array must not be empty");

        for (uint256 i = 0; i < account.length; i++) {
            _freeze(account[i]);
        }
    }

multiUnfreeze keyboard_arrow_up

Parameters help

Name Type
account
address[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null

Requirements help

Source Code
    function multiUnfreeze(address[] account) public onlyAdmin {
        require(account.length > 0, "Account array must not be empty");

        for (uint256 i = 0; i < account.length; i++) {
            _unfreeze(account[i]);
        }
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

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

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) {
        return allowed[owner][spender];
    }

transfer keyboard_arrow_up

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

multiTransfer keyboard_arrow_up

Parameters help

Name Type
to
address[] help
value
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function multiTransfer(address[] to, uint256[] value) public whenNotPaused returns (bool) {
        require(to.length > 0, "To array must not be empty");
        require(value.length == to.length, "Arrays must be of equal length");

        for (uint256 i = 0; i < to.length; i++) {
            if (!isFrozen(to[i])) {
                _transfer(msg.sender, to[i], value[i]);
            } else {
                emit MultiTransferPrevented(msg.sender, to[i], value[i]);
            }
        }

        return true;
    }

approve keyboard_arrow_up

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function approve(address spender, uint256 value) public isNotFrozen whenNotPaused returns (bool) {
        require(spender != address(0));

        allowed[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
        allowed[from][msg.sender] = allowed[from][msg.sender].sub(value);
        _transfer(from, to, value);
        return true;
    }

multiTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address[] help
value
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function multiTransferFrom(address from, address[] to, uint256[] value) public whenNotPaused returns (bool) {
        require(to.length > 0, "To array must not be empty");
        require(value.length == to.length, "Arrays must be of equal length");

        for (uint256 i = 0; i < to.length; i++) {
            if (!isFrozen(to[i])) {
                allowed[from][msg.sender] = allowed[from][msg.sender].sub(value[i]);
                _transfer(from, to[i], value[i]);
            } else {
                emit MultiTransferPrevented(from, to[i], value[i]);
            }
        }

        return true;
    }

increaseAllowance keyboard_arrow_up

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function increaseAllowance(address spender, uint256 addedValue) public isNotFrozen whenNotPaused returns (bool) {
        require(spender != address(0));

        allowed[msg.sender][spender] = allowed[msg.sender][spender].add(addedValue);
        emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
        return true;
    }

decreaseAllowance keyboard_arrow_up

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function decreaseAllowance(address spender, uint256 subtractedValue) public isNotFrozen whenNotPaused returns (bool) {
        require(spender != address(0));

        allowed[msg.sender][spender] = allowed[msg.sender][spender].sub(subtractedValue);
        emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
        return true;
    }