Trait pallet_revive::pallet::Config
source · pub trait Config: Config {
Show 22 associated items
type Time: Time;
type Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo;
type RuntimeHoldReason: From<HoldReason>;
type CallFilter: Contains<<Self as Config>::RuntimeCall>;
type WeightPrice: Convert<Weight, <<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type WeightInfo: WeightInfo;
type ChainExtension: ChainExtension<Self> + Default;
type DepositPerByte: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type DepositPerItem: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type CodeHashLockupDepositPercent: Get<Perbill>;
type AddressMapper: AddressMapper<Self>;
type UnsafeUnstableInterface: Get<bool>;
type UploadOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type InstantiateOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type Debug: Debugger<Self>;
type Xcm: Controller<OriginFor<Self>, <Self as Config>::RuntimeCall, BlockNumberFor<Self>>;
type RuntimeMemory: Get<u32>;
type PVFMemory: Get<u32>;
type ChainId: Get<u64>;
type NativeToEthRatio: Get<u32>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
sourcetype Time: Time
type Time: Time
The time implementation used to supply timestamps to contracts through seal_now
.
sourcetype Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason>
type Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason>
The fungible in which fees are paid and contract balances are held.
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo
The overarching call type.
sourcetype RuntimeHoldReason: From<HoldReason>
type RuntimeHoldReason: From<HoldReason>
Overarching hold reason.
sourcetype CallFilter: Contains<<Self as Config>::RuntimeCall>
type CallFilter: Contains<<Self as Config>::RuntimeCall>
Filter that is applied to calls dispatched by contracts.
Use this filter to control which dispatchables are callable by contracts.
This is applied in addition to frame_system::Config::BaseCallFilter
.
It is recommended to treat this as a whitelist.
§Stability
The runtime must make sure that all dispatchables that are callable by
contracts remain stable. In addition Self::RuntimeCall
itself must remain stable.
This means that no existing variants are allowed to switch their positions.
§Note
Note that dispatchables that are called via contracts do not spawn their own wasm instance for each call (as opposed to when called via a transaction). Therefore please make sure to be restrictive about which dispatchables are allowed in order to not introduce a new DoS vector like memory allocation patterns that can be exploited to drive the runtime into a panic.
This filter does not apply to XCM transact calls. To impose restrictions on XCM transact calls, you must configure them separately within the XCM pallet itself.
sourcetype WeightPrice: Convert<Weight, <<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type WeightPrice: Convert<Weight, <<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
Used to answer contracts’ queries regarding the current weight price. This is not used to calculate the actual fee and is only for informational purposes.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Describes the weights of the dispatchables of this module and is also used to construct a default cost schedule.
sourcetype ChainExtension: ChainExtension<Self> + Default
type ChainExtension: ChainExtension<Self> + Default
Type that allows the runtime authors to add new host functions for a contract to call.
sourcetype DepositPerByte: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type DepositPerByte: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
The amount of balance a caller has to pay for each byte of storage.
§Note
It is safe to change this value on a live chain as all refunds are pro rata.
sourcetype DepositPerItem: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type DepositPerItem: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
The amount of balance a caller has to pay for each storage item.
§Note
It is safe to change this value on a live chain as all refunds are pro rata.
sourcetype CodeHashLockupDepositPercent: Get<Perbill>
type CodeHashLockupDepositPercent: Get<Perbill>
The percentage of the storage deposit that should be held for using a code hash.
Instantiating a contract, or calling chain_extension::Ext::lock_delegate_dependency
protects the code from being removed. In order to prevent abuse these actions are
protected with a percentage of the code deposit.
sourcetype AddressMapper: AddressMapper<Self>
type AddressMapper: AddressMapper<Self>
Use either valid type is address::AccountId32Mapper
or [address::H160Mapper
].
sourcetype UnsafeUnstableInterface: Get<bool>
type UnsafeUnstableInterface: Get<bool>
Make contract callable functions marked as #[unstable]
available.
Contracts that use #[unstable]
functions won’t be able to be uploaded unless
this is set to true
. This is only meant for testnets and dev nodes in order to
experiment with new features.
§Warning
Do not set to true
on productions chains.
sourcetype UploadOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
type UploadOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
Origin allowed to upload code.
By default, it is safe to set this to EnsureSigned
, allowing anyone to upload contract
code.
sourcetype InstantiateOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
type InstantiateOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
Origin allowed to instantiate code.
§Note
This is not enforced when a contract instantiates another contract. The
Self::UploadOrigin
should make sure that no code is deployed that does unwanted
instantiations.
By default, it is safe to set this to EnsureSigned
, allowing anyone to instantiate
contract code.
sourcetype Debug: Debugger<Self>
type Debug: Debugger<Self>
For most production chains, it’s recommended to use the ()
implementation of this
trait. This implementation offers additional logging when the log target
“runtime::revive” is set to trace.
sourcetype Xcm: Controller<OriginFor<Self>, <Self as Config>::RuntimeCall, BlockNumberFor<Self>>
type Xcm: Controller<OriginFor<Self>, <Self as Config>::RuntimeCall, BlockNumberFor<Self>>
A type that exposes XCM APIs, allowing contracts to interact with other parachains, and execute XCM programs.
sourcetype RuntimeMemory: Get<u32>
type RuntimeMemory: Get<u32>
The amount of memory in bytes that parachain nodes a lot to the runtime.
This is used in Pallet::integrity_test
to make sure that the runtime has enough
memory to support this pallet if set to the correct value.
sourcetype PVFMemory: Get<u32>
type PVFMemory: Get<u32>
The amount of memory in bytes that relay chain validators a lot to the PoV.
This is used in Pallet::integrity_test
to make sure that the runtime has enough
memory to support this pallet if set to the correct value.
This value is usually higher than Self::RuntimeMemory
to account for the fact
that validators have to hold all storage items in PvF memory.
sourcetype ChainId: Get<u64>
type ChainId: Get<u64>
The EIP-155 chain ID.
This is a unique identifier assigned to each blockchain network, preventing replay attacks.
sourcetype NativeToEthRatio: Get<u32>
type NativeToEthRatio: Get<u32>
The ratio between the decimal representation of the native token and the ETH token.