Precompiled Contracts (Previous docs)
Address 0x01: ecrecover(hash, v, r, s)
function ecrecover(bytes32 hash, bytes8 v, bytes32 r, bytes32 s) returns (address);Address 0x02: sha256(data)
function sha256(bytes data) returns (bytes32);Address 0x03: ripemd160(data)
function ripemd160(bytes data) returns (bytes32);Address 0x04: datacopy(data)
function callDatacopy(bytes memory data) public returns (bytes memory) {
bytes memory ret = new bytes(data.length);
assembly {
let len := mload(data)
if iszero(call(gas, 0x04, 0, add(data, 0x20), len, add(ret,0x20), len)) {
invalid()
}
}
return ret;
} Address 0x05: bigModExp(base, exp, mod)
Address 0x06: bn256Add(ax, ay, bx, by)
Address 0x07: bn256ScalarMul(x, y, scalar)
Address 0x08: bn256Pairing(a1, b1, a2, b2, a3, b3, ..., ak, bk)
Address 0x09: vmLog(str)
Address 0x0A: feePayer()
Address 0x0B: validateSender()
Last updated