Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

interface IPause {
function paused() external view returns (bool);
}

contract IncrementContract {
IPause private instance pauseContract;
uint32 private instance count;

error PausedError();

constructor(IPause _pause) {
pauseContract = _pause;
}

function increment() public returns (uint32) {
// Cross-contract call to check the paused state
if (pauseContract.paused()) {
revert PausedError();
}

count += 1;

return count;
}
}
Loading