Developer Docs
AppGitHub
  • Welcome!
  • Smart contracts
    • Core
      • Introduction
      • Deep Dive
      • Smart Contract Reference
        • PWN Hub
          • Tags
        • PWN Config
        • PWN Vault
        • Loan Types
          • Simple Loan
        • Proposals
          • Simple Loan Proposal
            • Simple Proposal
            • List Proposal
            • Elastic Proposal
            • Elastic Chainlink Proposal
            • Dutch Proposal
        • PWN Utilized Credit
        • PWN LOAN
        • PWN Revoked Nonce
        • Peripheral Contracts
          • Acceptor Controller
            • World ID
          • State Fingerprint Computer
            • UniV3
            • Chicken Bonds
          • Pool Adapter
            • Aave
            • Compound
            • ERC4626
        • Miscellaneous
          • PWN Fee Calculator
          • PWN Signature Checker
          • PWN Errors
          • PWN Periphery
          • Timelock
    • PWN DAO
      • Governance
        • Optimistic
        • Token
      • Tokens
        • PWN
        • stPWN
        • vePWN
          • Stake
          • Power
          • Metadata
      • Epoch Clock
      • Miscellaneous
        • Errors
        • EpochPowerLib
    • Tools
      • PWN Safe
        • Architecture
        • Security considerations
        • Smart Contract Reference
          • PWN Safe Factory
          • ATR Module
            • Tokenized Asset Manager
            • Recipient Permission Manager
          • Whitelist
          • ATR Guard
            • Operators context
      • Token Bundler
      • PWN Deployer
    • Libraries
      • MultiToken
    • Contract Addresses
  • More documentation
    • PWN Docs
    • FAQ
    • Audits
    • Using PWN without front-end
  • Deprecated
    • PWN Beta
      • Architecture
      • PWN
        • Off-chain signed offer
        • Offer types
      • PWN Vault
      • PWN LOAN
Powered by GitBook
On this page
  • 1. Summary
  • 2. Important links
  • 3. Implementation
Edit on GitHub
  1. Smart contracts
  2. Core
  3. Smart Contract Reference
  4. Peripheral Contracts

Pool Adapter

PreviousState Fingerprint ComputerNextMiscellaneous

Last updated 9 months ago

1. Summary

IPoolAdapter.sol defines interface each PoolAdapter contract has to implement. Pool adapters allows usage of funds locked in a pool such as Aave.

2. Important links

3. Implementation

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.16;

/**
 * @title IPoolAdapter
 * @notice Interface for pool adapters used to withdraw and supply assets to the pool.
 */
interface IPoolAdapter {

    /**
     * @notice Withdraw an asset from the pool on behalf of the owner.
     * @dev Withdrawn asset remains in the owner. Caller must have the ACTIVE_LOAN tag in the hub.
     * @param pool The address of the pool from which the asset is withdrawn.
     * @param owner The address of the owner from whom the asset is withdrawn.
     * @param asset The address of the asset to withdraw.
     * @param amount The amount of the asset to withdraw.
     */
    function withdraw(address pool, address owner, address asset, uint256 amount) external;

    /**
     * @notice Supply an asset to the pool on behalf of the owner.
     * @dev Need to transfer the asset to the adapter before calling this function.
     * @param pool The address of the pool to which the asset is supplied.
     * @param owner The address of the owner on whose behalf the asset is supplied.
     * @param asset The address of the asset to supply.
     * @param amount The amount of the asset to supply.
     */
    function supply(address pool, address owner, address asset, uint256 amount) external;

}
pwn_contracts/src/interfaces/IPoolAdapter.sol at master · PWNFinance/pwn_contractsGitHub
Logo