Skip to content

Commit

Permalink
Allow proxy precompile to perform subcalls and to be callable from ba…
Browse files Browse the repository at this point in the history
…tch on Moonriver/Moonbeam (moonbeam-foundation#2177)

* allow proxy precompile to perform subcalls and to be callable from batch

* fix imports
  • Loading branch information
librelois authored and imstar15 committed May 16, 2023
1 parent 2a4adc3 commit 7c92f9c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions runtime/moonbeam/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ use pallet_evm_precompile_democracy::DemocracyPrecompile;
use pallet_evm_precompile_modexp::Modexp;
use pallet_evm_precompile_parachain_staking::ParachainStakingPrecompile;
use pallet_evm_precompile_preimage::PreimagePrecompile;
use pallet_evm_precompile_proxy::OnlyIsProxy;
use pallet_evm_precompile_proxy::ProxyPrecompile;
use pallet_evm_precompile_proxy::{OnlyIsProxyAndProxy, ProxyPrecompile};
use pallet_evm_precompile_randomness::RandomnessPrecompile;
use pallet_evm_precompile_relay_encoder::RelayEncoderPrecompile;
use pallet_evm_precompile_sha3fips::Sha3FIPS256;
Expand Down Expand Up @@ -162,7 +161,16 @@ type MoonbeamPrecompilesAt<R> = (
CallPermitPrecompile<R>,
(SubcallWithMaxNesting<0>, CallableByContract),
>,
PrecompileAt<AddressU64<2059>, ProxyPrecompile<R>, CallableByContract<OnlyIsProxy<R>>>,
PrecompileAt<
AddressU64<2059>,
ProxyPrecompile<R>,
(
CallableByContract<OnlyIsProxyAndProxy<R>>,
SubcallWithMaxNesting<0>,
// Batch is the only precompile allowed to call Proxy.
CallableByPrecompile<OnlyFrom<AddressU64<2056>>>,
),
>,
PrecompileAt<
AddressU64<2060>,
XcmUtilsPrecompile<R, XcmExecutorConfig>,
Expand Down
14 changes: 11 additions & 3 deletions runtime/moonriver/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ use pallet_evm_precompile_democracy::DemocracyPrecompile;
use pallet_evm_precompile_modexp::Modexp;
use pallet_evm_precompile_parachain_staking::ParachainStakingPrecompile;
use pallet_evm_precompile_preimage::PreimagePrecompile;
use pallet_evm_precompile_proxy::OnlyIsProxy;
use pallet_evm_precompile_proxy::ProxyPrecompile;
use pallet_evm_precompile_proxy::{OnlyIsProxyAndProxy, ProxyPrecompile};
use pallet_evm_precompile_randomness::RandomnessPrecompile;
use pallet_evm_precompile_referenda::ReferendaPrecompile;
use pallet_evm_precompile_relay_encoder::RelayEncoderPrecompile;
Expand Down Expand Up @@ -164,7 +163,16 @@ type MoonriverPrecompilesAt<R> = (
CallPermitPrecompile<R>,
(SubcallWithMaxNesting<0>, CallableByContract),
>,
PrecompileAt<AddressU64<2059>, ProxyPrecompile<R>, CallableByContract<OnlyIsProxy<R>>>,
PrecompileAt<
AddressU64<2059>,
ProxyPrecompile<R>,
(
CallableByContract<OnlyIsProxyAndProxy<R>>,
SubcallWithMaxNesting<0>,
// Batch is the only precompile allowed to call Proxy.
CallableByPrecompile<OnlyFrom<AddressU64<2056>>>,
),
>,
PrecompileAt<
AddressU64<2060>,
XcmUtilsPrecompile<R, XcmExecutorConfig>,
Expand Down

0 comments on commit 7c92f9c

Please sign in to comment.