Blockwell

Amp

ERC20

This contract is an ERC20 token.

Name Amp
Symbol AMP
Decimals 18
Total Supply 89,767,795,053 AMP

About link

Amp (AMP) is a cryptocurrency token and operates on the Ethereum platform. Amp has a current supply of 85,231,428,501 with 4,224,314,276 in circulation. The last known price of Amp is $0.006500 USD and is down -2.07% over the last 24 hours. It is currently trading on 6 active market(s) with $268,475.897 traded over the last 24 hours. More information can be found at https://amptoken.org.

Stats

Public Functions 37
Event Types 15
Code Size 80,206 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

ApprovalByPartition Event

Parameters help
partition
bytes32 help
owner
address help
spender
address help
value
uint256 help

AuthorizedOperator Event

Parameters help
operator
address help
tokenHolder
address help

AuthorizedOperatorByPartition Event

Parameters help
partition
bytes32 help
operator
address help
tokenHolder
address help

ChangedPartition Event

Parameters help
fromPartition
bytes32 help
toPartition
bytes32 help
value
uint256 help

CollateralManagerRegistered Event

Parameters help
collateralManager
address help

Minted Event

Parameters help
operator
address help
to
address help
value
uint256 help
data
bytes help

OwnerUpdate Event

Parameters help
oldValue
address help
newValue
address help

OwnershipTransferAuthorization Event

Parameters help
authorizedAddress
address help

PartitionStrategySet Event

Parameters help
flag
bytes4 help
name
string help
implementation
address help

RevokedOperator Event

Parameters help
operator
address help
tokenHolder
address help

RevokedOperatorByPartition Event

Parameters help
partition
bytes32 help
operator
address help
tokenHolder
address help

Swap Event

Parameters help
operator
address help
from
address help
value
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

TransferByPartition Event

Parameters help
fromPartition
bytes32 help
operator
address help
from
address help
to
address help
value
uint256 help
data
bytes help
operatorData
bytes help

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function owner() public view returns (address) {
        return _owner;
    }

authorizedNewOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function authorizedNewOwner() public view returns (address) {
        return _authorizedNewOwner;
    }

authorizeOwnershipTransfer keyboard_arrow_up

Parameters help

Name Type
_authorizedAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function authorizeOwnershipTransfer(address _authorizedAddress) external {
        require(msg.sender == _owner, "Invalid sender");

        _authorizedNewOwner = _authorizedAddress;

        emit OwnershipTransferAuthorization(_authorizedNewOwner);
    }

assumeOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function assumeOwnership() external {
        require(msg.sender == _authorizedNewOwner, "Invalid sender");

        address oldValue = _owner;
        _owner = _authorizedNewOwner;
        _authorizedNewOwner = address(0);

        emit OwnerUpdate(oldValue, _owner);
    }

canImplementInterfaceForAddress keyboard_arrow_up

Parameters help

Name Type
_interfaceHash
bytes32 help
address help

Properties

Visibility help public
Mutability help view
Source Code
    function canImplementInterfaceForAddress(
        bytes32 _interfaceHash,
        address // Comments to avoid compilation warnings for unused variables. /*addr*/
    ) external view returns (bytes32) {
        if (_interfaceHashes[_interfaceHash]) {
            return ERC1820_ACCEPT_MAGIC;
        } else {
            return "";
        }
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

Parameters help

Name Type
_tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
    function balanceOf(address _tokenHolder) external override view returns (uint256) {
        return _balances[_tokenHolder];
    }

transfer keyboard_arrow_up

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) external override returns (bool) {
        _transferByDefaultPartition(msg.sender, msg.sender, _to, _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
Source Code
    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    ) external override returns (bool) {
        _transferByDefaultPartition(msg.sender, _from, _to, _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)
        external
        override
        view
        returns (uint256)
    {
        return _allowedByPartition[defaultPartition][_owner][_spender];
    }

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) external override returns (bool) {
        _approveByPartition(defaultPartition, msg.sender, _spender, _value);
        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)
        external
        returns (bool)
    {
        _approveByPartition(
            defaultPartition,
            msg.sender,
            _spender,
            _allowedByPartition[defaultPartition][msg.sender][_spender].add(_addedValue)
        );
        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)
        external
        returns (bool)
    {
        _approveByPartition(
            defaultPartition,
            msg.sender,
            _spender,
            _allowedByPartition[defaultPartition][msg.sender][_spender].sub(
                _subtractedValue
            )
        );
        return true;
    }

swap keyboard_arrow_up

Parameters help

Name Type
_from
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function swap(address _from) public {
        uint256 amount = swapToken.allowance(_from, address(this));
        require(amount > 0, EC_53_INSUFFICIENT_ALLOWANCE);

        require(
            swapToken.transferFrom(_from, swapTokenGraveyard, amount),
            EC_60_SWAP_TRANSFER_FAILURE
        );

        _mint(msg.sender, _from, amount);

        emit Swap(msg.sender, _from, amount);
    }

balanceOfByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
    function balanceOfByPartition(bytes32 _partition, address _tokenHolder)
        external
        view
        returns (uint256)
    {
        return _balanceOfByPartition[_tokenHolder][_partition];
    }

partitionsOf keyboard_arrow_up

Parameters help

Name Type
_tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
    function partitionsOf(address _tokenHolder) external view returns (bytes32[] memory) {
        return _partitionsOf[_tokenHolder];
    }

transferByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_from
address help
_to
address help
_value
uint256 help
_data
bytes help
_operatorData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferByPartition(
        bytes32 _partition,
        address _from,
        address _to,
        uint256 _value,
        bytes calldata _data,
        bytes calldata _operatorData
    ) external returns (bytes32) {
        return
            _transferByPartition(
                _partition,
                msg.sender,
                _from,
                _to,
                _value,
                _data,
                _operatorData
            );
    }

authorizeOperator keyboard_arrow_up

Parameters help

Name Type
_operator
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function authorizeOperator(address _operator) external {
        require(_operator != msg.sender, EC_58_INVALID_OPERATOR);

        _authorizedOperator[msg.sender][_operator] = true;
        emit AuthorizedOperator(_operator, msg.sender);
    }

revokeOperator keyboard_arrow_up

Parameters help

Name Type
_operator
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function revokeOperator(address _operator) external {
        require(_operator != msg.sender, EC_58_INVALID_OPERATOR);

        _authorizedOperator[msg.sender][_operator] = false;
        emit RevokedOperator(_operator, msg.sender);
    }

authorizeOperatorByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_operator
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function authorizeOperatorByPartition(bytes32 _partition, address _operator)
        external
    {
        require(_operator != msg.sender, EC_58_INVALID_OPERATOR);

        _authorizedOperatorByPartition[msg.sender][_partition][_operator] = true;
        emit AuthorizedOperatorByPartition(_partition, _operator, msg.sender);
    }

revokeOperatorByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_operator
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function revokeOperatorByPartition(bytes32 _partition, address _operator) external {
        require(_operator != msg.sender, EC_58_INVALID_OPERATOR);

        _authorizedOperatorByPartition[msg.sender][_partition][_operator] = false;
        emit RevokedOperatorByPartition(_partition, _operator, msg.sender);
    }

isOperator keyboard_arrow_up

Parameters help

Name Type
_operator
address help
_tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isOperator(address _operator, address _tokenHolder)
        external
        view
        returns (bool)
    {
        return _isOperator(_operator, _tokenHolder);
    }

isOperatorForPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_operator
address help
_tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isOperatorForPartition(
        bytes32 _partition,
        address _operator,
        address _tokenHolder
    ) external view returns (bool) {
        return _isOperatorForPartition(_partition, _operator, _tokenHolder);
    }

isOperatorForCollateralManager keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_operator
address help
_collateralManager
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isOperatorForCollateralManager(
        bytes32 _partition,
        address _operator,
        address _collateralManager
    ) external view returns (bool) {
        return
            _isCollateralManager[_collateralManager] &&
            (_isOperator(_operator, _collateralManager) ||
                _authorizedOperatorByPartition[_collateralManager][_partition][_operator]);
    }

name keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function name() external view returns (string memory) {
        return _name;
    }

symbol keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function symbol() external view returns (string memory) {
        return _symbol;
    }

decimals keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help pure
Source Code
    function decimals() external pure returns (uint8) {
        return uint8(18);
    }

granularity keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help pure
Source Code
    function granularity() external pure returns (uint256) {
        return _granularity;
    }

totalPartitions keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function totalPartitions() external view returns (bytes32[] memory) {
        return _totalPartitions;
    }

allowanceByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help view
Source Code
    function allowanceByPartition(
        bytes32 _partition,
        address _owner,
        address _spender
    ) external view returns (uint256) {
        return _allowedByPartition[_partition][_owner][_spender];
    }

approveByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function approveByPartition(
        bytes32 _partition,
        address _spender,
        uint256 _value
    ) external returns (bool) {
        _approveByPartition(_partition, msg.sender, _spender, _value);
        return true;
    }

increaseAllowanceByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_spender
address help
_addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function increaseAllowanceByPartition(
        bytes32 _partition,
        address _spender,
        uint256 _addedValue
    ) external returns (bool) {
        _approveByPartition(
            _partition,
            msg.sender,
            _spender,
            _allowedByPartition[_partition][msg.sender][_spender].add(_addedValue)
        );
        return true;
    }

decreaseAllowanceByPartition keyboard_arrow_up

Parameters help

Name Type
_partition
bytes32 help
_spender
address help
_subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function decreaseAllowanceByPartition(
        bytes32 _partition,
        address _spender,
        uint256 _subtractedValue
    ) external returns (bool) {
        // TOOD: Figure out if safe math will panic below 0
        _approveByPartition(
            _partition,
            msg.sender,
            _spender,
            _allowedByPartition[_partition][msg.sender][_spender].sub(_subtractedValue)
        );
        return true;
    }

registerCollateralManager keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function registerCollateralManager() external {
        // Short circuit a double registry
        require(!_isCollateralManager[msg.sender], EC_5C_ADDRESS_CONFLICT);

        collateralManagers.push(msg.sender);
        _isCollateralManager[msg.sender] = true;

        emit CollateralManagerRegistered(msg.sender);
    }

isCollateralManager keyboard_arrow_up

Parameters help

Name Type
_collateralManager
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isCollateralManager(address _collateralManager)
        external
        view
        returns (bool)
    {
        return _isCollateralManager[_collateralManager];
    }

setPartitionStrategy keyboard_arrow_up

Parameters help

Name Type
_prefix
bytes4 help
_implementation
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setPartitionStrategy(bytes4 _prefix, address _implementation) external {
        require(msg.sender == owner(), EC_56_INVALID_SENDER);
        require(!_isPartitionStrategy[_prefix], EC_5E_PARTITION_PREFIX_CONFLICT);
        require(_prefix != ZERO_PREFIX, EC_5F_INVALID_PARTITION_PREFIX_0);

        string memory iname = PartitionUtils._getPartitionStrategyValidatorIName(_prefix);

        ERC1820Client.setInterfaceImplementation(iname, _implementation);
        partitionStrategies.push(_prefix);
        _isPartitionStrategy[_prefix] = true;

        emit PartitionStrategySet(_prefix, iname, _implementation);
    }

isPartitionStrategy keyboard_arrow_up

Parameters help

Name Type
_prefix
bytes4 help

Properties

Visibility help public
Mutability help view
Source Code
    function isPartitionStrategy(bytes4 _prefix) external view returns (bool) {
        return _isPartitionStrategy[_prefix];
    }