Skip to content

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
fix: typo
  • Loading branch information
sakulstra committed Jan 6, 2025
1 parent 93493dd commit 9df4c02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 61 deletions.
75 changes: 15 additions & 60 deletions README.md
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
1 change: 0 additions & 1 deletion src/CollectorWithCustomImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ contract CollectorWithCustomImpl is Collector {
assembly {
sstore(0, 0) // this slot was revision, which is no longer used
sstore(51, 0) // this slot was _status, but is now part of the gap
sstore(52, 1) // this slot was the funds admin, but is now _status
}
__AccessControl_init();
__ReentrancyGuard_init();
Expand Down

0 comments on commit 9df4c02

Please sign in to comment.