Skip to content
Open
Changes from all commits
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,40 @@
/// SPDX-License-Identifier: Apache-2.0

contract increment_with_pause {
address private instance pauseAddr;
uint32 private instance count;

error PausedError();

constructor(address _pauseAddr) {
pauseAddr = _pauseAddr;
}

function increment() public returns (uint32) {
bytes memory payload = abi.encode("paused");
(bool ok, bytes memory ret) = pauseAddr.call(payload);

// Decode the return value if the call succeeds
if (ok) {
bool isPaused = abi.decode(ret, (bool));
if (isPaused) {
revert PausedError();
}
Comment on lines +16 to +22
}

count += 1;
return count;
}
}

contract pause {
bool private instance _isPaused;

function paused() public view returns (bool) {
return _isPaused;
}

function set(bool p) public {
Comment on lines +30 to +37
_isPaused = p;
}
}
Loading