This change adds FixinProtocolFees, code that collects protocol fees using per-pool FeeCollector contracts. Once per epoch, a function on each FeeCollector is called to transfer the held ether (first converted to WETH) to the staking contract. Delaying this transfer and associated accounting yields significant gas savings.
Testing instructions
yarn build && yarn test in contracts/zero-ex.
The basic happy path with WETH is tested, but all other tests are missing. Future commits will add more robust testing, including negative testing for failure modes.
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
[x] Prefix PR title with [WIP] if necessary.
[ ] Add tests to cover changes as needed.
[ ] Update documentation as needed.
[ ] Add new entries to the relevant CHANGELOG.jsons.
Description
This change adds
FixinProtocolFees
, code that collects protocol fees using per-poolFeeCollector
contracts. Once per epoch, a function on eachFeeCollector
is called to transfer the held ether (first converted to WETH) to the staking contract. Delaying this transfer and associated accounting yields significant gas savings.Testing instructions
yarn build && yarn test
incontracts/zero-ex
.The basic happy path with WETH is tested, but all other tests are missing. Future commits will add more robust testing, including negative testing for failure modes.
Types of changes
Checklist:
[WIP]
if necessary.