ethereum-optimism / ethereum-optimism/optimism
Update `FeeVault` to return amount withdrawn after `withdraw()` call
- Dominant language
- Go
- Stars
- 6.5k
- Forks
- 4k
- Avg merge
- 2d 38m
- Merged PRs (30d)
- 164
Description
To implement a fee splitter contract based on the `FeeVault` there is a lot of complexity and assumptions required because the amount being withdrawn is not returned from the `withdraw()` function. It would be a minimal diff to return this value, allowing for smart contracts to easily consume it and not need to make extra calls to get the balance of the account. An example of the complexity can be found [here](https://github.com/base-org/contracts/blob/6df77b49e16c2da29d1530b624eb6df4ff00cb2e/src/revenue-share/FeeDisburser.sol)
See the implementation below:
https://github.com/ethereum-optimism/optimism/blob/c19d51bff3285792286a35e7ed10a932e390bcc3/packages/contracts-bedrock/src/universal/FeeVault.sol#L92-L114
The main risk in doing so would be around breaking existing contracts that call the `FeeVault` contracts. I do not think it would break the existing contracts as it is possible to not assign return values to variables in solidity
Contributor guide
Assessment
This issue has not been assessed yet.