Module Precompiles

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);
    function bls12G1Add(bytes p1, bytes p2) returns (bytes result);
    function bls12G1Msm(bytes[] scalarsAndPoints) returns (bytes result);
    function bls12G2Add(bytes p1, bytes p2) returns (bytes result);
    function bls12G2Msm(bytes[] scalarsAndPoints) returns (bytes result);
    function bls12PairingCheck(bytes[] pairs) returns (bool success);
    function bls12MapFpToG1(bytes fp) returns (bytes result);
    function bls12MapFp2ToG2(bytes fp2) returns (bytes result);
    function p256Verify(bytes32 hash, uint256 r, uint256 s, uint256 qx, uint256 qy) returns (bool success);
}

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.
bls12G1AddCall
Function with signature bls12G1Add(bytes,bytes) and selector 0x11da19da.
bls12G1AddReturn
Container type for the return parameters of the bls12G1Add(bytes,bytes) function.
bls12G1MsmCall
Function with signature bls12G1Msm(bytes[]) and selector 0xf8061199.
bls12G1MsmReturn
Container type for the return parameters of the bls12G1Msm(bytes[]) function.
bls12G2AddCall
Function with signature bls12G2Add(bytes,bytes) and selector 0xff135b21.
bls12G2AddReturn
Container type for the return parameters of the bls12G2Add(bytes,bytes) function.
bls12G2MsmCall
Function with signature bls12G2Msm(bytes[]) and selector 0x86a23a72.
bls12G2MsmReturn
Container type for the return parameters of the bls12G2Msm(bytes[]) function.
bls12MapFp2ToG2Call
Function with signature bls12MapFp2ToG2(bytes) and selector 0x5542e24e.
bls12MapFp2ToG2Return
Container type for the return parameters of the bls12MapFp2ToG2(bytes) function.
bls12MapFpToG1Call
Function with signature bls12MapFpToG1(bytes) and selector 0xb3fc881e.
bls12MapFpToG1Return
Container type for the return parameters of the bls12MapFpToG1(bytes) function.
bls12PairingCheckCall
Function with signature bls12PairingCheck(bytes[]) and selector 0x6a8c937c.
bls12PairingCheckReturn
Container type for the return parameters of the bls12PairingCheck(bytes[]) 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.
p256VerifyCall
Function with signature p256Verify(bytes32,uint256,uint256,uint256,uint256) and selector 0x4fc9be0c.
p256VerifyReturn
Container type for the return parameters of the p256Verify(bytes32,uint256,uint256,uint256,uint256) 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.