Module Precompiles

Source
Expand description

EVM precompiles interface. For illustration purposes only, as precompiles don’t follow the Solidity ABI codec.

Parameter names and types are taken from evm.codes.

interface Precompiles {
    struct EcPairingInput { uint256 x1; uint256 y1; uint256 x2; uint256 y2; uint256 x3; uint256 y3; }
    function ecrecover(bytes32 hash, uint8 v, uint256 r, uint256 s) returns (address publicAddress);
    function sha256(bytes data) returns (bytes32 hash);
    function ripemd(bytes data) returns (bytes20 hash);
    function identity(bytes data) returns (bytes data);
    function modexp(uint256 Bsize, uint256 Esize, uint256 Msize, bytes B, bytes E, bytes M) returns (bytes value);
    function ecadd(uint256 x1, uint256 y1, uint256 x2, uint256 y2) returns (uint256 x, uint256 y);
    function ecmul(uint256 x1, uint256 y1, uint256 s) returns (uint256 x, uint256 y);
    function ecpairing(EcPairingInput[] input) returns (bool success);
    function blake2f(uint32 rounds, uint64[8] h, uint64[16] m, uint64[2] t, bool f) returns (uint64[8] h);
    function pointEvaluation(bytes32 versionedHash, bytes32 z, bytes32 y, bytes1[48] commitment, bytes1[48] proof) returns (bytes value);
}

Structs§

EcPairingInput
blake2fCall
Function with signature blake2f(uint32,uint64[8],uint64[16],uint64[2],bool) and selector 0x746d111f.
blake2fReturn
Container type for the return parameters of the blake2f(uint32,uint64[8],uint64[16],uint64[2],bool) function.
ecaddCall
Function with signature ecadd(uint256,uint256,uint256,uint256) and selector 0xbb8c256a.
ecaddReturn
Container type for the return parameters of the ecadd(uint256,uint256,uint256,uint256) function.
ecmulCall
Function with signature ecmul(uint256,uint256,uint256) and selector 0x8081a1e7.
ecmulReturn
Container type for the return parameters of the ecmul(uint256,uint256,uint256) function.
ecpairingCall
Function with signature ecpairing((uint256,uint256,uint256,uint256,uint256,uint256)[]) and selector 0xbe0cc2ea.
ecpairingReturn
Container type for the return parameters of the ecpairing((uint256,uint256,uint256,uint256,uint256,uint256)[]) function.
ecrecoverCall
Function with signature ecrecover(bytes32,uint8,uint256,uint256) and selector 0xd2f97333.
ecrecoverReturn
Container type for the return parameters of the ecrecover(bytes32,uint8,uint256,uint256) function.
identityCall
Function with signature identity(bytes) and selector 0x840f6120.
identityReturn
Container type for the return parameters of the identity(bytes) function.
modexpCall
Function with signature modexp(uint256,uint256,uint256,bytes,bytes,bytes) and selector 0x45789fb1.
modexpReturn
Container type for the return parameters of the modexp(uint256,uint256,uint256,bytes,bytes,bytes) function.
pointEvaluationCall
Function with signature pointEvaluation(bytes32,bytes32,bytes32,bytes1[48],bytes1[48]) and selector 0xf3b9dfa3.
pointEvaluationReturn
Container type for the return parameters of the pointEvaluation(bytes32,bytes32,bytes32,bytes1[48],bytes1[48]) function.
ripemdCall
Function with signature ripemd(bytes) and selector 0xcc94c6b0.
ripemdReturn
Container type for the return parameters of the ripemd(bytes) function.
sha256Call
Function with signature sha256(bytes) and selector 0xbebc76dd.
sha256Return
Container type for the return parameters of the sha256(bytes) function.

Enums§

PrecompilesCalls
Container for all the Precompiles function calls.