PHPackages                             kaadon/erc20-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kaadon/erc20-php

ActiveLibrary[API Development](/categories/api)

kaadon/erc20-php
================

Interact with any ERC20 standard/backward-compatible Ethereum token

v0.3.2(1y ago)031MITPHPPHP ^8.1

Since Feb 28Pushed 1y agoCompare

[ Source](https://github.com/kaadon/erc20-php)[ Packagist](https://packagist.org/packages/kaadon/erc20-php)[ RSS](/packages/kaadon-erc20-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

ERC20 Tokens
============

[](#erc20-tokens)

Interact with any ERC20 standard Ethereum token

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).

This package relies on [furqansiddiqui/ethereum-php](https://github.com/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.

Ethereum NodeStatusGeth / Ethereum-Go RPC✔️Infura.IO✔️Demo
----

[](#demo)

- Testing interaction with `Thether USD` / `USDT` ERC20 smart contract:

```
use FurqanSiddiqui\Ethereum\RPC\Infura;
use FurqanSiddiqui\Ethereum\ERC20\ERC20;

$infura = new Infura("PROJECT-ID", "PROJECT-SECRET");
$infura->ignoreSSL(); // In case Infura.IO SSL errors (or provide "caRootFile:" to constructor above)

$erc20 = new ERC20($infura);
$usdt = $erc20->deployedAt("0xdac17f958d2ee523a2206206994597c13d831ec7");
var_dump($usdt->name());
var_dump($usdt->symbol());
var_dump($usdt->decimals());
var_dump($usdt->totalSupply());
$balance = $usdt->balanceOf($eth->getAccount("ETHEREUM-ADDRESS"));
var_dump($balance);
var_dump($usdt->getScaledValue($balance));
```

Result:

```
string(9) "TetherUSD"
string(4) "USDT"
int(6)
string(18) "32284517903064882"
string(11) "53150417979"
string(12) "53150.417979"

```

Custom ABI
----------

[](#custom-abi)

- Standard/base ERC20 ABI is included in package.
- To included extended/custom ERC20 ABI (depending on your requirments), use one of the following methods:
    - Extend [BaseERC20Contract](src/BaseERC20Contract.php) class to define custom ABI functions and events.
    - Decode your custom ABI JSON file and provide it to constructor:

```
use \FurqanSiddiqui\Ethereum\Contracts\Contract;

$customABI  =   Contract::fromArray(json_decode(file_get_contents("YOUR-CUSTOM-ABI.json"), true), true);
$erc20 = new ERC20(abi: $customABI);
```

### Scaled Values

[](#scaled-values)

Use `getScaledValue` and `fromScaledValue` to convert amounts from/to `uint256`.

### Prerequisites

[](#prerequisites)

- **PHP** ^8.1
- **Ethereum PHP lib** ([furqansiddiqui/ethereum-php](https://github.com/furqansiddiqui/ethereum-php/)) &gt; 0.2.0

Installation
------------

[](#installation)

`composer require furqansiddiqui/erc20-php`

Changelog
---------

[](#changelog)

- **0.3.0**: This library alongside several others such as [ethereum-php](https://github.com/furqansiddiqui/ethereum-php/) have been modernised and requires PHP ^8.1.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance44

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

444d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/58987658?v=4)[Kaadon](/maintainers/kaadon)[@kaadon](https://github.com/kaadon)

---

Top Contributors

[![kaadon](https://avatars.githubusercontent.com/u/58987658?v=4)](https://github.com/kaadon "kaadon (2 commits)")

---

Tags

ethereumethgethethereum-goerc20erc223infurainfura.io

### Embed Badge

![Health badge](/badges/kaadon-erc20-php/health.svg)

```
[![Health](https://phpackages.com/badges/kaadon-erc20-php/health.svg)](https://phpackages.com/packages/kaadon-erc20-php)
```

###  Alternatives

[furqansiddiqui/erc20-php

Interact with any ERC20 standard/backward-compatible Ethereum token

16466.3k4](/packages/furqansiddiqui-erc20-php)[furqansiddiqui/ethereum-rpc

Ethereum (geth) RPC client

2550.6k4](/packages/furqansiddiqui-ethereum-rpc)[drlecks/simple-web3-php

Web3 library in PHP

7641.6k2](/packages/drlecks-simple-web3-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
