diff --git a/src/contracts/vaults/AaveV3Vault.sol b/src/contracts/vaults/AaveV3Vault.sol new file mode 100644 index 0000000..a15c2f2 --- /dev/null +++ b/src/contracts/vaults/AaveV3Vault.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.26; + +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {AaveV3ERC4626, ERC20, IPool, IRewardsController} from "yield-daddy/aave-v3/AaveV3ERC4626.sol"; + +contract AaveV3Vault is AaveV3ERC4626, Ownable { + constructor( + ERC20 asset_, + ERC20 aToken_, + IPool lendingPool_, + address rewardRecipient_, + IRewardsController rewardsController_, + address newOwner + ) AaveV3ERC4626(asset_, aToken_, lendingPool_, rewardRecipient_, rewardsController_) Ownable(newOwner) {} + + function deposit(uint256 assets, address receiver) public override onlyOwner returns (uint256 shares) { + return super.deposit(assets, receiver); + } + + function mint(uint256 shares, address receiver) public override onlyOwner returns (uint256 assets) { + return super.mint(shares, receiver); + } + + function withdraw( + uint256 assets, + address receiver, + address owner_ + ) public override onlyOwner returns (uint256 shares) { + return super.withdraw(assets, receiver, owner_); + } + + function redeem(uint256 shares, address receiver, address owner_) public override onlyOwner returns (uint256 assets) { + return super.redeem(shares, receiver, owner_); + } +} diff --git a/test/integration/IntegrationBase.sol b/test/integration/IntegrationBase.sol index 9355a41..c863583 100644 --- a/test/integration/IntegrationBase.sol +++ b/test/integration/IntegrationBase.sol @@ -6,9 +6,10 @@ import {Test} from "forge-std/Test.sol"; import {IERC20} from "forge-std/interfaces/IERC20.sol"; +import {AaveV3Vault} from "contracts/vaults/AaveV3Vault.sol"; import {ERC4626} from "solmate/mixins/ERC4626.sol"; import {ERC20} from "solmate/tokens/ERC20.sol"; -import {AaveV3ERC4626, IPool, IRewardsController} from "yield-daddy/aave-v3/AaveV3ERC4626.sol"; +import {IPool, IRewardsController} from "yield-daddy/aave-v3/AaveV3ERC4626.sol"; contract IntegrationBase is Test { uint256 internal constant _FORK_BLOCK = 18_920_905; @@ -24,19 +25,24 @@ contract IntegrationBase is Test { address _rewardsController = 0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb; IPool internal _aavePool = IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2); IGrateful internal _grateful; - AaveV3ERC4626 internal _vault; + AaveV3Vault internal _vault; uint256 internal _amount = 1e25; function setUp() public { vm.startPrank(_owner); vm.createSelectFork(vm.rpcUrl("mainnet"), _FORK_BLOCK); - _vault = new AaveV3ERC4626( - ERC20(address(_dai)), ERC20(_aDai), _aavePool, address(0), IRewardsController(_rewardsController) - ); vm.label(address(_vault), "Vault"); _tokens = new address[](1); _tokens[0] = address(_dai); _grateful = new Grateful(_tokens, _aavePool); + _vault = new AaveV3Vault( + ERC20(address(_dai)), + ERC20(_aDai), + _aavePool, + address(0), + IRewardsController(_rewardsController), + address(_grateful) + ); vm.label(address(_grateful), "Grateful"); _grateful.addVault(address(_dai), address(_vault)); vm.stopPrank();