Magpie Protocol
  • Magpie Protocol
    • What is Magpie solving?
      • What is DeFi?
    • Magpies Key Features
      • Use Cases
    • FLY
      • xFLY & FLY33
  • 📶Supported Networks
  • Guides
    • 📖Glossary of DeFi Terms
    • 👜Connect Wallet
    • 🔄On-Chain Swap
    • 🔀Cross-Chain Swap
    • 🔂Swap configuration
    • 🥚Magpie Boosts
    • 📒Transaction History
    • 💲Portfolio
  • Media Kit
  • 👩‍💻Developers
    • Magpie Contracts
      • MagpieCCTPBridge
      • MagpieCelerBridgeV2
      • MagpieRouterV3
      • MagpieStargateBridgeV3
      • LibAsset
      • LibBridge
      • LibRouter
    • Smart Contracts Audit
    • Deployments
    • API Reference
      • On chain swap
      • Cross chain swap
      • Requesting and Using API Key
Powered by GitBook
On this page
  • pause():
  • unpause():
  • enforceIsNotPaused():
  1. Developers
  2. Deprecated Magpie Contracts
  3. MagpieAggregator Diamond Proxy
  4. Pauser

LibPauser

The purpose of this library is to provide pause and unpause functionality for a contract.

pause():

It retrieves the storage state of the contract using LibMagpieAggregator.getStorage().

It sets the paused variable of the storage state to true. This variable is used to indicate whether the contract is currently paused or not.

It emits a Paused event, passing msg.sender as the parameter. The Paused event is emitted to notify listeners that the contract has been paused, and msg.sender represents the address of the sender who triggered the pause function.

unpause():

It retrieves the storage state of the contract using LibMagpieAggregator.getStorage().

It sets the paused variable of the storage state to false. This variable is used to indicate whether the contract is currently paused or not.

It emits a Paused event, passing msg.sender as the parameter. The Paused event is emitted to notify listeners that the contract has been unpaused, and msg.sender represents the address of the sender who triggered the unpause function.

enforceIsNotPaused():

The purpose of this function is to enforce that certain operations can only be performed when the contract is not paused. If the contract is indeed paused, the function reverts the transaction and provides an error message indicating that the contract is paused. This helps ensure that critical functions or actions are not performed during a paused state, maintaining the desired behavior and security of the contract.

Last updated 1 year ago

👩‍💻