Struct pallet_plasma::Module[][src]

pub struct Module<T: Config>(_);

Implementations

Claim Exit at StateUpdate There’re two kind of exit claims. ExitStateUpdate and ExitCheckpoint. The former needs inclusion proof of stateUpdate. The latter don’t need witness but check if checkpoint for the stateUpdate is finalized yet. inputs: [encode(stateUpdate), checkpoint] witness: [encode(inclusionProof)]

challenge prove the exiting coin has been spent. First element of challengeInputs must be either of bytes(“EXIT_SPENT_CHALLENGE”) or bytes(“EXIT_CHECKPOINT_CHALLENGE”) SPENT_CHALLENGE input: [SU] challengeInput: [label, transaction] witness: [signature] CHECKPOINT input: [SU] challengeInput: [label, checkpointSU] witness: []

prove exit is coin which hasn’t been spent. check checkpoint

If the exit can be withdrawable, isCompletable returns true.

challenge checkpiont _inputs: [encode(stateUpdate)] challenged state update _challengeInputs: [encode(stateUpdate)] challenging state update _witness: [encode(inclusionProof)] inclusionProof of challenging state update

Single aggregator address: AggregatorId

Current block number of commitment chain: BlockNumber

mapping from Plapps address to Exit predicate address.

mapping from Plapps address to ExitDeposit predicate address.

TotalDeposited is the most right coin id which has been deposited.

predicate address => payout address

Public callable Plasma commitment module methods.

verifyInclusion method verifies inclusion of message in Double Layer Tree. The message has range and token address and these also must be verified. Please see https://docs.plasma.group/projects/spec/en/latest/src/01-core/double-layer-tree.html for further details.

  • @param leaf a message to verify its inclusion
  • @param token_address token address of the message
  • @param range range of the message
  • @param inclusion_proof The proof data to verify inclusion
  • @param block_number block number where the Merkle root is stored

Public callable Plasma deposit module methods.

bare_finalize_exit called by this module.

  • @param _exitProperty A property which is instance of exit predicate and its inputs are range and StateUpdate that exiting account wants to withdraw. _exitProperty can be a property of ether ExitPredicate or ExitDepositPredicate.
  • @param _depositedRangeId Id of deposited range
  • @return return StateUpdate of exit property which is finalized.
  • @dev The steps of finalizeExit.
  1. Serialize exit property
  2. check the property is decided by Adjudication Contract.
  3. Transfer asset to payout contract corresponding to StateObject.

Please alse see https://docs.plasma.group/projects/spec/en/latest/src/02-contracts/deposit-contract.html#finalizeexit

@dev verify StateUpdate in Exit property. _exitProperty must be instance of ether ExitPredicate or ExitDepositPredicate. if _exitProperty is instance of ExitDepositPredicate, check _exitProperty.su is subrange of _exitProperty.checkpoint.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the current version of the pallet.

Returns the version of the pallet that is stored in storage. Read more

Run integrity test. Read more

This function is being called after every block import (when fully synced). Read more

The block is being finalized. Implement to have something happen. Read more

Something that should happen at genesis.

The block is being initialized. Implement to have something happen. Read more

Perform a module upgrade. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Cast reference.

Cast reference.

Cast mutable reference.

Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.