Type Alias moonbeam_runtime::MoonbeamPrecompiles
source · pub type MoonbeamPrecompiles<R> = PrecompileSetBuilder<R, (PrecompilesInRangeInclusive<(AddressU64<1>, AddressU64<4095>), (PrecompileAt<AddressU64<1>, ECRecover, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2>, Sha256, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<3>, Ripemd160, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<4>, Identity, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<5>, Modexp, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<6>, Bn128Add, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<7>, Bn128Mul, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<8>, Bn128Pairing, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<9>, Blake2F, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<256>, P256Verify<P256VerifyWeight>, (AcceptDelegateCall, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<1024>, Sha3FIPS256, (CallableByContract, CallableByPrecompile)>, RemovedPrecompileAt<AddressU64<1025>>, PrecompileAt<AddressU64<1026>, ECRecoverPublicKey, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2048>, ParachainStakingPrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2049>, CrowdloanRewardsPrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<ERC20_BALANCES_PRECOMPILE>, Erc20BalancesPrecompile<R, NativeErc20Metadata>, (CallableByContract, CallableByPrecompile)>, RemovedPrecompileAt<AddressU64<2051>>, PrecompileAt<AddressU64<2052>, XtokensPrecompile<R>, (SubcallWithMaxNesting<1>, CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2053>, RelayEncoderPrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2054>, XcmTransactorPrecompileV1<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2055>, AuthorMappingPrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2056>, BatchPrecompile<R>, (SubcallWithMaxNesting<2>, CallableByPrecompile<OnlyFrom<AddressU64<2056>>>)>, PrecompileAt<AddressU64<2057>, RandomnessPrecompile<R>, (SubcallWithMaxNesting<0>, CallableByContract)>, PrecompileAt<AddressU64<2058>, CallPermitPrecompile<R>, (SubcallWithMaxNesting<0>, CallableByContract)>, PrecompileAt<AddressU64<2059>, ProxyPrecompile<R>, (CallableByContract<OnlyIsProxyAndProxy<R>>, SubcallWithMaxNesting<0>, CallableByPrecompile<OnlyFrom<AddressU64<2056>>>)>, PrecompileAt<AddressU64<2060>, XcmUtilsPrecompile<R, XcmExecutorConfig>, CallableByContract<AllExceptXcmExecute<R, XcmExecutorConfig>>>, PrecompileAt<AddressU64<2061>, XcmTransactorPrecompileV2<R>, (CallableByContract, CallableByPrecompile)>, RemovedPrecompileAt<AddressU64<2062>>, RemovedPrecompileAt<AddressU64<2063>>, PrecompileAt<AddressU64<2064>, CollectivePrecompile<R, TreasuryCouncilInstance>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2065>, ReferendaPrecompile<R, Origin>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2066>, ConvictionVotingPrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2067>, PreimagePrecompile<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2068>, CollectivePrecompile<R, OpenTechCommitteeInstance>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2069>, PrecompileRegistry<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2070>, GmpPrecompile<R>, SubcallWithMaxNesting<0>>, PrecompileAt<AddressU64<2071>, XcmTransactorPrecompileV3<R>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2072>, IdentityPrecompile<R, MaxAdditionalFields>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2073>, RelayDataVerifierPrecompile<R, WeightInfo<Runtime>>, (CallableByContract, CallableByPrecompile)>, PrecompileAt<AddressU64<2074>, PalletXcmPrecompile<R, (SingleAddressMatcher<AccountId, ERC20_BALANCES_PRECOMPILE, Balances>, ForeignAssetMatcher<AccountId, AssetId, Runtime, (AsAssetType<AssetId, AssetType, AssetManager>, EvmForeignAssets)>, Erc20PalletMatcher<AccountId, Erc20XcmBridge>)>, (CallableByContract, CallableByPrecompile, SubcallWithMaxNesting<1>)>)>, PrecompileSetStartingWith<ForeignAssetPrefix, Erc20AssetsPrecompileSet<R, ForeignAssetInstance>, (CallableByContract, CallableByPrecompile)>, RemovedPrecompilesAt<DisabledLocalAssets<R>>)>;
Expand description
The PrecompileSet installed in the Moonbeam runtime. We include the nine Istanbul precompiles (https://github.com/ethereum/go-ethereum/blob/3c46f557/core/vm/contracts.go#L69) as well as a special precompile for dispatching Substrate extrinsics The following distribution has been decided for the precompiles 0-1023: Ethereum Mainnet Precompiles 1024-2047 Precompiles that are not in Ethereum Mainnet but are neither Moonbeam specific 2048-4095 Moonbeam specific precompiles
Aliased Type§
struct MoonbeamPrecompiles<R> { /* private fields */ }
Implementations
§impl<R, P> PrecompileSetBuilder<R, P>where
R: Config,
P: PrecompileSetFragment,
impl<R, P> PrecompileSetBuilder<R, P>where
R: Config,
P: PrecompileSetFragment,
pub fn new() -> PrecompileSetBuilder<R, P>
pub fn new() -> PrecompileSetBuilder<R, P>
Create a new instance of the PrecompileSet.
pub fn used_addresses(
) -> impl Iterator<Item = <<R as Config>::AccountProvider as AccountProvider>::AccountId>
pub fn used_addresses( ) -> impl Iterator<Item = <<R as Config>::AccountProvider as AccountProvider>::AccountId>
Return the list of mapped addresses contained in this PrecompileSet.
pub fn used_addresses_h160() -> impl Iterator<Item = H160>
pub fn used_addresses_h160() -> impl Iterator<Item = H160>
Return the list of H160 addresses contained in this PrecompileSet.
pub fn summarize_checks(&self) -> Vec<PrecompileCheckSummary>
Trait Implementations
§impl<R, P> PrecompileSet for PrecompileSetBuilder<R, P>where
R: Config,
P: PrecompileSetFragment,
impl<R, P> PrecompileSet for PrecompileSetBuilder<R, P>where
R: Config,
P: PrecompileSetFragment,
§fn execute(
&self,
handle: &mut impl PrecompileHandle
) -> Option<Result<PrecompileOutput, PrecompileFailure>>
fn execute( &self, handle: &mut impl PrecompileHandle ) -> Option<Result<PrecompileOutput, PrecompileFailure>>
Tries to execute a precompile in the precompile set.
If the provided address is not a precompile, returns None.
§fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult
fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult
Check if the given address is a precompile. Should only be called to
perform the check while not executing the precompile afterward, since
execute
already performs a check internally.§impl<R, P> IsActivePrecompile for PrecompileSetBuilder<R, P>where
P: IsActivePrecompile,
impl<R, P> IsActivePrecompile for PrecompileSetBuilder<R, P>where
P: IsActivePrecompile,
§fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult
fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult
Is the provided address an active precompile, a precompile that has
not be deactivated. Note that a deactivated precompile is still considered a precompile
for the EVM, but it will always revert when called.