docs icon indicating copy to clipboard operation
docs copied to clipboard

Wrong function names referencing `TransientStateLibrary` in flash accounting guide

Open chibitanaka opened this issue 5 months ago • 0 comments

https://github.com/Uniswap/docs/blob/main/docs/contracts/v4/guides/13-flash-accounting.mdx#reading-deltastates

From example:

using TransientStateLibrary for IPoolManager;

function checkDeltaBeforeOperation(
    Currency currency,
    address user
) external view returns (int256) {
    // Important: This shows the current delta for this token/user pair
    return poolManager.getCurrentDelta(currency, user);
    // Negative: User owes tokens
    // Positive: User can claim tokens
    // Zero: No outstanding obligations
}

However, TransientStateLibrary has no such function as getCurrentDelta, https://github.com/Uniswap/v4-core/blob/main/src/libraries/TransientStateLibrary.sol#L35

and currencyDelta should be used instead

Related PR: #848

chibitanaka avatar May 29 '25 02:05 chibitanaka