TCAP

ERC20 token on the Ethereum Blockchain that provides total exposure to the cryptocurrency sector. Uses Open Zeppelin ERC20 Library.

Code

TCAP.sol

Address

Mainnet

ContractAddress
TCAP0x16c52ceece2ed57dad87319d91b5e3637d50afa4

Rinkeby

ContractAddress
TCAP0x525471845A1b6E486930F4C8C50D21E7A4670fb2

ERC165 Introspection

mint.selector ^
burn.selector ^
setCap.selector ^
enableCap.selector ^
transfer.selector ^
transferFrom.selector ^
addVaultHandler.selector ^
removeVaultHandler.selector ^
approve.selector => 0xbd115939

The computed interface ID according to ERC-165. The interface ID is a XOR of all interface method selectors.

Public Variables

bool public capEnabled = false;

if enabled TCAP can't be minted if the total supply is above or equal the cap value.

uint256 public cap;

Maximum value the total supply of TCAP.

mapping(address => bool) public vaultHandlers;

Address to Vault Handler. Only vault handlers can mint and burn TCAP.

Private Variables

bytes4 private constant _INTERFACE_ID_TCAP = 0xbd115939;

The computed interface ID according to ERC-165. Indicates if this contract supports the tcap erc20 functions.

bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

The computed interface ID according to ERC-165. Indicates if this contract supports the ERC165 interface.

Events

Events are called each time the state changes on the contract.

event VaultHandlerAdded(
address indexed _owner,
address indexed _tokenHandler
);

An event emitted when a vault handler is added.

event VaultHandlerRemoved(
address indexed _owner,
address indexed _tokenHandler
);

An event emitted when a vault handler is removed.

event NewCap(address indexed _owner, uint256 _amount);

An event emitted when the cap value is updated.

event NewCapEnabled(address indexed _owner, bool _enable);

An event emitted when the cap is enabled or disabled.

Modifiers

onlyVault

modifier onlyVault();

Reverts if called by any account that is not a vault Vault.

Read-Only Functions

_beforeTokenTransfer

function _beforeTokenTransfer(
address _from,
address _to,
uint256 _amount
) internal virtual override;

This function is called before before each token transfer or mint, the mint of tokens to check if the total supply isn't above the cap. Reverts if TCAP tokens are sent to the TCAP contract.

See Open Zeppelin ERC20-_beforeTokenTransfer.

supportsInterface

function supportsInterface(bytes4 _interfaceId)
external
override
view
returns (bool);

ERC165 Standard for support of interfaces.

State-Changing Functions

constructor

constructor(
string memory _name,
string memory _symbol,
uint256 _cap,
Orchestrator _orchestrator
) public ERC20(_name, _symbol);

Called once the contract it's deployed, sets the orchestrator as owner.

addVaultHandler

function addVaultHandler(address _vaultHandler) external onlyOwner ;

Adds a new address as a vault vault handler contract. Only owner can call it.

removeVaultHandler

function removeVaultHandler(address _vaultHandler) external onlyOwner ;

Removes an address as a vault vault handler contract. Only owner can call it.

mint

mint(address _account, uint256 _amount) public onlyVault;

Mints TCAP Tokens. Only vault handler can call it.

burn

function burn(address _account, uint256 _amount) public onlyVault;

Burns TCAP Tokens. Only vault handler can call it.

setCap

function setCap(uint256 _cap) public onlyOwner;

Sets the maximum capacity of the token. When capEnabled is true, mint is not allowed to issue tokens that would increase the total supply above the specified capacity. Only owner can call it.

enableCap

function enableCap(bool _enable) public onlyOwner;

Enables or Disables the Token Cap. When capEnabled is true, minting will not be allowed above the max capacity. Only owner can call it