Blockchain / Global / Address
Contract
0xB0140DBA52403AdA53A1aa2efb52fc185FcC2092
- Balance
- 0 SOMI
- Transactions sent
- 1
- Type
- Contract · 403 bytes of code
PauseLib Verified
- Compiler
- v0.8.22+commit.4fc1097e
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- shanghai
- License
- none
- Verified
- 2026-09-18
contracts/libraries/PauseLib.sol
and 1 more files
solidity
pragma solidity ^0.8.0;
import {PauseModule} from "contracts/modules/PauseModule.sol";
/// @notice Pause state transitions.
/// @dev Linked library. Runs via delegatecall against PauseModule's namespaced storage.
library PauseLib {
/// @dev Must equal PauseModule.PauseStorageLocation.
bytes32 private constant PauseStorageLocation = 0x242e96562e738afaa26e2a4eb34bb6ab09c26cd11226ccf8fbc02da32756d300;
function _getPauseStorage() private pure returns (PauseModule.PauseStorage storage $) {
assembly {
$.slot := PauseStorageLocation
}
}
function pause() external {
PauseModule.PauseStorage storage $ = _getPauseStorage();
if ($.isPaused) revert PauseModule.IsPaused();
$.isPaused = true;
emit PauseModule.Paused();
}
function unpause() external {
PauseModule.PauseStorage storage $ = _getPauseStorage();
if (!$.isPaused) revert PauseModule.NotPaused();
$.isPaused = false;
emit PauseModule.Unpaused();
}
}
Other files
contracts/modules/PauseModule.sol
pragma solidity ^0.8.0; import {PauseLib} from "contracts/libraries/PauseLib.sol"; /* * @title PauseModule * @dev Contract module that allows pausing and unpausing of the contract. * @dev State transitions are delegated to `PauseLib`. */ abstract contract PauseModule { struct PauseStorage { bool isPaused; } /// @dev keccak256(abi.encode(uint256(keccak256("frax.storage.PauseModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PauseStorageLocation = 0x242e96562e738afaa26e2a4eb34bb6ab09c26cd11226ccf8fbc02da32756d300; function _getPauseStorage() private pure returns (PauseStorage storage $) { assembly { $.slot := PauseStorageLocation } } function _pause() internal virtual { PauseLib.pause(); } function _unpause() internal virtual { PauseLib.unpause(); } /// @notice Return whether the contract is paused /// @return bool True if paused, false otherwise function isPaused() public view virtual returns (bool) { PauseStorage storage $ = _getPauseStorage(); return $.isPaused; } /* ========== EVENTS ========== */ /// @notice Event Emitted when the contract is paused event Paused(); /// @notice Event Emitted when the contract is unpaused event Unpaused(); /* ========== ERRORS ========== */ error IsPaused(); error NotPaused(); }
ABI · 4 entries
json
[
{
"inputs": [],
"name": "IsPaused",
"type": "error"
},
{
"inputs": [],
"name": "NotPaused",
"type": "error"
},
{
"anonymous": false,
"inputs": [],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Unpaused",
"type": "event"
}
]