Skip to main content

Angstrom Inspector

Contract Address: 0xd262c224402E9A7F5e8ad1621be1Bb1f3203B6c3

Github: https://github.com/SorellaLabs/angstrom/blob/main/contracts/src/periphery/AngstromInspector.sol

The Angstrom Inspector is an helper contract built to facilitate introspection of Angstrom contract state.

It implements public view functions corresponding to the functions of the AngstromView Library, enabling users to query these library functions simply via RPC calls to the Inspector contract.

Developers building smart contracts on top of Angstrom are advised to instead use the library directly to improve gas efficiency.

Usage

/// @notice Returns the total pending rewards of the position defined by the `(account, key, tickLower, tickUpper, salt)` tuple.
/// @dev Sums the return values of `pendingRewards` and `uniswapPendingRewards`.
function totalPendingRewards(
address account,
PoolKey memory key,
int24 tickLower,
int24 tickUpper,
bytes32 salt
) external view returns (uint256, uint256);

/// @notice Returns the pending rewards held by the Angstrom hook for the position defined
/// by the `(account, key, tickLower, tickUpper, salt)` tuple.
/// @dev Rewards from Angstrom are always in the Currency0 of the pair.
function pendingRewards(
address account,
PoolKey memory key,
int24 tickLower,
int24 tickUpper,
bytes32 salt
) external view returns (uint256);

function uniswapPendingRewards(
address account,
PoolKey memory key,
int24 tickLower,
int24 tickUpper,
bytes32 salt
) external view returns (uint256, uint256);

The above functions are likely of the most interest to users. Although functions for querying lower-level state are also available, such as directly pulling the poolRewardsGlobalGrowth value, these functions provide easy methods to query the pending rewards of an Angstrom position.

Use the totalPendingRewards() function if you are interested in fetching the total pending rewards of a position in Angstrom, including rewards stored in Uniswap's PoolManager contract in addition to those stored in the Angstrom hook contract itself. For querying only the value of rewards stored in the Angstrom hook contract itself, use the pendingRewards() function instead.