-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: DisputeParameters -> ITournamentParametersProvider
- Loading branch information
Showing
6 changed files
with
63 additions
and
112 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
27 changes: 27 additions & 0 deletions
27
prt/contracts/src/CanonicalTournamentParametersProvider.sol
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,27 @@ | ||
// (c) Cartesi and individual authors (see AUTHORS) | ||
// SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
pragma solidity ^0.8.17; | ||
|
||
import "./ITournamentParametersProvider.sol"; | ||
import "./CanonicalConstants.sol"; | ||
|
||
contract CanonicalTournamentParametersProvider is | ||
ITournamentParametersProvider | ||
{ | ||
/// @inheritdoc ITournamentParametersProvider | ||
function tournamentParameters(uint64 level) | ||
external | ||
pure | ||
override | ||
returns (TournamentParameters memory) | ||
{ | ||
return TournamentParameters({ | ||
levels: ArbitrationConstants.LEVELS, | ||
log2step: ArbitrationConstants.log2step(level), | ||
height: ArbitrationConstants.height(level), | ||
matchEffort: ArbitrationConstants.MATCH_EFFORT, | ||
maxAllowance: ArbitrationConstants.MAX_ALLOWANCE | ||
}); | ||
} | ||
} |
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,15 @@ | ||
// (c) Cartesi and individual authors (see AUTHORS) | ||
// SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
pragma solidity ^0.8.17; | ||
|
||
import {TournamentParameters} from "./TournamentParameters.sol"; | ||
|
||
interface ITournamentParametersProvider { | ||
/// @notice Get tournament parameters for a given level. | ||
/// @param level The tournament level (0 = top) | ||
function tournamentParameters(uint64 level) | ||
external | ||
view | ||
returns (TournamentParameters memory); | ||
} |
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