Skip to content

Commit

Permalink
feat: remove _allowUpgrade flag from game impl setters in deploy scri…
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian authored Nov 26, 2024
1 parent b707cd8 commit c898ed1
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ contract Deploy is Deployer {
_data: abi.encodeCall(IDelayedWETH.initialize, (msg.sender, ISuperchainConfig(superchainConfigProxy)))
});

setAlphabetFaultGameImplementation({ _allowUpgrade: false });
setFastFaultGameImplementation({ _allowUpgrade: false });
setCannonFaultGameImplementation({ _allowUpgrade: false });
setAlphabetFaultGameImplementation();
setFastFaultGameImplementation();
setCannonFaultGameImplementation();

transferDisputeGameFactoryOwnership();
transferDelayedWETHOwnership();
Expand Down Expand Up @@ -875,15 +875,14 @@ contract Deploy is Deployer {
}

/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
function setCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
function setCannonFaultGameImplementation() public broadcast {
console.log("Setting Cannon FaultDisputeGame implementation");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));

// Set the Cannon FaultDisputeGame implementation in the factory.
_setFaultGameImplementation({
_factory: factory,
_allowUpgrade: _allowUpgrade,
_params: FaultDisputeGameParams({
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
weth: weth,
Expand All @@ -897,15 +896,14 @@ contract Deploy is Deployer {
}

/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
function setAlphabetFaultGameImplementation(bool _allowUpgrade) public onlyDevnet broadcast {
function setAlphabetFaultGameImplementation() public onlyDevnet broadcast {
console.log("Setting Alphabet FaultDisputeGame implementation");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));

Claim outputAbsolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
_setFaultGameImplementation({
_factory: factory,
_allowUpgrade: _allowUpgrade,
_params: FaultDisputeGameParams({
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
weth: weth,
Expand All @@ -920,7 +918,7 @@ contract Deploy is Deployer {
}

/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
function setFastFaultGameImplementation(bool _allowUpgrade) public onlyDevnet broadcast {
function setFastFaultGameImplementation() public onlyDevnet broadcast {
console.log("Setting Fast FaultDisputeGame implementation");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));
Expand All @@ -939,7 +937,6 @@ contract Deploy is Deployer {
);
_setFaultGameImplementation({
_factory: factory,
_allowUpgrade: _allowUpgrade,
_params: FaultDisputeGameParams({
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
weth: weth,
Expand All @@ -956,12 +953,11 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the given fault game type in the `DisputeGameFactory`.
function _setFaultGameImplementation(
IDisputeGameFactory _factory,
bool _allowUpgrade,
FaultDisputeGameParams memory _params
)
internal
{
if (address(_factory.gameImpls(_params.gameType)) != address(0) && !_allowUpgrade) {
if (address(_factory.gameImpls(_params.gameType)) != address(0)) {
console.log(
"[WARN] DisputeGameFactoryProxy: `FaultDisputeGame` implementation already set for game type: %s",
vm.toString(GameType.unwrap(_params.gameType))
Expand Down

0 comments on commit c898ed1

Please sign in to comment.