Skip to content
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
75e9f55
feat: Simple contract to mint fee shares
CheyenneAtapour Feb 17, 2026
9ec1d11
chore: Cleanup
CheyenneAtapour Feb 17, 2026
4dc1448
feat: Make contract usable with all hubs
CheyenneAtapour Feb 17, 2026
0f6dab4
fix: Pr comments
CheyenneAtapour Feb 17, 2026
4f0492e
fix: test comment
CheyenneAtapour Feb 17, 2026
d9bfd8d
fix: Address pr comments
CheyenneAtapour Feb 25, 2026
cf0e864
Merge remote-tracking branch 'origin/main' into feat/fee-minter
CheyenneAtapour Feb 25, 2026
ba91946
fix: address pr comments
CheyenneAtapour Feb 26, 2026
729a05f
feat: Integrate with chainlink automation
CheyenneAtapour Feb 26, 2026
89d75b4
fix: test suite
CheyenneAtapour Feb 27, 2026
521c61c
chore: cleanup
CheyenneAtapour Feb 27, 2026
3a54457
fix: Cleanup natspec
CheyenneAtapour Feb 28, 2026
05bcd6c
fix: typo
CheyenneAtapour Mar 4, 2026
aba7d8c
Merge remote-tracking branch 'origin/main' into feat/fee-minter
CheyenneAtapour Mar 10, 2026
55f3330
Merge remote-tracking branch 'origin/main' into feat/fee-minter
CheyenneAtapour Mar 12, 2026
60d2395
Merge remote-tracking branch 'origin/main' into feat/fee-minter
CheyenneAtapour Mar 25, 2026
01fc11f
merge in main
CheyenneAtapour Mar 28, 2026
d6c0ac0
fix: Address pr comments
CheyenneAtapour Mar 28, 2026
9a0ce16
fix: Address pr comments
CheyenneAtapour Mar 28, 2026
36d151c
fix: Some pr comments
CheyenneAtapour Apr 9, 2026
976361e
Merge remote-tracking branch 'origin/main' into feat/fee-minter
CheyenneAtapour Apr 9, 2026
e0244e0
merge in main
CheyenneAtapour Apr 9, 2026
6e155aa
fix: Remaining pr comments
CheyenneAtapour Apr 9, 2026
39c7c5a
feat: Remove time component from fee minter
CheyenneAtapour Apr 9, 2026
56fbaf0
fix: Remove extraneous functions
CheyenneAtapour Apr 9, 2026
7bb20ec
fix : address pr comments & cleanup
Kogaroshi Apr 15, 2026
55f1f82
fix : renaming
Kogaroshi Apr 15, 2026
c0c322d
feat : add FeeSharesMinter to deploy engine
Kogaroshi Apr 15, 2026
8bb19cc
fix: address fee minter comments (#1299)
yan-man Apr 16, 2026
98c4cc4
fix: address comments
avniculae May 21, 2026
c85cb6f
feat: migrate FeeSharesMinter to CRE
avniculae May 22, 2026
9010c1f
feat: add FeeSharesMinter support in config engine
avniculae May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/deploy/AaveV4DeployBatchBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ abstract contract AaveV4DeployBatchBaseScript is Script {
_logWarning(string.concat('treasury spoke owner', message, outcome));
sanitizedInputs.treasurySpokeOwner = deployer;
}
if (inputs.feeSharesMinterOwner == address(0)) {
_logWarning(string.concat('fee shares minter owner', message, outcome));
sanitizedInputs.feeSharesMinterOwner = deployer;
}
if (inputs.spokeAdmin == address(0)) {
_logWarning(string.concat('spoke admin', message, outcome));
sanitizedInputs.spokeAdmin = deployer;
Expand All @@ -133,6 +137,9 @@ abstract contract AaveV4DeployBatchBaseScript is Script {
_logWarning(string.concat('treasury spoke owner', message, outcome));
sanitizedInputs.treasurySpokeOwner = deployer;

_logWarning(string.concat('fee shares minter owner', message, outcome));
sanitizedInputs.feeSharesMinterOwner = deployer;

_logWarning(string.concat('proxy admin owner', message, outcome));
sanitizedInputs.proxyAdminOwner = deployer;
}
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy/examples/AaveV4DeployAnvil.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ contract AaveV4DeployAnvil is AaveV4DeployBatchBaseScript {
hubAdmin: address(0),
hubConfiguratorAdmin: address(0),
treasurySpokeOwner: address(0),
feeSharesMinterOwner: address(0),
spokeAdmin: address(0),
spokeConfiguratorAdmin: address(1),
gatewayOwner: address(2),
Expand Down
47 changes: 47 additions & 0 deletions src/dependencies/chainlink/AutomationCompatibleInterface.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT
// Imported from https://github.com/smartcontractkit/chainlink/blob/v2.22.0/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol
pragma solidity ^0.8.0;

// solhint-disable-next-line interface-starts-with-i
interface AutomationCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
Comment thread
CheyenneAtapour marked this conversation as resolved.
Outdated
Comment thread
CheyenneAtapour marked this conversation as resolved.
Outdated
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
) external returns (bool upkeepNeeded, bytes memory performData);

/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
11 changes: 9 additions & 2 deletions src/deployments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This deploys `LiquidationLogic` via CREATE2 and writes `FOUNDRY_LIBRARIES` to `.
make deploy-contracts
```

This runs `AaveV4DeployOrchestration.deployAaveV4()`, which deploys batches in order: AccessManager → role labeling → Configurators → Configurator role setup → TreasurySpoke → Hubs → Spokes → Gateways → PositionManagers → role grants → DEFAULT_ADMIN transfer.
This runs `AaveV4DeployOrchestration.deployAaveV4()`, which deploys batches in order: AccessManager → role labeling → Configurators → Configurator role setup → TreasurySpoke → FeeSharesMinter → Hubs → Spokes → Gateways → PositionManagers → role grants → DEFAULT_ADMIN transfer.

### TokenizationSpoke

Expand Down Expand Up @@ -66,6 +66,7 @@ src/deployments/
AaveV4AuthorityBatch AccessManagerEnumerable
AaveV4ConfiguratorBatch HubConfigurator, SpokeConfigurator
AaveV4TreasurySpokeBatch TreasurySpoke (single instance, proxy + impl)
AaveV4FeeSharesMinterBatch FeeSharesMinter (single instance for all hubs)
AaveV4HubInstanceBatch HubInstance (proxy + impl), InterestRateStrategy
AaveV4SpokeInstanceBatch SpokeInstance (proxy + impl), AaveOracle
AaveV4GatewayBatch NativeTokenGateway, SignatureGateway
Expand Down Expand Up @@ -130,7 +131,7 @@ See `Roles.sol` NatSpec for the full role strategy and evolution guidelines. All
| --- | --------------------------- | ---------------------------------- | ----------------------------------------------------------------------------- |
| 100 | HUB_DOMAIN_ADMIN_ROLE | hubAdmin | (reserved for future use) |
| 101 | HUB_CONFIGURATOR_ROLE | hubAdmin, HubConfigurator contract | addAsset, updateAssetConfig, addSpoke, updateSpokeConfig, setInterestRateData |
| 102 | HUB_FEE_MINTER_ROLE | hubAdmin | mintFeeShares |
| 102 | HUB_FEE_MINTER_ROLE | hubAdmin, FeeSharesMinter contract | mintFeeShares |
| 103 | HUB_DEFICIT_ELIMINATOR_ROLE | hubAdmin | eliminateDeficit |

#### `HubConfigurator` Roles
Expand Down Expand Up @@ -201,6 +202,11 @@ AaveV4DeployBatchBase.s.sol (Foundry script entry point)
| | new AaveV4TreasurySpokeBatch(owner, salt)
| | Create2Utils.create2Deploy() --> TreasurySpoke
| |
| +-- _deployFeeSharesMinterBatch()
| | AaveV4DeployBase.deployFeeSharesMinterBatch()
| | new AaveV4FeeSharesMinterBatch(owner, salt)
| | Create2Utils.create2Deploy() --> FeeSharesMinter
| |
| +-- InputUtils.validateUniqueLabels() revert on duplicate hub or spoke labels
| |
| +-- _deployHubs(hubLabels) for each hub label:
Expand Down Expand Up @@ -241,6 +247,7 @@ AaveV4DeployBatchBase.s.sol (Foundry script entry point)
| | _grantHubRoles() (if hubLabels.length > 0)
| | AaveV4HubRolesProcedure.grantHubAllRoles() hubAdmin gets roles 101-103
| | AaveV4HubRolesProcedure.grantHubRole() HubConfigurator gets role 101
| | AaveV4HubRolesProcedure.grantHubRole() FeeSharesMinter gets role 102
| | AaveV4HubConfiguratorRolesProcedure.grantHubConfiguratorAllRoles()
| | hubConfiguratorAdmin gets role 200
| | _grantSpokeRoles() (if spokeLabels.length > 0)
Expand Down
25 changes: 25 additions & 0 deletions src/deployments/batches/AaveV4FeeSharesMinterBatch.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;

import {BatchReports} from 'src/deployments/libraries/BatchReports.sol';
import {AaveV4FeeSharesMinterDeployProcedure} from 'src/deployments/procedures/deploy/utils/AaveV4FeeSharesMinterDeployProcedure.sol';

/// @title AaveV4FeeSharesMinterBatch
/// @author Aave Labs
/// @notice Deploys the FeeSharesMinter contract, producing a batch report.
contract AaveV4FeeSharesMinterBatch is AaveV4FeeSharesMinterDeployProcedure {
BatchReports.FeeSharesMinterBatchReport internal _report;

/// @dev Constructor.
/// @param owner_ The owner of the FeeSharesMinter.
/// @param salt_ The CREATE2 salt for deterministic deployment.
constructor(address owner_, bytes32 salt_) {
address feeSharesMinter = _deployFeeSharesMinter({owner: owner_, salt: salt_});
_report = BatchReports.FeeSharesMinterBatchReport({feeSharesMinter: feeSharesMinter});
}

/// @notice Returns the batch deployment report.
function getReport() external view returns (BatchReports.FeeSharesMinterBatchReport memory) {
return _report;
}
}
5 changes: 5 additions & 0 deletions src/deployments/libraries/BatchReports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ library BatchReports {
address treasurySpoke;
}

/// @dev feeSharesMinter The deployed FeeSharesMinter contract address.
struct FeeSharesMinterBatchReport {
address feeSharesMinter;
}

/// @dev signatureGateway The deployed SignatureGateway contract address.
/// @dev nativeGateway The deployed NativeTokenGateway contract address.
struct GatewaysBatchReport {
Expand Down
2 changes: 2 additions & 0 deletions src/deployments/libraries/OrchestrationReports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ library OrchestrationReports {
/// @dev authorityBatchReport AccessManager deployment report.
/// @dev configuratorBatchReport Configurator deployment report.
/// @dev treasurySpokeBatchReport TreasurySpoke deployment report.
/// @dev feeSharesMinterBatchReport FeeSharesMinter deployment report.
/// @dev spokeInstanceBatchReports Per-spoke deployment reports.
/// @dev hubInstanceBatchReports Per-hub deployment reports.
/// @dev gatewaysBatchReport Gateway deployment report.
Expand All @@ -33,6 +34,7 @@ library OrchestrationReports {
BatchReports.AuthorityBatchReport authorityBatchReport;
BatchReports.ConfiguratorBatchReport configuratorBatchReport;
BatchReports.TreasurySpokeBatchReport treasurySpokeBatchReport;
BatchReports.FeeSharesMinterBatchReport feeSharesMinterBatchReport;
SpokeDeploymentReport[] spokeInstanceBatchReports;
HubDeploymentReport[] hubInstanceBatchReports;
BatchReports.GatewaysBatchReport gatewaysBatchReport;
Expand Down
16 changes: 16 additions & 0 deletions src/deployments/orchestration/AaveV4DeployBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {AaveV4PositionManagerBatch} from 'src/deployments/batches/AaveV4Position
import {AaveV4SpokeInstanceBatch} from 'src/deployments/batches/AaveV4SpokeInstanceBatch.sol';
import {AaveV4TokenizationSpokeBatch} from 'src/deployments/batches/AaveV4TokenizationSpokeBatch.sol';
import {AaveV4TreasurySpokeBatch} from 'src/deployments/batches/AaveV4TreasurySpokeBatch.sol';
import {AaveV4FeeSharesMinterBatch} from 'src/deployments/batches/AaveV4FeeSharesMinterBatch.sol';

/// @title AaveV4DeployBase Library
/// @author Aave Labs
Expand Down Expand Up @@ -61,6 +62,21 @@ library AaveV4DeployBase {
return treasurySpokeBatch.getReport();
}

/// @notice Deploys the FeeSharesMinter batch containing the FeeSharesMinter contract.
/// @param owner The owner of the FeeSharesMinter.
/// @param salt The CREATE2 salt for deterministic deployment.
/// @return The FeeSharesMinter batch report.
function deployFeeSharesMinterBatch(
address owner,
bytes32 salt
) internal returns (BatchReports.FeeSharesMinterBatchReport memory) {
AaveV4FeeSharesMinterBatch feeSharesMinterBatch = new AaveV4FeeSharesMinterBatch({
owner_: owner,
salt_: salt
});
return feeSharesMinterBatch.getReport();
}

/// @notice Deploys the Hub instance batch containing the Hub proxy, implementation, and IR strategy.
/// @param proxyAdminOwner The owner of the proxy admin.
/// @param authority The access-control authority for the Hub.
Expand Down
29 changes: 29 additions & 0 deletions src/deployments/orchestration/AaveV4DeployOrchestration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ library AaveV4DeployOrchestration {
salt: salt
});

// Deploy FeeSharesMinter Batch (single instance for all hubs)
report.feeSharesMinterBatchReport = _deployFeeSharesMinterBatch({
logger: logger,
feeSharesMinterOwner: deployInputs.feeSharesMinterOwner,
salt: salt
});

// Validate label uniqueness (duplicate labels produce identical CREATE2 salts)
InputUtils.validateUniqueLabels(deployInputs.hubLabels, 'hub');
InputUtils.validateUniqueLabels(deployInputs.spokeLabels, 'spoke');
Expand Down Expand Up @@ -340,6 +347,18 @@ library AaveV4DeployOrchestration {
return report;
}

function _deployFeeSharesMinterBatch(
Logger logger,
address feeSharesMinterOwner,
bytes32 salt
) internal returns (BatchReports.FeeSharesMinterBatchReport memory report) {
logger.logHeader1('deploying FeeSharesMinterBatch');
report = AaveV4DeployBase.deployFeeSharesMinterBatch({owner: feeSharesMinterOwner, salt: salt});
logger.log('FeeSharesMinter', report.feeSharesMinter);
logger.logNewLine();
return report;
}

function _deployGatewayBatch(
Logger logger,
address gatewayOwner,
Expand Down Expand Up @@ -438,6 +457,16 @@ library AaveV4DeployOrchestration {
admin: report.configuratorBatchReport.hubConfigurator
});

logger.logHeader1(
'granting HUB_FEE_MINTER_ROLE to',
report.feeSharesMinterBatchReport.feeSharesMinter
);
AaveV4HubRolesProcedure.grantHubRole({
accessManager: accessManager,
role: Roles.HUB_FEE_MINTER_ROLE,
admin: report.feeSharesMinterBatchReport.feeSharesMinter
});

logger.logHeader1('granting HubConfigurator Admin roles to', hubConfiguratorAdmin);
AaveV4HubConfiguratorRolesProcedure.grantHubConfiguratorAllRoles({
accessManager: accessManager,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;

import {AaveV4DeployProcedureBase} from 'src/deployments/procedures/AaveV4DeployProcedureBase.sol';
import {Create2Utils} from 'src/deployments/utils/libraries/Create2Utils.sol';
import {FeeSharesMinter} from 'src/utils/FeeSharesMinter.sol';

/// @title AaveV4FeeSharesMinterDeployProcedure
/// @author Aave Labs
/// @notice Deploys the FeeSharesMinter contract.
contract AaveV4FeeSharesMinterDeployProcedure is AaveV4DeployProcedureBase {
/// @notice Deploys a new FeeSharesMinter instance via CREATE2.
/// @param owner The owner of the FeeSharesMinter.
/// @param salt The CREATE2 salt for deterministic deployment.
/// @return The address of the deployed FeeSharesMinter contract.
function _deployFeeSharesMinter(address owner, bytes32 salt) internal returns (address) {
require(owner != address(0), 'invalid owner');
return
Create2Utils.create2Deploy({
salt: salt,
bytecode: abi.encodePacked(type(FeeSharesMinter).creationCode, abi.encode(owner))
});
}
}
1 change: 1 addition & 0 deletions src/deployments/utils/MetadataLogger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ contract MetadataLogger is Logger {
_write('hubConfigurator', report.configuratorBatchReport.hubConfigurator);
_write('spokeConfigurator', report.configuratorBatchReport.spokeConfigurator);
_write('treasurySpoke', report.treasurySpokeBatchReport.treasurySpoke);
_write('feeSharesMinter', report.feeSharesMinterBatchReport.feeSharesMinter);

// Group hubs by property type
uint256 hubLen = report.hubInstanceBatchReports.length;
Expand Down
3 changes: 3 additions & 0 deletions src/deployments/utils/libraries/InputUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ library InputUtils {
/// @dev hubConfiguratorAdmin The admin granted all hub configurator roles. Only used when grantRoles is true.
/// @dev treasurySpokeOwner The owner of the TreasurySpoke (Ownable). Required at deploy time (constructor arg).
/// When grantRoles is `false`, defaults to the deployer; ownership can be transferred post-deployment.
/// @dev feeSharesMinterOwner The owner of the FeeSharesMinter (Ownable). Required at deploy time (constructor arg).
/// When grantRoles is `false`, defaults to the deployer; ownership can be transferred post-deployment.
/// @dev spokeAdmin The spoke admin. Only used when grantRoles is true.
/// @dev spokeConfiguratorAdmin The admin granted all spoke configurator roles. Only used when grantRoles is true.
/// @dev gatewayOwner The owner of the native token and signature gateways.
Expand All @@ -34,6 +36,7 @@ library InputUtils {
address hubAdmin;
address hubConfiguratorAdmin;
address treasurySpokeOwner;
address feeSharesMinterOwner;
address spokeAdmin;
address spokeConfiguratorAdmin;
address gatewayOwner;
Expand Down
Loading
Loading