Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add grouped ilk emergency spells #10

Merged
merged 36 commits into from
Dec 3, 2024
Merged

Conversation

amusingaxl
Copy link
Contributor

@amusingaxl amusingaxl commented Nov 25, 2024

I decided to remove the hard-coded ilks approach in favor of a more general one which allows us to specify the desired ilks in the constructor.

Regular spells are executed through a delegatecall from MCD_PAUSE_PROXY. For that reason, they usually should not have storage variables, as they'd be accessing and interacting with MCD_PAUSE_PROXY's storage, not their own.

However, Emergency Spells are not required to interact with MCD_PAUSE and MCD_PAUSE_PROXY at all. They execute actions through regular call on Mom contracts, so we don't have this limitation.

Even if the contract is somehow misused and used as a regular spell, interacting with MCD_PAUSE, there wouldn't be a problem because the storage cannot be changed outside the constructor.

This approach requires some amount of hacking due to some Solidity limitations (i.e.: no support for immutable arrays, bytes32 <-> string conversion shenanigans).

While there is still some code duplication, this is significantly reduced compared to the previous approach.

amusingaxl and others added 27 commits November 6, 2024 11:40
@amusingaxl amusingaxl changed the title Feat: add batched ilk spells Feat: add batched ilk emergency spells Nov 25, 2024
@amusingaxl amusingaxl marked this pull request as ready for review November 27, 2024 14:22
@amusingaxl amusingaxl changed the title Feat: add batched ilk emergency spells Feat: add grouped ilk emergency spells Nov 28, 2024
src/DssGroupedEmergencySpell.sol Outdated Show resolved Hide resolved
src/DssGroupedEmergencySpell.sol Outdated Show resolved Hide resolved
src/DssGroupedEmergencySpell.sol Outdated Show resolved Hide resolved
src/DssGroupedEmergencySpell.sol Outdated Show resolved Hide resolved
src/DssGroupedEmergencySpell.t.integration.sol Outdated Show resolved Hide resolved
src/clip-breaker/GroupedClipBreakerSpell.sol Outdated Show resolved Hide resolved
src/line-wipe/GroupedLineWipeSpell.sol Outdated Show resolved Hide resolved
src/line-wipe/GroupedLineWipeSpell.sol Outdated Show resolved Hide resolved
src/line-wipe/GroupedLineWipeSpell.sol Outdated Show resolved Hide resolved
src/DssGroupedEmergencySpell.sol Outdated Show resolved Hide resolved
@amusingaxl amusingaxl requested a review from oddaf November 29, 2024 15:52
@amusingaxl amusingaxl merged commit 0129bcd into master Dec 3, 2024
1 check passed
@amusingaxl amusingaxl deleted the feat/batched-ilk-spells branch December 3, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants