Overview

Integrate directly with Gearbox contracts from your Solidity code. This guide covers on-chain integration patterns for smart contract developers.

Prerequisites

  • Solidity 0.8.x experience

  • Familiarity with interface-based contract interaction

  • Understanding of ERC-20 and common DeFi patterns

What You'll Learn

Topic
Description

Contract Discovery

Find any protocol address via AddressProvider

Credit Operations

Interact with CreditFacade and CreditManager

Multicall Encoding

Build and execute multicalls in Solidity

Pool Operations

Deposit, withdraw, and read pool state

Guide Structure

  1. Contract Discovery - AddressProvider, ContractsRegister, navigation patterns

  2. Credit Operations - ICreditFacadeV3, ICreditManagerV3 interfaces

  3. Multicalls - MultiCall struct encoding, adapter calls

  4. Pool Operations - IPoolV3 deposit/withdraw, ERC-4626 functions

Key Interfaces

When to Use Solidity Integration

Use Case
Recommended

On-chain protocol integration

Yes

Building adapters

Yes

Composable strategies

Yes

Backend services

No (use SDK Guide)

Frontend applications

No (use SDK Guide)

For TypeScript/JavaScript applications, see the SDK Guide.

Architecture Understanding

For conceptual background on how Gearbox works:

Last updated