LogoLogo
  • ⚒️Introduction
  • Overview
    • 📖Public Repositories
    • ⛓️Smart Contracts Addresses
      • ⛓️Mainnet
      • 🟣Polygon
      • 🔴Optimism
      • 🔵Arbitrum
      • 🕸️Other Sidechains and L2s
  • Developer Guides
    • 💱Using Transmuter
    • 💸Integrating Savings Contracts
    • ⚡Flash Loans
    • 🍶Liquidations in the Borrowing Module
    • 🌻Auto-Leverage and Capital-Efficiency in the Borrowing Module
  • Tools
    • 🔌API - Accessing Angle Data
  • Governance and Cross-Module Contracts
    • ⚖️AgToken - Stablecoin Contracts
    • 🛣️Router - Combining Protocol Interactions
    • 💫FlashAngle - Instant AgToken liquidity
    • 💗CoreBorrow - Access Control Manager
    • 🗳️ANGLE and veANGLE - Governance Token
  • Borrowing Module Contracts
    • 🔜Architecture Overview
    • 📀Smart Contracts Docs
      • 🏦VaultManager - Borrowing AgTokens
      • 👮Treasury - Stablecoin Accounting
      • 🔱Oracles - Getting Price Feeds
      • 🗡️Settlement - Closing VaultManager contracts
      • 💱Swapper - Helper for Liquidations and Auto-Leverage
    • 🔬Implementation Details
Powered by GitBook
On this page
  • 1. Introduction
  • 2. Contract Details
  • Interfaces
  • References
  • Access Control
  • 3. Key Mechanisms & Concepts
  • State-Changing Functions
  • View Functions

Was this helpful?

  1. Governance and Cross-Module Contracts

CoreBorrow - Access Control Manager

Integrity of the Borrowing Module

PreviousFlashAngle - Instant AgToken liquidityNextANGLE and veANGLE - Governance Token

Last updated 1 year ago

Was this helpful?

  • Contract Name: CoreBorrow

  • Contract Source:

1. Introduction

The CoreBorrow contract is the contract responsible for handling the access control across all the modules of the protocol. It is notably what is read by all Treasury contracts in the Borrowing module. It also manages the flashloan module. It has no minting rights though over stablecoin contracts.

Apart from some external view function, this contract only contains functions accessible to governance.

Only one version of this contract should be deployed per chain.

2. Contract Details

Interfaces

Implements ICoreBorrow, Initializable and AccessControlEnumerableUpgradeable. This contract is upgradeable.

References

  • flashLoanModule: Reference to the flashloan module for the stablecoin

Access Control

This contract is the only contract of the module which implements the AccessControl logic from OpenZeppelin. The enumerable logic is even implemented which enables to easily track which addresses have which role.

3. Key Mechanisms & Concepts

State-Changing Functions

The external state-changing functions of this protocol are only available to addresses (normally only one) with a governor role on the protocol:

  • addFlashLoanerTreasuryRole: To allow flash loans on a stablecoin of the protocol

  • addGovernor: To add a governor within the protocol

  • removeFlashLoanerTreasuryRole: To revoke the flash loan ability for a stablecoin

  • removeGovernor: Revokes a governor from the protocol

  • setFlashLoanModule: Changes the flashLoanModule of the protocol

  • setCore: Changes the core contract of the protocol

View Functions

There are some view functions for contracts to verify roles of addresses calling it within the Borrowing Module (through the Treasury contract in this case), or within any other protocol module:

  • isFlashLoanerTreasury: Checks whether a treasury contract is whitelisted so that flash loans can be taken on its associated stablecoin

  • isGovernor: Checks whether an address has the GOVERNOR_ROLE

  • isGovernorOrGuardian: Checks whether an address has the GUARDIAN_ROLE: by construction, all governors should also be guardian of the protocol

💗
https://github.com/AngleProtocol/borrow-contracts/tree/main/contracts/coreBorrow
9KB
CoreBorrow.json
CoreBorrow ABI