ajna-core
ajna-core copied to clipboard
Contract size improvements
Description
- Remove the
_determineInflatorState
method and add the method logic into thePool
contract. - Remove the
_getCollateralDustPricePrecisionAdjustment
method and add the method logic into theERC20Pool
contract. - Update the
getExchangeRate
method visibility in theBuckets
library toexternal
as that was only called inside thebucketExchangeRate
method in thePool
contract which is aview
method.
Purpose
- PR aims to reduce contract size to accommodate contract changes that may occur in the future.
Impact
- ERC721 contract size reduced from
24,540B (99.85%)
to24,329B (98.99%)
. - ERC20 contract size reduced from
23,597B (96.01%)
to23,375B (95.11%)
.
Tasks
- [x] Changes to protocol contracts are covered by unit tests executed by CI.
- [x] Protocol contract size limits have not been exceeded.
- [x] Gas consumption for impacted transactions have been compared with the target branch, and nontrivial changes cited in the Impact section above.
- [x] Scope labels have been assigned as appropriate.
- [x] Invariant tests have been manually executed as appropriate for the nature of the change.