Closed sparrowDom closed 1 month ago
Warnings | |
---|---|
:warning: | :eyes: This PR needs at least 2 reviewers |
Generated by :no_entry_sign: dangerJS against fc16706b43c116334d2165f10bfd63f560ed52df
Attention: Patch coverage is 0%
with 44 lines
in your changes missing coverage. Please review.
Project coverage is 52.56%. Comparing base (
3bd3be1
) to head (fc16706
). Report is 1 commits behind head on sparrowDom/aerodromeAMOswapFees.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Using somewhat novel approach this PR enables transaction scope memory like global variables. This enables the 3 Aerodrome AMO functions that have a consequence of minting/acquiring OETHb to mark a global flag that is only reset when the OETH is burned. If OETH wasn't burned after any of the functions that has the
BURN_OETH
variable in scope finishes an exception is thrown.Downsides:
Global variable code details:
scopeVariable
&scopeVariableWithAssertion
are added. These modifiers allow the setting of memory-like global variables within a transaction scope. Once the transaction completes the variables are set to their original 0 value and most of the solidity gas is refunded (costs 200 gas per setting the variable).scopeVariableWithAssertion
also asserts the final value of the variable and throws an exception if it doesn't match the expected state.