Skip to content

Commit

Permalink
remove can fork (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
josojo authored Jan 1, 2024
1 parent 0de67bd commit 4147dfc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 14 deletions.
5 changes: 0 additions & 5 deletions contracts/ForkingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ contract ForkingManager is IForkingManager, ForkableStructure {
return (children[0] != address(0) || children[1] != address(0));
}

// TODO: If there is any other reason a fork can be prevented, eg the contract can be frozen by governance, add it here.
function canFork() external view returns (bool) {
return (executionTimeForProposal == 0);
}

/**
* @notice function to initiate and schedule the fork
* @param _disputeData the dispute contract and call to identify the dispute
Expand Down
2 changes: 1 addition & 1 deletion contracts/L1GlobalForkRequester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract L1GlobalForkRequester {
if (transferredBalance < forkingManager.arbitrationFee()) {
isForkGuaranteedNotToRevert = false;
}
if (!forkingManager.canFork()) {
if (forkingManager.isForkingInitiated()) {
isForkGuaranteedNotToRevert = false;
}

Expand Down
2 changes: 0 additions & 2 deletions contracts/interfaces/IForkingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ interface IForkingManager is IForkableStructure {

function isForkingExecuted() external returns (bool);

function canFork() external returns (bool);

// Struct that holds an address pair used to store the new child contracts
struct AddressPair {
address one;
Expand Down
3 changes: 0 additions & 3 deletions test/ForkingManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ contract ForkingManagerTest is Test {
function testForkingStatusFunctions() public {
assertFalse(forkmanager.isForkingInitiated());
assertFalse(forkmanager.isForkingExecuted());
assertTrue(forkmanager.canFork());

// Mint and approve the arbitration fee for the test contract
forkonomicToken.approve(address(forkmanager), arbitrationFee);
Expand All @@ -227,14 +226,12 @@ contract ForkingManagerTest is Test {

assertTrue(forkmanager.isForkingInitiated());
assertFalse(forkmanager.isForkingExecuted());
assertFalse(forkmanager.canFork());

vm.warp(block.timestamp + forkmanager.forkPreparationTime() + 1);
forkmanager.executeFork();

assertTrue(forkmanager.isForkingInitiated());
assertTrue(forkmanager.isForkingExecuted());
assertFalse(forkmanager.canFork());
}

function testInitiateForkChargesFees() public {
Expand Down
5 changes: 2 additions & 3 deletions test/L1GlobalForkRequester.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ contract L1GlobalForkRequesterTest is Test {
address(forkmanager.forkonomicToken()),
address(forkonomicToken)
);
assertTrue(forkmanager.canFork());
assertFalse(forkmanager.isForkingInitiated());
assertFalse(forkmanager.isForkingExecuted());

Expand Down Expand Up @@ -268,7 +267,7 @@ contract L1GlobalForkRequesterTest is Test {
address(forkmanager.forkonomicToken()),
address(forkonomicToken)
);
assertTrue(forkmanager.canFork());
assertFalse(forkmanager.isForkingInitiated());

l1GlobalForkRequester.handlePayment(
address(forkonomicToken),
Expand Down Expand Up @@ -316,7 +315,7 @@ contract L1GlobalForkRequesterTest is Test {
address(forkmanager.forkonomicToken()),
address(forkonomicToken)
);
assertTrue(forkmanager.canFork());
assertFalse(forkmanager.isForkingInitiated());

{
// Someone else starts and executes a fork before we can handle our payment
Expand Down

0 comments on commit 4147dfc

Please sign in to comment.