Skip to content

Commit 448f864

Browse files
authored
Merge pull request aave#100 from aave/feat/99-controller-multi-collector
feat: Add ability to specify collector
2 parents b0c30d2 + e946268 commit 448f864

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
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
}

package-lock.json

Lines changed: 21 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aave/periphery-v3",
3-
"version": "1.19.2",
3+
"version": "1.19.2-beta.0",
44
"description": "Aave Protocol V3 periphery smart contracts",
55
"files": [
66
"contracts",
@@ -32,7 +32,7 @@
3232
},
3333
"license": "AGPLv3",
3434
"devDependencies": {
35-
"@aave/deploy-v3": "1.27.0",
35+
"@aave/deploy-v3": "1.27.0-beta.1",
3636
"@ethersproject/abi": "^5.1.0",
3737
"@nomicfoundation/hardhat-chai-matchers": "^1.0.2",
3838
"@nomiclabs/hardhat-ethers": "^2.1.0",
@@ -89,6 +89,6 @@
8989
"url": "git://github.com/aave/aave-v3-periphery"
9090
},
9191
"dependencies": {
92-
"@aave/core-v3": "^1.14.3-beta.0"
92+
"@aave/core-v3": "1.16.2"
9393
}
9494
}

0 commit comments

Comments
 (0)