Skip to main content
Helpful?

DeltaResolver

Git Source | Generated with forge doc

Inherits: ImmutableState

Abstract contract used to sync, send, and settle funds to the pool manager

Note that sync() is called before any erc-20 transfer in settle.

Functions

_take

Take an amount of currency out of the PoolManager

function _take(Currency currency, address recipient, uint256 amount) internal;

Parameters

NameTypeDescription
currencyCurrencyCurrency to take
recipientaddressAddress to receive the currency
amountuint256Amount to take

_settle

Pay and settle a currency to the PoolManager

The implementing contract must ensure that the payer is a secure address

function _settle(Currency currency, address payer, uint256 amount) internal;

Parameters

NameTypeDescription
currencyCurrencyCurrency to settle
payeraddressAddress of the payer
amountuint256Amount to send

_pay

Abstract function for contracts to implement paying tokens to the poolManager

The recipient of the payment should be the poolManager

function _pay(Currency token, address payer, uint256 amount) internal virtual;

Parameters

NameTypeDescription
tokenCurrencyThe token to settle. This is known not to be the native currency
payeraddressThe address who should pay tokens
amountuint256The number of tokens to send

_getFullDebt

Obtain the full amount owed by this contract (negative delta)

function _getFullDebt(Currency currency) internal view returns (uint256 amount);

Parameters

NameTypeDescription
currencyCurrencyCurrency to get the delta for

Returns

NameTypeDescription
amountuint256The amount owed by this contract as a uint256

_getFullCredit

Obtain the full credit owed to this contract (positive delta)

function _getFullCredit(Currency currency) internal view returns (uint256 amount);

Parameters

NameTypeDescription
currencyCurrencyCurrency to get the delta for

Returns

NameTypeDescription
amountuint256The amount owed to this contract as a uint256

_mapSettleAmount

Calculates the amount for a settle action

function _mapSettleAmount(uint256 amount, Currency currency) internal view returns (uint256);

_mapTakeAmount

Calculates the amount for a take action

function _mapTakeAmount(uint256 amount, Currency currency) internal view returns (uint256);

Errors

DeltaNotPositive

Emitted trying to settle a positive delta.

error DeltaNotPositive(Currency currency);

DeltaNotNegative

Emitted trying to take a negative delta.

error DeltaNotNegative(Currency currency);
Helpful?