Skip to content

Commit

Permalink
feat(ctb): PermissionedDisputeGame Role Accessors (ethereum-optimism#…
Browse files Browse the repository at this point in the history
…10194)

* feat(ctb): permissioned dg accessors

* feat(ctb): permissioned dg accessors

* feat(ctb): permissioned dg accessors

* fix(ctb):formatting

* snapshot

---------

Co-authored-by: clabby <[email protected]>
  • Loading branch information
refcell and clabby authored Apr 17, 2024
1 parent 844cc20 commit 234d097
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/scripts/fpac/FPACOPS.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ contract FPACOPS is Deploy, StdAssertions {
// Check the security override yoke configuration.
PermissionedDisputeGame soyGameImpl =
PermissionedDisputeGame(payable(address(dgfProxy.gameImpls(GameTypes.PERMISSIONED_CANNON))));
assertEq(soyGameImpl.proposer(), cfg.l2OutputOracleProposer());
assertEq(soyGameImpl.challenger(), cfg.l2OutputOracleChallenger());
assertEq(soyGameImpl.maxGameDepth(), cfg.faultGameMaxDepth());
assertEq(soyGameImpl.splitDepth(), cfg.faultGameSplitDepth());
assertEq(soyGameImpl.gameDuration().raw(), cfg.faultGameMaxDuration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "challenger",
"outputs": [
{
"internalType": "address",
"name": "challenger_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -442,6 +455,19 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "proposer",
"outputs": [
{
"internalType": "address",
"name": "proposer_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "resolve",
Expand Down
14 changes: 14 additions & 0 deletions packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,18 @@ contract PermissionedDisputeGame is FaultDisputeGame {
// Fallthrough initialization.
super.initialize();
}

////////////////////////////////////////////////////////////////
// IMMUTABLE GETTERS //
////////////////////////////////////////////////////////////////

/// @notice Returns the proposer address.
function proposer() external view returns (address proposer_) {
proposer_ = PROPOSER;
}

/// @notice Returns the challenger address.
function challenger() external view returns (address challenger_) {
challenger_ = CHALLENGER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ contract PermissionedDisputeGame_Init is DisputeGameFactory_Init {
PermissionedDisputeGame(payable(address(disputeGameFactory.create(GAME_TYPE, rootClaim, extraData))));

// Check immutables
assertEq(gameProxy.proposer(), PROPOSER);
assertEq(gameProxy.challenger(), CHALLENGER);
assertEq(gameProxy.gameType().raw(), GAME_TYPE.raw());
assertEq(gameProxy.absolutePrestate().raw(), absolutePrestate.raw());
assertEq(gameProxy.maxGameDepth(), 2 ** 3);
Expand Down

0 comments on commit 234d097

Please sign in to comment.