PHPackages                             gri3li/ethereum-smart-contract - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gri3li/ethereum-smart-contract

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gri3li/ethereum-smart-contract
==============================

Ethereum Smart Contract Wrapper Class

v1.0(7y ago)101544BSD-3-ClausePHPPHP &gt;=7.0

Since May 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/gri3li/php-ethereum-smart-contract)[ Packagist](https://packagist.org/packages/gri3li/ethereum-smart-contract)[ RSS](/packages/gri3li-ethereum-smart-contract/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Ethereum Smart Contract
=======================

[](#ethereum-smart-contract)

Ethereum Smart Contract Wrapper

Install
-------

[](#install)

```
composer require gri3li/ethereum-smart-contract

```

Usage
-----

[](#usage)

Create contract instance:

```
use gri3li\EthereumSmartContract;

$instance = EthereumSmartContract::createByHost(
    'http://localhost:8545',
    '1', // mainnet
    '0xB8c77482e45F1F44dE1745F52C74426C631bDD52', // contract address
    file_get_contents('path_to_contract_abi_file.json') // abi string
);
```

Reading, for example, erc20 token get balance:

```
$response = $instance->read('balanceOf', ['0x227390eeba512120c16C239B6556C0992022E961']);
var_dump($response);

/* array(1) {
  'balance' =>
  class phpseclib\Math\BigInteger#47 (2) {
    public $value =>
    string(24) "0x01c3ca8bcdc38115a80020"
    public $engine =>
    string(3) "gmp"
  }
} */

/** @var \BI\BigInteger $balance */
$balance = $response['balance'];
var_dump($balance->toString());
```

Writing, for example, erc20 token send transfer:

```
$fromPrivateKey = '4ffe6b52e5f649794dd4f75ed91276ad0dd417ec24cd24ba22802ea50e9d34fd';
$toAddress = '0x227390eeba512120c16C239B6556C0992022E962';
$amount = '1000000000000000000';
$gasLimit = '800000';
$gasPrice = '12000000000';
$txHash = $instance->write('transfer', [$toAddress, $amount], $fromPrivateKey, $gasPrice, $gasLimit);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2560d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9025e322e40cc0b7e63072b03618ea0a3cdafd198fd28fe6d431d27b4ae66f2f?d=identicon)[gri3li](/maintainers/gri3li)

---

Top Contributors

[![gri3li](https://avatars.githubusercontent.com/u/1644876?v=4)](https://github.com/gri3li "gri3li (1 commits)")

---

Tags

ethereumsmart-contractsoliditytokenethereumetherc20smart-contracterc721

### Embed Badge

![Health badge](/badges/gri3li-ethereum-smart-contract/health.svg)

```
[![Health](https://phpackages.com/badges/gri3li-ethereum-smart-contract/health.svg)](https://phpackages.com/packages/gri3li-ethereum-smart-contract)
```

###  Alternatives

[kornrunner/ethereum-offline-raw-tx

Pure PHP Ethereum Offline Raw Transaction Signer

63192.1k22](/packages/kornrunner-ethereum-offline-raw-tx)[furqansiddiqui/erc20-php

Interact with any ERC20 standard/backward-compatible Ethereum token

16466.3k4](/packages/furqansiddiqui-erc20-php)[kornrunner/solidity

Pure PHP implementation of Solidity

1940.5k11](/packages/kornrunner-solidity)[kornrunner/ethereum-token

PHP Ethereum Token Utils

1412.9k1](/packages/kornrunner-ethereum-token)

PHPackages © 2026

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