Skip to content

Latest commit

 

History

History
273 lines (246 loc) · 9.17 KB

Pausable.md

File metadata and controls

273 lines (246 loc) · 9.17 KB

Pausable contract. (Pausable.sol)

View Source: contracts/connectors/loantoken/Pausable.sol

↘ Derived Contracts: LoanTokenBase

Pausable contract

This contract code comes from bZx. bZx is a protocol for tokenized margin trading and lending https://bzx.network similar to the dYdX protocol.

  • The contract implements pausable functionality by reading on slots the pause state of contract functions.

Contract Members

Constants & Variables

bytes32 internal constant Pausable_FunctionPause;

Modifiers

pausable

modifier pausable(bytes4 sig) internal

Arguments

Name Type Description
sig bytes4

Functions


_isPaused

Check whether a function is paused. *

function _isPaused(bytes4 sig) internal view
returns(isPaused bool)

Arguments

Name Type Description
sig bytes4 The function ID, the selector on bytes4. *

Returns

isPaused Whether the function is paused: true or false.

Source Code
function _isPaused(bytes4 sig) internal view returns (bool isPaused) {
        bytes32 slot = keccak256(abi.encodePacked(sig, Pausable_FunctionPause));
        assembly {
            isPaused := sload(slot)
        }
    }

Contracts