DEVELOPERS

Introduction

Capital Coin presents you a new way to buy, sell and exchange digital coins. We are here to offer you an instant, private and no fees cryptocurrency. Capital Coin uses Ethereum, aglobal, open-source platform for decentralized applications,also it is protected by technology Blockchain -which the entire CPTL network relies. associated to Blockchain.

Now you have safety access to your cryptocoins from anywhere and can trade with no worries. This platform allows to create and execute “smart contracts”, that are written as programming codes that can be executed in computers.

This way, it is possible to negotiate and make business with unknown people,in a transparent and fast way, also with low prices.

Contract

ERC-20 tokens such as CPTL are designed and used only on the Ethereum platform. They follow a list of patterns so they can be shared, exchanged for other tokens or transferred to a crypto wallet. To create these tokens we will use smart contracts. They are used to facilitate token transactions and to record token balances in an account.

ABI

ABI is an interface that represents what functions and state variables a smart contract ERC-20 has. You can get a full representation of CPTL contract ABI in this link.

Address

You can use the following contract address for integrations or viewing CPTL tokens in your wallet. More information can be found on Etherscan:

0xda605fd5e003e6de0f33f6474080623fa6483e3e

Decimals

CPTL tokens contain up to 8 decimal places. For example 1.00000000 = 1 CPTL.

Methods

The current methods supported by CPTL contract are:

 

 

Examples

Java

For Java language we recommend the web3j library.

//add dependency in gradle

compile (‘org.web3j:core:4.2.0’)

//instance cptl contract

YourSmartContract contract = YourSmartContract.load(“0x<address>|<ensName>”, Abi abi);

//transfer cptl tokens

TransactionReceipt transactionReceipt = contract.transfer(address, amount).send();

Javascript

For Javascript or NodeJS we recommend the ethers.js library.

 

$ npm install –save ethers

var ethers = require(‘ethers’);

//instance wallet with private key

let wallet = new ethers.Wallet(myPrivateKey);

//connect to provider

wallet = wallet.connect(new ethers.providers.InfuraProvider(‘mainnet’, myProject));

//instance cptl contract

let contract = new ethers.Contract(cptlContractAddress, cptlABI, wallet);

//format amount to transfer

let amount = ethers.utils.parseUnits(amount, 8);

//send transaction

contract.transfer(receiverAddress, amount).then(function (tx) {

    console.log(tx);

}).catch((error) => {

    console.log(error);

});

PHP

For PHP language we recommend the web3.php library.

$ composer require sc0vu/web3.php dev-master

use Web3\Web3;

use Web3\Contract;

//instance cptl contract

$contract = new Contract(‘http://localhost:8545’, $abi);

//transfer cptl tokens

$contract->at($contractAddress)->call(‘transfer’, [$address, $amount], function($txhash){

    var_dump($txhash);

});

Python

For Python language we recommend the web3.py library.

$ pip install web3

from web3.auto import w3

//instance ctpl contract

cptl = w3.eth.contract(address=address, abi=ABI)

//transfer cptl tokens

cptl.functions.transfer(address=address, amount=amount).transact()