Download the PHP package amashukov/abi-encoder-php without Composer

On this page you can find all versions of the php package amashukov/abi-encoder-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package abi-encoder-php

amashukov/abi-encoder-php

Solidity ABI calldata encoder in pure PHP — byte-for-byte parity with ethers.js v6.

CI PHPStan L9 Latest Version Downloads PHP Stars

Encode Ethereum / EVM Solidity ABI calldata in pure PHP: function selectors (methodId), static head types (address, uint8 / uint24 / uint256) and top-level dynamic types (bytes, string). Output is byte-for-byte equivalent to ethers.js v6 Interface.encodeFunctionData, so calldata built in PHP matches what your JavaScript tooling and Solidity contracts expect.

Features

Why amashukov/abi-encoder-php

Most PHP web3 stacks pull in web3p/web3.php (and its web3p/ethereum-abi) for ABI encoding, which is a much larger surface than a contract call usually needs. This package is intentionally narrow and dependency-light: it covers the head-only static types and top-level dynamic bytes / string that real EVM contract calls use, with explicit ethers.js v6 parity as the correctness bar. If you only need to build calldata for eth_sendRawTransaction, this is the focused tool.

Installation

Usage

Function selector

The selector is the first 4 bytes of the keccak-256 hash of the canonical signature, returned as 8 hex chars (no 0x).

Encode a full call

Each argument is a [type, value] pair. Supported types: address, uint8, uint24, uint256, bytes, string. Dynamic types (bytes, string) are placed in the tail with the correct head offset, exactly as the ABI spec + ethers.js produce.

Encode individual components

Scope

Intentionally narrow — covers the head-only static types and top-level dynamic bytes / string that real EVM contract calls use. Nested dynamic types (bytes[], string[], dynamic tuples) are out of scope.

Requirements

Related packages

Package Tier Purpose
amashukov/keccak-php leaf keccak-256 hashing (selector hash)
amashukov/eip1559-tx-signer-php composite EIP-1559 raw tx assembly + signing
amashukov/rlp-php leaf RLP encoding
amashukov/secp256k1-php leaf ECDSA sign / pubkey derivation
amashukov/eth-rpc-client-php RPC Ethereum JSON-RPC client
amashukov/eth-php meta EVM umbrella package

Quality

License

MIT.


All versions of abi-encoder-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-gmp Version *
amashukov/keccak-php Version ^0.1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amashukov/abi-encoder-php contains the following files

Loading the files please wait ...