OriginProtocol / origin-dollar

OUSD and OETH are stablecoins that passively accrue yield while you are holding it
https://originprotocol.com
MIT License
122 stars 79 forks source link

Simulate transaction scope global variables #2289

Closed sparrowDom closed 1 month ago

sparrowDom commented 1 month ago

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:

github-actions[bot] commented 1 month ago
Warnings
:warning: :eyes: This PR needs at least 2 reviewers

Generated by :no_entry_sign: dangerJS against fc16706b43c116334d2165f10bfd63f560ed52df

codecov[bot] commented 1 month ago

Codecov Report

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.

Files with missing lines Patch % Lines
...ontracts/contracts/utils/GlobalMemoryVariables.sol 0.00% 31 Missing :warning:
...acts/strategies/aerodrome/AerodromeAMOStrategy.sol 0.00% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## sparrowDom/aerodromeAMOswapFees #2289 +/- ## =================================================================== - Coverage 52.89% 52.56% -0.33% =================================================================== Files 79 80 +1 Lines 4099 4136 +37 Branches 820 828 +8 =================================================================== + Hits 2168 2174 +6 - Misses 1928 1959 +31 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.