-
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.
fix: typo
- Loading branch information
Showing
2 changed files
with
15 additions
and
61 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,66 +1,21 @@ | ||
## Foundry | ||
## Collector unification | ||
|
||
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** | ||
The aave treasury is an upgradable contract that was first released in Aave V1. | ||
Over time the contract has been upgraded 4 times, while at the same time collectors on other networks have been deployed. | ||
This has resulted in a situation where the storage layouts of the different collectors are slightly different. | ||
While this does not cause any issue, it makes upgrades cumbersome and complicated. | ||
|
||
Foundry consists of: | ||
Karpatkey together with tokenlogic [have proposed](https://github.com/aave-dao/aave-v3-origin/pull/82) introducing some new functionality on the collector, | ||
to provide some new functionality required for the proposed [FinancialStewards](https://governance.aave.com/t/arfc-aave-finance-steward/17570). | ||
|
||
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). | ||
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. | ||
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. | ||
- **Chisel**: Fast, utilitarian, and verbose solidity REPL. | ||
While the originally proposed code was fine, it would have required custom upgrade code for different networks making future updates even more complicated. | ||
To resolve this issue once and for all, BGD Labs proposed a [small update](https://github.com/aave-dao/aave-v3-origin/pull/94) to the proposed code. | ||
Instead of trying to account for different implementations, the Collector inheritance chain was fundamentally upgraded to rely on [`ERC-2701`](https://eips.ethereum.org/EIPS/eip-7201) based storage layout for initialization, access-control and reentrancy protection. | ||
With these changes the inheritance chain no longer pollutes sequential storage slots, so the only thing left to do is aligning the contract specific storage slots (`_nextStreamId` and `_streams`). | ||
|
||
## Documentation | ||
After the upgrade all storage layouts will be 100% aligned and future upgrades can be applied simultaneous on every chain. | ||
|
||
https://book.getfoundry.sh/ | ||
Specification: | ||
|
||
## Usage | ||
|
||
### Build | ||
|
||
```shell | ||
$ forge build | ||
``` | ||
|
||
### Test | ||
|
||
```shell | ||
$ forge test | ||
``` | ||
|
||
### Format | ||
|
||
```shell | ||
$ forge fmt | ||
``` | ||
|
||
### Gas Snapshots | ||
|
||
```shell | ||
$ forge snapshot | ||
``` | ||
|
||
### Anvil | ||
|
||
```shell | ||
$ anvil | ||
``` | ||
|
||
### Deploy | ||
|
||
```shell | ||
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
``` | ||
|
||
### Cast | ||
|
||
```shell | ||
$ cast <subcommand> | ||
``` | ||
|
||
### Help | ||
|
||
```shell | ||
$ forge --help | ||
$ anvil --help | ||
$ cast --help | ||
``` | ||
- the UpgradePayload upgrades the collector implementation & grants the funds_admin role to the executor | ||
- the Collector implementation implements a custom initialize which uses assembly to 1) clear previously used storage slots and 2) move the value of some other storage slots into their new position |
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