Skip to content

Commit

Permalink
reintroduce onlyBeforeForking
Browse files Browse the repository at this point in the history
  • Loading branch information
josojo committed Nov 28, 2023
1 parent eb95673 commit f50a575
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions contracts/ForkableBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ contract ForkableBridge is
public
payable
override(PolygonZkEVMBridge, IPolygonZkEVMBridge)
onlyBeforeCreatingChild1
onlyBeforeForking
{
PolygonZkEVMBridge.bridgeAsset(
destinationNetwork,
Expand All @@ -221,7 +221,7 @@ contract ForkableBridge is
payable
virtual
override(PolygonZkEVMBridge, IPolygonZkEVMBridge)
onlyBeforeCreatingChild1
onlyBeforeForking
{
PolygonZkEVMBridge.bridgeMessage(
destinationNetwork,
Expand All @@ -245,7 +245,7 @@ contract ForkableBridge is
)
public
override(IPolygonZkEVMBridge, PolygonZkEVMBridge)
onlyBeforeCreatingChild1
onlyBeforeForking
{
PolygonZkEVMBridge.claimMessage(
smtProof,
Expand Down Expand Up @@ -275,7 +275,7 @@ contract ForkableBridge is
)
public
override(IPolygonZkEVMBridge, PolygonZkEVMBridge)
onlyBeforeCreatingChild1
onlyBeforeForking
{
PolygonZkEVMBridge.claimAsset(
smtProof,
Expand Down
12 changes: 6 additions & 6 deletions contracts/ForkableZkEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {
}

////////////////////////////////////////////////////////////////////////////
// For the following functions a modifier called: onlyBeforeCreatingChild1 is added.
// For the following functions a modifier called: onlyBeforeForking is added.
// This ensure that the functions do not change the consolidated state after forking.
///////////////////////////////////////////////////////////////////////////

Expand All @@ -59,7 +59,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {
bytes32 newLocalExitRoot,
bytes32 newStateRoot,
bytes32[24] calldata proof
) public override onlyBeforeCreatingChild1 {
) public override onlyBeforeForking {
PolygonZkEVM.verifyBatches(
pendingStateNum,
initNumBatch,
Expand All @@ -77,7 +77,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {
bytes32 newLocalExitRoot,
bytes32 newStateRoot,
bytes32[24] calldata proof
) public override onlyBeforeCreatingChild1 {
) public override onlyBeforeForking {
PolygonZkEVM.verifyBatchesTrustedAggregator(
pendingStateNum,
initNumBatch,
Expand All @@ -90,7 +90,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {

function consolidatePendingState(
uint64 pendingStateNum
) public override onlyBeforeCreatingChild1 {
) public override onlyBeforeForking {
PolygonZkEVM.consolidatePendingState(pendingStateNum);
}

Expand All @@ -102,7 +102,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {
bytes32 newLocalExitRoot,
bytes32 newStateRoot,
bytes32[24] calldata proof
) public override onlyBeforeCreatingChild1 {
) public override onlyBeforeForking {
PolygonZkEVM.overridePendingState(
initPendingStateNum,
finalPendingStateNum,
Expand All @@ -119,7 +119,7 @@ contract ForkableZkEVM is ForkableStructure, IForkableZkEVM, PolygonZkEVM {
function sequenceBatches(
BatchData[] calldata batches,
address l2Coinbase
) public override onlyBeforeCreatingChild1 {
) public override onlyBeforeForking {
PolygonZkEVM.sequenceBatches(batches, l2Coinbase);
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/ForkingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contract ForkingManager is IForkingManager, ForkableStructure {
function initiateFork(
DisputeData memory _disputeData,
NewImplementations calldata _newImplementations
) external onlyBeforeCreatingChild1 {
) external onlyBeforeForking {
require(executionTimeForProposal == 0, "ForkingManager: fork pending");
// Charge the forking fee
IERC20(forkonomicToken).safeTransferFrom(
Expand All @@ -102,7 +102,7 @@ contract ForkingManager is IForkingManager, ForkableStructure {
/**
* @dev function that executes a fork proposal
*/
function executeFork1() external onlyBeforeCreatingChild1 {
function executeFork1() external onlyBeforeForking {
require(
executionTimeForProposal != 0 &&
// solhint-disable-next-line not-rely-on-time
Expand Down
2 changes: 1 addition & 1 deletion contracts/mixin/ForkableStructure.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract ForkableStructure is IForkableStructure, Initializable {
// but this would make the initialization more complex due to proxy construction.
mapping(uint256 => address) public children;

modifier onlyBeforeCreatingChild1() {
modifier onlyBeforeForking() {
require(children[0] == address(0x0), "No changes after forking");
_;
}
Expand Down

0 comments on commit f50a575

Please sign in to comment.