2017 © Pedro Peláez
 

library erc20-php

Interact with any ERC20 standard Ethereum token

image

furqansiddiqui/erc20-php

Interact with any ERC20 standard Ethereum token

  • Tuesday, May 29, 2018
  • by furqansiddiqui
  • Repository
  • 4 Watchers
  • 6 Stars
  • 313 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 3 Versions
  • 663 % Grown

The README.md

ERC20 Tokens

Interact with any ERC20 standard Ethereum token, (*1)

This package is ultimate response to historic issue of no native API being available to PHP developers to interact with ERC20 tokens (i.e. web3js contracts API)., (*2)

This package relies on furqansiddiqui/ethereum-php package to perform all ABI encoding and decoding, as well as communication with Ethereum node using RPC/API, resulting in pure simple and easy to use API for developers to perform all ERC20 standard operations., (*3)

Ethereum Node Status
Geth / Ethereum-Go RPC :heavy_check_mark:
Infura.IO :heavy_check_mark:

Demo

  • Testing interaction with Thether USD / USDT ERC20 smart contract:
$eth = new \FurqanSiddiqui\Ethereum\Ethereum();
$infura = new \FurqanSiddiqui\Ethereum\RPC\InfuraAPI($eth, "PROJECT-ID", "PROJECT-SECRET");
$infura->ignoreSSL(); // In case Infura.IO SSL errors

$erc20 = new \FurqanSiddiqui\Ethereum\ERC20\ERC20($eth);
$erc20->useRPCClient($infura);

$usdt = $erc20->token("0xdac17f958d2ee523a2206206994597c13d831ec7");
var_dump($usdt->name());
var_dump($usdt->symbol());
var_dump($usdt->decimals());
var_dump($usdt->totalSupply());
var_dump($usdt->balanceOf($eth->getAccount("ETHEREUM-ADDRESS")));

Result:, (*4)

string(9) "TetherUSD"
string(4) "USDT"
int(6)
string(18) "10034907979.686358"
string(12) "53150.417979"

Prerequisites

Installation

composer require furqansiddiqui/erc20-php, (*5)

The Versions

29/05 2018

dev-master

9999999-dev

Interact with any ERC20 standard Ethereum token

  Sources   Download

MIT

The Requires

 

token ethereum tokens eth geth ethereum-go erc20

29/05 2018

0.1.1

0.1.1.0

Interact with any ERC20 standard Ethereum token

  Sources   Download

MIT

The Requires

 

token ethereum tokens eth geth ethereum-go erc20

09/05 2018

0.1.0

0.1.0.0

Interact with any ERC20 standard Ethereum token

  Sources   Download

MIT

The Requires

 

token ethereum tokens eth geth ethereum-go erc20