-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1625 from statechannels/feat/nitro-adjudicator-in…
…terface feat: add `INitroAdjudicator` interface
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.17; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import './IMultiAssetHolder.sol'; | ||
import './IForceMove.sol'; | ||
|
||
/** | ||
* @dev The INitroAdjudicator defines an interface for a contract that adjudicates state channels. It is based on IMultiAssetHolder and IForceMove, extending them with some functions. | ||
*/ | ||
interface INitroAdjudicator is IMultiAssetHolder, IForceMove { | ||
/** | ||
* @notice Finalizes a channel according to the given candidate, and liquidates all assets for the channel. | ||
* @dev Finalizes a channel according to the given candidate, and liquidates all assets for the channel. | ||
* @param fixedPart Data describing properties of the state channel that do not change with state updates. | ||
* @param candidate Variable part of the state to change to. | ||
*/ | ||
function concludeAndTransferAllAssets( | ||
FixedPart memory fixedPart, | ||
SignedVariablePart memory candidate | ||
) external; | ||
|
||
/** | ||
* @notice Liquidates all assets for the channel | ||
* @dev Liquidates all assets for the channel | ||
* @param channelId Unique identifier for a state channel | ||
* @param outcome An array of SingleAssetExit[] items. | ||
* @param stateHash stored state hash for the channel | ||
*/ | ||
function transferAllAssets( | ||
bytes32 channelId, | ||
Outcome.SingleAssetExit[] memory outcome, | ||
bytes32 stateHash | ||
) external; | ||
|
||
/** | ||
* @notice Checks whether an application-specific rules for a particular ForceMove-compliant state channel are enforced in supplied states. | ||
* @dev Checks whether an application-specific rules for a particular ForceMove-compliant state channel are enforced in supplied states. | ||
* @param fixedPart Fixed part of the state channel. | ||
* @param proof Variable parts of the states with signatures in the support proof. The proof is a validation for the supplied candidate. | ||
* @param candidate Variable part of the state to change to. The candidate state is supported by proof states. | ||
*/ | ||
function stateIsSupported( | ||
FixedPart calldata fixedPart, | ||
SignedVariablePart[] calldata proof, | ||
SignedVariablePart calldata candidate | ||
) external view returns (bool, string memory); | ||
} |
Oops, something went wrong.