// SPDX-License-Identifier: BUSL-1.1 // solhint-disable pragma solidity =0.7.6; /// @dev https://raw.githubusercontent.com/Uniswap/v3-core/v1.0.0/contracts/NoDelegateCall.sol abstract contract NoDelegateCall { /// @dev The original address of this contract address private immutable original; constructor() { // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode. // In other words, this variable won't change when it's checked at runtime. original = address(this); } /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method, /// and the use of immutable means the address bytes are copied in every place the modifier is used. function checkNotDelegateCall() private view { require(address(this) == original); } /// @notice Prevents delegatecall into the modified method modifier noDelegateCall() { checkNotDelegateCall(); _; } }