Skip to content

Commit

Permalink
Merge pull request #133 from OffchainLabs/add-pendingblk-blktimeadvan…
Browse files Browse the repository at this point in the history
…ce-contract
  • Loading branch information
ganeshvanahalli committed Feb 27, 2024
2 parents b8a12f1 + 7c46876 commit 551da72
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "../precompiles/ArbSys.sol";

contract PendingBlkTimeAndNrAdvanceCheck {
uint256 immutable deployedAt;
uint256 immutable deployedAtBlock;

constructor() {
deployedAt = block.timestamp;
deployedAtBlock = ArbSys(address(100)).arbBlockNumber();
}

function isAdvancing() external {
require(block.timestamp > deployedAt, "Time didn't advance");
require(ArbSys(address(100)).arbBlockNumber() > deployedAtBlock, "Block didn't advance");
}
}

0 comments on commit 551da72

Please sign in to comment.