LogoLogo
Tokemak.xyzTokemak AppGithubXDiscord
  • Autopilot
    • Introduction
    • A New Way to Provide Liquidity
    • Protocol Mechanics
      • Components & Logic
      • Asset Flow Example
    • Autopools & LATs
    • Staking TOKE
    • Custom Autopools
    • Glossary
  • USING THE APP
    • App Guide
      • Autopools
        • Deposit and Withdraw
        • Stake and Unstake
        • Claim Incentives
        • View Positions
      • Staking TOKE
        • Stake and Allocate
        • Unstake and Withdraw
        • View Positions
        • Claim Rewards
      • Toke/ETH LP
      • Guarded Launch Rewards
    • With Wallet Services
      • Fireblocks
    • Troubleshooting
  • Developer Docs
    • Contracts Overview
      • Autopool ETH Contracts Overview
        • Autopilot System High Level Overview
        • Autopilot Contracts and Systems
          • Autopilot Contract Security
          • Stats
          • Autopilot Strategy
          • Pricing
          • Swap Router
          • Curve Resolver
          • Message Proxy
          • accTOKE
          • Autopilot Router
          • Liquidation
          • Destination Vaults
          • Autopools
        • Autopilot Contracts Glossary
      • Contract Addresses
    • Security and Audits
      • Hexens: autoUSD March 25th 2025
      • Hexens: Autopilot Follow Up/Updates Audit July 2024
      • Hexens: Tokemak Autopilot May 2024
      • Certora: LMPStrategy Security Assessment & Formal Verification Report - Jan/March 2024
      • Hats.Finance, Crowd Competition Smart Contract Audit, February - March 2024
      • Halborn - Autopilot (Autopools) Contracts - Preliminary Smart Contract Audit - Sept 2023
      • Halborn - Autopilot Pricing Contracts - Formal Verification Report - Sept 2023
      • Sherlock - Autopilot Contracts - Crowd Competition - Sept 2023
      • Halborn - accTOKE Contract - Nov 2022
    • Integrating
      • 4626 Compliance
      • Large Withdrawals
      • Checking for Stale Data
  • Additional Links
    • Community Resources
Powered by GitBook
On this page
  • AccessController
  • SystemSecurity
  • Pausable

Was this helpful?

Export as PDF
  1. Developer Docs
  2. Contracts Overview
  3. Autopool ETH Contracts Overview
  4. Autopilot Contracts and Systems

Autopilot Contract Security

With the exception of the SystemRegistry contract which uses an “onlyOwner” setup for security (which will be granted to a multisig and eventually a Governor contract), all other contracts follow a RBAC security system.

AccessController

src/security/AccessController.sol

This is largely an OZ AccessControlEnumerable contract with the setup functions exposed, however, instead of each contract managing their own permissions, they all reference this one through the SecurityBase contract.

Given the sensitive nature of this contract, it is one of the contracts that can never be changed or upgraded in the system.

SystemSecurity

src/security/SystemSecurity.sol

This contract allows us to coordinate operations across all Autopools in the system. This coordination falls into two areas:

  1. Pausing

  2. NAV operation coordination

Pausing

Via the usage of this contract, we are able to pause all Autopool operations in the system. Autopools can still be paused locally or one-by-one, but this gives us a way pause all of them in one go.

NAV Operation Coordination

Operations in an Autopool can be broken down into ones that can see nav/share go down, and ones that can’t. To ensure proper calculations, operations that SHOULD NOT see a nav/share decrease can never be executed within the context of those that can.

Operations that can see a decrease in nav/share:

  • Debt reporting - updateDebtReporting()

  • Rebalances - flashRebalance()

Operations that shouldn’t:

  • User balance management - deposit() / mint() / redeem() / withdraw()

This restrictions applies cross-Autopool as well. An updateDebtReporting() call in one Autopool for example, blocks deposit() in all Autopools during its execution.

Pausable

src/security/Pausable.sol

A near duplicate of the OZ contract by the same name. However, this one incorporates our SystemSecurity contract to support our global-pause behavior. It is used only by our Autopools.

PreviousAutopilot Contracts and SystemsNextStats

Was this helpful?