Skip to content

Commit 79c2377

Browse files
committed
feat: Add ability to specify collector
1 parent 13d0634 commit 79c2377

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

contracts/treasury/CollectorController.sol

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,49 @@ import {ICollector} from './interfaces/ICollector.sol';
88
/**
99
* @title CollectorController
1010
* @notice The CollectorController contracts allows the owner of the contract
11-
to approve or transfer tokens from the collector proxy contract.
11+
to approve or transfer tokens from the specified collector proxy contract.
1212
The admin of the Collector proxy can't be the same as the fundsAdmin address.
1313
This is needed due the usage of transparent proxy pattern.
1414
* @author Aave
1515
**/
1616
contract CollectorController is Ownable {
17-
ICollector public immutable COLLECTOR;
18-
1917
/**
20-
* @dev Constructor setups the ownership of the contract and the collector proxy
18+
* @dev Constructor setups the ownership of the contract
2119
* @param owner The address of the owner of the CollectorController
22-
* @param collectorProxy The address of the Collector transparent proxy
2320
*/
24-
constructor(address owner, address collectorProxy) {
21+
constructor(address owner) {
2522
transferOwnership(owner);
26-
COLLECTOR = ICollector(collectorProxy);
2723
}
2824

2925
/**
3026
* @dev Transfer an amount of tokens to the recipient.
27+
* @param collector The address of the collector contract
3128
* @param token The address of the asset
3229
* @param recipient The address of the entity to transfer the tokens.
3330
* @param amount The amount to be transferred.
3431
*/
3532
function approve(
33+
address collector,
3634
IERC20 token,
3735
address recipient,
3836
uint256 amount
3937
) external onlyOwner {
40-
COLLECTOR.approve(token, recipient, amount);
38+
ICollector(collector).approve(token, recipient, amount);
4139
}
4240

4341
/**
4442
* @dev Transfer an amount of tokens to the recipient.
43+
* @param collector The address of the collector contract to retrieve funds from (e.g. Aave ecosystem reserve)
4544
* @param token The address of the asset
4645
* @param recipient The address of the entity to transfer the tokens.
4746
* @param amount The amount to be transferred.
4847
*/
4948
function transfer(
49+
address collector,
5050
IERC20 token,
5151
address recipient,
5252
uint256 amount
5353
) external onlyOwner {
54-
COLLECTOR.transfer(token, recipient, amount);
54+
ICollector(collector).transfer(token, recipient, amount);
5555
}
5656
}

0 commit comments

Comments
 (0)