[][src]Trait pallet_contracts::Trait

pub trait Trait: Trait {
    type Time: Time;
    type Randomness: Randomness<Self::Hash>;
    type Currency: Currency<Self::AccountId>;
    type Event: From<Event<Self>> + Into<Self::Event>;
    type DetermineContractAddress: ContractAddressFor<CodeHash<Self>, Self::AccountId>;
    type TrieIdGenerator: TrieIdGenerator<Self::AccountId>;
    type RentPayment: OnUnbalanced<NegativeImbalanceOf<Self>>;
    type SignedClaimHandicap: Get<Self::BlockNumber>;
    type TombstoneDeposit: Get<BalanceOf<Self>>;
    type StorageSizeOffset: Get<u32>;
    type RentByteFee: Get<BalanceOf<Self>>;
    type RentDepositOffset: Get<BalanceOf<Self>>;
    type SurchargeReward: Get<BalanceOf<Self>>;
    type MaxDepth: Get<u32>;
    type MaxValueSize: Get<u32>;
    type WeightPrice: Convert<Weight, BalanceOf<Self>>;

Associated Types

type Time: Time

type Randomness: Randomness<Self::Hash>

type Currency: Currency<Self::AccountId>

The currency in which fees are paid and contract balances are held.

type Event: From<Event<Self>> + Into<Self::Event>

The overarching event type.

type DetermineContractAddress: ContractAddressFor<CodeHash<Self>, Self::AccountId>

A function type to get the contract address given the instantiator.

type TrieIdGenerator: TrieIdGenerator<Self::AccountId>

trie id generator

type RentPayment: OnUnbalanced<NegativeImbalanceOf<Self>>

Handler for rent payments.

type SignedClaimHandicap: Get<Self::BlockNumber>

Number of block delay an extrinsic claim surcharge has.

When claim surcharge is called by an extrinsic the rent is checked for current_block - delay

type TombstoneDeposit: Get<BalanceOf<Self>>

The minimum amount required to generate a tombstone.

type StorageSizeOffset: Get<u32>

A size offset for an contract. A just created account with untouched storage will have that much of storage from the perspective of the state rent.

This is a simple way to ensure that contracts with empty storage eventually get deleted by making them pay rent. This creates an incentive to remove them early in order to save rent.

type RentByteFee: Get<BalanceOf<Self>>

Price of a byte of storage per one block interval. Should be greater than 0.

type RentDepositOffset: Get<BalanceOf<Self>>

The amount of funds a contract should deposit in order to offset the cost of one byte.

Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day, then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent. But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000, then it would pay 500 BU/day.

type SurchargeReward: Get<BalanceOf<Self>>

Reward that is received by the party whose touch has led to removal of a contract.

type MaxDepth: Get<u32>

The maximum nesting level of a call/instantiate stack.

type MaxValueSize: Get<u32>

The maximum size of a storage value in bytes.

type WeightPrice: Convert<Weight, BalanceOf<Self>>

Used to answer contracts's queries regarding the current weight price. This is not used to calculate the actual fee and is only for informational purposes.

Loading content...


Loading content...