Skip to main content

CallbackLib

Git Source

Title: Library for verifying and decoding Uniswap callbacks.

Author: Axicon Labs Limited

This library provides functions to verify that a callback came from a canonical Uniswap V3 pool with a claimed set of features.

Functions

validateCallback

Verifies that a callback came from the canonical Uniswap pool with a claimed set of features.

function validateCallback(address sender, IUniswapV3Factory factory, PoolFeatures memory features) internal view;

Parameters

NameTypeDescription
senderaddressThe address initiating the callback and claiming to be a Uniswap pool
factoryIUniswapV3FactoryThe address of the canonical Uniswap V3 factory
featuresPoolFeaturesThe features sender claims to contain (tokens and fee)

Structs

PoolFeatures

Type defining characteristics of a Uniswap V3 pool.

struct PoolFeatures {
address token0;
address token1;
uint24 fee;
}

Properties

NameTypeDescription
token0addressThe address of token0 for the Uniswap pool
token1addressThe address of token1 for the Uniswap pool
feeuint24The fee tier of the Uniswap pool (in hundredths of basis points)

CallbackData

Type for data sent by pool in mint/swap callbacks used to validate the pool and send back requisite tokens.

struct CallbackData {
PoolFeatures poolFeatures;
address payer;
}

Properties

NameTypeDescription
poolFeaturesPoolFeaturesThe features of the pool that sent the callback (used to validate that the pool is canonical)
payeraddressThe address from which the requested tokens should be transferred