pub enum PrecompileId {
}
Expand description
Precompile with address and function. Unique precompile identifier.
Variants§
EcRec
Elliptic curve digital signature algorithm (ECDSA) public key recovery function.
Sha256
SHA2-256 hash function.
Ripemd160
RIPEMD-160 hash function.
Identity
Identity precompile.
ModExp
Arbitrary-precision exponentiation under modulo.
Bn254Add
Point addition (ADD) on the elliptic curve ‘alt_bn128’.
Bn254Mul
Scalar multiplication (MUL) on the elliptic curve ‘alt_bn128’.
Bn254Pairing
Bilinear function on groups on the elliptic curve ‘alt_bn128’.
Blake2F
Compression function F used in the BLAKE2 cryptographic hashing algorithm.
KzgPointEvaluation
Verify p(z) = y given commitment that corresponds to the polynomial p(x) and a KZG proof. Also verify that the provided commitment matches the provided versioned_hash.
Bls12G1Add
Point addition in G1 (curve over base prime field).
Bls12G1Msm
Multi-scalar-multiplication (MSM) in G1 (curve over base prime field).
Bls12G2Add
Point addition in G2 (curve over quadratic extension of the base prime field).
Bls12G2Msm
Multi-scalar-multiplication (MSM) in G2 (curve over quadratic extension of the base prime field).
Bls12Pairing
Pairing operations between a set of pairs of (G1, G2) points.
Bls12MapFpToGp1
Base field element mapping into the G1 point.
Bls12MapFp2ToGp2
Extension field element mapping into the G2 point.
P256Verify
ECDSA signature verification over the secp256r1 elliptic curve (also known as P-256 or prime256v1).
Custom(Cow<'static, str>)
Custom precompile identifier.
Implementations§
Source§impl PrecompileId
impl PrecompileId
Sourcepub fn mainnet_address(&self) -> Option<Address>
pub fn mainnet_address(&self) -> Option<Address>
Returns the mainnet address for the precompile.
Sourcepub fn precompile(&self, spec: PrecompileSpecId) -> Option<Precompile>
pub fn precompile(&self, spec: PrecompileSpecId) -> Option<Precompile>
Returns the precompile function for the given spec.
If case of PrecompileId::Custom
it will return None
.
For case where precompile was still not introduced in the spec,
it will return Some
with fork closest to activation.
Trait Implementations§
Source§impl Clone for PrecompileId
impl Clone for PrecompileId
Source§fn clone(&self) -> PrecompileId
fn clone(&self) -> PrecompileId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PrecompileId
impl Debug for PrecompileId
Source§impl Hash for PrecompileId
impl Hash for PrecompileId
Source§impl PartialEq for PrecompileId
impl PartialEq for PrecompileId
impl Eq for PrecompileId
impl StructuralPartialEq for PrecompileId
Auto Trait Implementations§
impl Freeze for PrecompileId
impl RefUnwindSafe for PrecompileId
impl Send for PrecompileId
impl Sync for PrecompileId
impl Unpin for PrecompileId
impl UnwindSafe for PrecompileId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more