NitroAdjudicator.sol

View Source: contracts/NitroAdjudicator.sol

โ†— Extends: ForceMove, MultiAssetHolder โ†˜ Derived Contracts: TESTNitroAdjudicator

The NitroAdjudicator contract extends MultiAssetHolder and ForceMove


Functions


concludeAndTransferAllAssets

Finalizes a channel by providing a finalization proof, and liquidates all assets for the channel.

function concludeAndTransferAllAssets(uint48 largestTurnNum, struct IForceMove.FixedPart fixedPart, bytes32 appPartHash, bytes outcomeBytes, uint8 numStates, uint8[] whoSignedWhat, struct IForceMove.Signature[] sigs) public 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.
outcomeBytesbytesabi.encode of an array of Outcome.OutcomeItem structs.
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.

transferAllAssets

Liquidates all assets for the channel

function transferAllAssets(bytes32 channelId, bytes outcomeBytes, bytes32 stateHash) public nonpayable

Arguments

NameTypeDescription
channelIdbytes32Unique identifier for a state channel
outcomeBytesbytesabi.encode of an array of Outcome.OutcomeItem structs.
stateHashbytes32stored state hash for the channel

validTransition

Check that the submitted pair of states form a valid transition (public wrapper for internal function _requireValidTransition)

function validTransition(uint256 nParticipants, bool[2] isFinalAB, struct IForceMoveApp.VariablePart[2] ab, uint48 turnNumB, address appDefinition) public pure
returns(bool)

Returns

true if the later state is a validTransition from its predecessor, reverts otherwise.

Arguments

NameTypeDescription
nParticipantsuint256Number of participants in the channel.
transition
isFinalABbool[2]Pair of booleans denoting whether the first and second state (resp.) are final.
abstruct IForceMoveApp.VariablePart[2]Variable parts of each of the pair of states
turnNumBuint48turnNum of the later state of the pair.
appDefinitionaddressAddress of deployed contract containing application-specific validTransition function.

_executeExit

Executes an exit by paying out assets and calling external contracts

function _executeExit(struct ExitFormat.SingleAssetExit[] exit) internal nonpayable

Arguments

NameTypeDescription
exitstruct ExitFormat.SingleAssetExit[]The exit to be paid out.
Last updated on by geoknee