IForceMove.sol

View Source: contracts/interfaces/IForceMove.sol

โ†˜ Derived Contracts: ForceMove

The IForceMove interface defines the interface that an implementation of ForceMove should implement. ForceMove protocol allows state channels to be adjudicated and finalized.


Structs

Signature

struct Signature {
uint8 v,
bytes32 r,
bytes32 s
}

FixedPart

struct FixedPart {
uint256 chainId,
address[] participants,
uint48 channelNonce,
address appDefinition,
uint48 challengeDuration
}

State

struct State {
uint48 turnNum,
bool isFinal,
bytes32 channelId,
bytes32 appPartHash,
bytes32 outcomeHash
}

Events

event ChallengeRegistered(bytes32 indexed channelId, uint48 turnNumRecord, uint48 finalizesAt, bool isFinal, struct IForceMove.FixedPart fixedPart, struct IForceMoveApp.VariablePart[] variableParts, struct IForceMove.Signature[] sigs, uint8[] whoSignedWhat);
event ChallengeCleared(bytes32 indexed channelId, uint48 newTurnNumRecord);
event Concluded(bytes32 indexed channelId, uint48 finalizesAt);

Functions


challenge

Registers a challenge against a state channel. A challenge will either prompt another participant into clearing the challenge (via one of the other methods), or cause the channel to finalize at a specific time.

function challenge(struct IForceMove.FixedPart fixedPart, uint48 largestTurnNum, struct IForceMoveApp.VariablePart[] variableParts, uint8 isFinalCount, struct IForceMove.Signature[] sigs, uint8[] whoSignedWhat, struct IForceMove.Signature challengerSig) external nonpayable

Arguments

NameTypeDescription
fixedPartstruct IForceMove.FixedPartData describing properties of the state channel that do not change with state updates.
largestTurnNumuint48The largest turn number of the submitted states; will overwrite the stored value of turnNumRecord.
variablePartsstruct IForceMoveApp.VariablePart[]An ordered array of structs, each decribing the properties of the state channel that may change with each state update.
isFinalCountuint8Describes how many of the submitted states have the isFinal property set to true. It is implied that the rightmost isFinalCount states are final, and the rest are not final.
sigsstruct IForceMove.Signature[]An array of signatures that support the state with the largestTurnNum: one for each participant, in participant order (e.g. [sig of participant[0], sig of participant[1], ...]).
whoSignedWhatuint8[]An array denoting which participant has signed which state: participant[i] signed the state with index whoSignedWhat[i].
challengerSigstruct IForceMove.SignatureThe signature of a participant on the keccak256 of the abi.encode of (supportedStateHash, 'forceMove').

respond

Repsonds to an ongoing challenge registered against a state channel.

function respond(bool[2] isFinalAB, struct IForceMove.FixedPart fixedPart, struct IForceMoveApp.VariablePart[2] variablePartAB, struct IForceMove.Signature sig) external nonpayable

Arguments

NameTypeDescription
isFinalABbool[2]An pair of booleans describing if the challenge state and/or the response state have the isFinal property set to true.
fixedPartstruct IForceMove.FixedPartData describing properties of the state channel that do not change with state updates.
variablePartABstruct IForceMoveApp.VariablePart[2]An pair of structs, each decribing the properties of the state channel that may change with each state update (for the challenge state and for the response state).
sigstruct IForceMove.SignatureThe responder's signature on the responseStateHash.

checkpoint

Overwrites the turnNumRecord stored against a channel by providing a state with higher turn number, supported by a signature from each participant.

function checkpoint(struct IForceMove.FixedPart fixedPart, uint48 largestTurnNum, struct IForceMoveApp.VariablePart[] variableParts, uint8 isFinalCount, struct IForceMove.Signature[] sigs, uint8[] whoSignedWhat) external nonpayable

Arguments

NameTypeDescription
fixedPartstruct IForceMove.FixedPartData describing properties of the state channel that do not change with state updates.
largestTurnNumuint48The largest turn number of the submitted states; will overwrite the stored value of turnNumRecord.
variablePartsstruct IForceMoveApp.VariablePart[]An ordered array of structs, each decribing the properties of the state channel that may change with each state update.
isFinalCountuint8Describes how many of the submitted states have the isFinal property set to true. It is implied that the rightmost isFinalCount states are final, and the rest are not final.
sigsstruct IForceMove.Signature[]An array of signatures that support the state with the largestTurnNum: one for each participant, in participant order (e.g. [sig of participant[0], sig of participant[1], ...]).
whoSignedWhatuint8[]An array denoting which participant has signed which state: participant[i] signed the state with index whoSignedWhat[i].

conclude

Finalizes a channel by providing a finalization proof.

function conclude(uint48 largestTurnNum, struct IForceMove.FixedPart fixedPart, bytes32 appPartHash, bytes32 outcomeHash, uint8 numStates, uint8[] whoSignedWhat, struct IForceMove.Signature[] sigs) external nonpayable

Arguments

NameTypeDescription
largestTurnNumuint48The largest turn number of the submitted states; will overwrite the stored value of turnNumRecord.
fixedPartstruct IForceMove.FixedPartData describing properties of the state channel that do not change with state updates.
appPartHashbytes32The keccak256 of the abi.encode of (challengeDuration, appDefinition, appData). Applies to all states in the finalization proof.
outcomeHashbytes32The keccak256 of the abi.encode of the outcome. Applies to all stats in the finalization proof.
numStatesuint8The number of states in the finalization proof.
whoSignedWhatuint8[]An array denoting which participant has signed which state: participant[i] signed the state with index whoSignedWhat[i].
sigsstruct IForceMove.Signature[]An array of signatures that support the state with the largestTurnNum:: one for each participant, in participant order (e.g. [sig of participant[0], sig of participant[1], ...]).
Last updated on by geoknee