-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3ff49e
commit 9969804
Showing
9 changed files
with
158 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
zkout/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
import {ITransparentUpgradeableProxy, ProxyAdmin} from "solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol"; | ||
|
||
import { | ||
ITransparentUpgradeableProxy, | ||
ProxyAdmin | ||
} from "solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol"; | ||
import {IAccessControl} from "aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol"; | ||
import {ICollector} from "aave-v3-origin/contracts/treasury/ICollector.sol"; | ||
|
||
contract UpgradePayload { | ||
address public immutable PROXY_ADMIN; | ||
address public immutable COLLECTOR; | ||
address public immutable COLLECTOR_IMPL; | ||
address public immutable PROXY_ADMIN; | ||
address public immutable COLLECTOR; | ||
address public immutable COLLECTOR_IMPL; | ||
|
||
constructor(address collector, address collectorImpl, address proxyAdmin) { | ||
COLLECTOR = collector; | ||
COLLECTOR_IMPL = collectorImpl; | ||
PROXY_ADMIN = proxyAdmin; | ||
} | ||
constructor(address collector, address collectorImpl, address proxyAdmin) { | ||
COLLECTOR = collector; | ||
COLLECTOR_IMPL = collectorImpl; | ||
PROXY_ADMIN = proxyAdmin; | ||
} | ||
|
||
function execute() external { | ||
// upgrade collector implementation with custom initialize to align storage | ||
ProxyAdmin(PROXY_ADMIN).upgradeAndCall( | ||
ITransparentUpgradeableProxy(COLLECTOR), | ||
COLLECTOR_IMPL, | ||
abi.encodeWithSelector(ICollector.initialize.selector, 0) | ||
); | ||
// grant funds admin permissions to the executor | ||
IAccessControl(ICollector(COLLECTOR).ACL_MANAGER()).grantRole( | ||
ICollector(COLLECTOR).FUNDS_ADMIN_ROLE(), | ||
address(this) | ||
); | ||
} | ||
function execute() external { | ||
// upgrade collector implementation with custom initialize to align storage | ||
ProxyAdmin(PROXY_ADMIN).upgradeAndCall( | ||
ITransparentUpgradeableProxy(COLLECTOR), COLLECTOR_IMPL, abi.encodeWithSelector(ICollector.initialize.selector, 0) | ||
); | ||
// grant funds admin permissions to the executor | ||
IAccessControl(ICollector(COLLECTOR).ACL_MANAGER()).grantRole( | ||
ICollector(COLLECTOR).FUNDS_ADMIN_ROLE(), address(this) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.