matrix543/erc20-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

matrix543/erc20-php

最新稳定版本:0.1.4

Composer 安装命令:

composer require matrix543/erc20-php

包简介

Interact with any ERC20 standard Ethereum token

README 文档

README

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 communicates directly with Geth using RPC (matrix543/ethereum-rpc) and performs all ABI encoding and decoding in background, resulting in pure simple and easy to use API for developers to perform all ERC20 standard operations.

Demo

  • A random ERC20 token was picked from a list, given contract address 0xd26114cd6EE289AccF82350c8d8487fedB8A0C07
$geth = new EthereumRPC('127.0.0.1', 8545);
$erc20 = new \ERC20\ERC20($geth);
$token = $erc20->token('0xd26114cd6EE289AccF82350c8d8487fedB8A0C07');

var_dump($token->name());
var_dump($token->symbol());
var_dump($token->decimals());

Result:

string(8) "OMGToken"
string(3) "OMG"
int(18)

Installation

composer require matrix543/erc20-php

Prerequisites

ABI

A standard ERC20 ABI file is included in package residing in "data" directory.

Path to a custom ABI may be specified when constructing ERC20 token object.

$geth = new EthereumRPC('127.0.0.1', 8545);
$erc20 = new \ERC20\ERC20($geth);
$erc20->abiPath('/path/to/abi.json');

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 96
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固