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
Name | Type | Description |
---|---|---|
largestTurnNum | uint48 | The largest turn number of the submitted states; will overwrite the stored value of turnNumRecord . |
fixedPart | struct IForceMove.FixedPart | Data describing properties of the state channel that do not change with state updates. |
appPartHash | bytes32 | The keccak256 of the abi.encode of (challengeDuration, appDefinition, appData) . Applies to all states in the finalization proof. |
outcomeBytes | bytes | abi.encode of an array of Outcome.OutcomeItem structs. |
numStates | uint8 | The number of states in the finalization proof. |
whoSignedWhat | uint8[] | An array denoting which participant has signed which state: participant[i] signed the state with index whoSignedWhat[i] . |
sigs | struct IForceMove.Signature[] | Array of signatures, one for each participant, in participant order (e.g. [sig of participant[0], sig of participant[1], ...]). |
transferAllAssets
Liquidates all assets for the channel
function transferAllAssets(bytes32 channelId, bytes outcomeBytes, bytes32 stateHash) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
channelId | bytes32 | Unique identifier for a state channel |
outcomeBytes | bytes | abi.encode of an array of Outcome.OutcomeItem structs. |
stateHash | bytes32 | stored 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
Name | Type | Description |
---|---|---|
nParticipants | uint256 | Number of participants in the channel. |
transition | ||
isFinalAB | bool[2] | Pair of booleans denoting whether the first and second state (resp.) are final. |
ab | struct IForceMoveApp.VariablePart[2] | Variable parts of each of the pair of states |
turnNumB | uint48 | turnNum of the later state of the pair. |
appDefinition | address | Address 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
Name | Type | Description |
---|---|---|
exit | struct ExitFormat.SingleAssetExit[] | The exit to be paid out. |