Skip to content

Conversation

@avniculae
Copy link
Contributor

@github-actions
Copy link

Certora Run Started (Verified Rules)

  • Group ID: ad4a66c9-721b-4c6c-92aa-0682f4735f07
Config Status Link Log File
Hub.conf Failed (1) - certora/conf/Hub.conf-2fff6622261d.log
HubAccrueIntegrity.conf Failed (1) - certora/conf/HubAccrueIntegrity.conf-523d5aee82c0.log
HubAccrueUnrealizedFee.conf Failed (1) - certora/conf/HubAccrueUnrealizedFee.conf-de2303cbcded.log
HubAdditivity.conf Failed (1) - certora/conf/HubAdditivity.conf-809ed0c349a3.log
HubIntegrity.conf Failed (1) - certora/conf/HubIntegrity.conf-a2889b4b74a0.log
HubValidState.conf Failed (1) - certora/conf/HubValidState.conf-a3d6be81d65c.log
libs/LibBit.conf Compiled - certora/conf/libs/LibBit.conf-c07ae6bdb165.log
libs/Math.conf Compiled - certora/conf/libs/Math.conf-b303355fcae3.log
libs/SharesMath.conf Failed (1) - certora/conf/libs/SharesMath.conf-4cf3ac1a7b08.log

Certora Run Summary

  • Started 0 jobs
  • 7 jobs failed

Download Logs


/// @notice Accrues interest and fees for the specified asset.
function accrue(IHub.Asset storage asset) internal {
if (asset.lastUpdateTimestamp == block.timestamp) {
Copy link
Contributor Author

@avniculae avniculae Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment -- this cannot be removed now

using TransientSlot for *;

/// bytes32(uint256(keccak256("FEE_AMOUNT")) - 1)
TransientSlot.Uint256Slot internal constant FEE_AMOUNT_SLOT =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pack fee amount and fee shares in the same slot

// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025 Aave Labs
pragma solidity ^0.8.20;
pragma solidity ^0.8.28;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this (this was done to make certora rule compile)

uint256 unrealized = spoke == asset.feeReceiver ? asset.unrealizedFeeShares() : 0;
return asset.toAddedAssetsDown(_spokes[assetId][spoke].addedShares + unrealized);
uint256 feeShares = spoke == asset.feeReceiver
? asset.getUnrealizedFeeShares(asset.getUnrealizedFeeAmount(asset.getDrawnIndex()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is queried after accrue but before fee shares are minted (in the same block), this will be wrong. however, I don't think this scenario exists (need to double check). If such scenario does not exist, should we fix it (by looking at the transient storage as well) just to be safer, or leave as is?

asset.liquidity += amount.toUint128();

asset.updateDrawnRate(assetId);
asset.mintFeeShares(_spokes, assetId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to ensure we always mint fee shares at the end of actions that accrue? current impl is a bit error-prone

}

/// @notice Accrues interest and fees for the specified asset.
function accrue(IHub.Asset storage asset) internal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make sure to clearly document this and the need to couple this with the mintFeeShares

@avniculae avniculae changed the title [WIP] fix: Mint fee shares at the end of actions [WIP]: fix: Liquidity growth calculation in fees logic & fee cache in transient storage Oct 17, 2025
@avniculae
Copy link
Contributor Author

This was addressed in #933

@avniculae avniculae closed this Oct 28, 2025
@avniculae avniculae deleted the fix/share-price-bundle branch October 28, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants