Skip to content

Commit c488d74

Browse files
authored
Merge pull request #1 from citizenwallet/refactor
Refactor
2 parents e276852 + e692371 commit c488d74

34 files changed

+926
-645
lines changed

src/lockers/AaveLocker.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ contract AaveV3Locker is AbstractLocker {
4141
AAVE_POOL.supply(asset, amount, address(this), 0);
4242
}
4343

44-
function withdraw(address asset, uint256 amount) external override onlyOwner {
44+
function withdraw(address asset, uint256 amount) external override onlyOwner returns (uint256 withdrawn) {
4545
// Decrease amount deposited.
4646
totalDeposited -= amount;
4747

4848
// Withdraw asset from pool to the owner.
49-
AAVE_POOL.withdraw(asset, amount, msg.sender);
49+
withdrawn = AAVE_POOL.withdraw(asset, amount, msg.sender);
5050
}
5151

5252
function collectYield(address asset) external override onlyOwner returns (uint256 yield) {

src/lockers/AbstractLocker.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract contract AbstractLocker is ILocker, Ownable {
4242

4343
function deposit(address asset, uint256 amount) external virtual onlyOwner {}
4444

45-
function withdraw(address asset, uint256 amount) external virtual onlyOwner {}
45+
function withdraw(address asset, uint256 amount) external virtual onlyOwner returns (uint256 withdrawn) {}
4646

4747
function fullWithdraw(address asset) external virtual onlyOwner returns (uint256 principal, uint256 yield) {}
4848

src/lockers/interfaces/ILocker.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.22;
44
interface ILocker {
55
function totalDeposited() external returns (uint256);
66
function deposit(address asset, uint256 amount) external;
7-
function withdraw(address asset, uint256 amount) external;
7+
function withdraw(address asset, uint256 amount) external returns (uint256);
88
function fullWithdraw(address asset) external returns (uint256, uint256);
99
function collectYield(address asset) external returns (uint256);
1010
function getTotalValue(address asset) external returns (uint256);

0 commit comments

Comments
 (0)