Skip to main content
Helpful?

CurrencyDelta

Git Source | Generated with forge doc

this library implements the equivalent of a mapping, as transient storage can only be accessed in assembly

Functions

_computeSlot

calculates which storage slot a delta should be stored in for a given account and currency

function _computeSlot(address target, Currency currency) internal pure returns (bytes32 hashSlot);

getDelta

function getDelta(Currency currency, address target) internal view returns (int256 delta);

applyDelta

applies a new currency delta for a given account and currency

function applyDelta(Currency currency, address target, int128 delta) internal returns (int256 previous, int256 next);

Returns

NameTypeDescription
previousint256The prior value
nextint256The modified result
Helpful?