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

Storage refactor #69

Closed
wants to merge 11 commits into from
Closed

Storage refactor #69

wants to merge 11 commits into from

Conversation

dglowinski
Copy link
Collaborator

@dglowinski dglowinski commented Mar 22, 2024

Storage refactored to ERC-7201 unstructured storage namespaces, following OZ's lead.

foundry.toml Outdated
@@ -22,8 +22,7 @@ number_underscore = "preserve"
override_spacing = true
ignore = [
"src/EVault/EVault.sol",
"src/EVault/shared/types/MarketStorage.sol",
"src/EVault/shared/types/MarketCache.sol"
"src/EVault/shared/types/Market.sol",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"src/EVault/shared/types/Market.sol" does it even exist?

@@ -8,7 +8,8 @@ import {BorrowUtils} from "../shared/BorrowUtils.sol";
import {DToken} from "../DToken.sol";
import {ProxyUtils} from "../shared/lib/ProxyUtils.sol";
import {RevertBytes} from "../shared/lib/RevertBytes.sol";
import {MarketCache} from "../shared/types/MarketCache.sol";
import {VaultCache} from "../shared/types/VaultCache.sol";
// import {SnapshotStorage} from "../shared/SnapshotStorage.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


function snapshotStorage() internal pure virtual returns (Snapshot storage data) {
assembly {
data.slot := SNAPSHOT_STORAGE // The extrenal struct's slot is the same as internal's
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: extrenal

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to remove 👍

Copy link
Contributor

@hoytech hoytech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me. s/market/vault make sense for sure.

I'm on the fence about the ERC-7201 stuff, slightly lean towards no. It adds more boilerplate everywhere we use storage, but maybe will make some things easier down the road.

@dglowinski dglowinski closed this Mar 24, 2024
@dglowinski dglowinski deleted the storage-refactor branch May 20, 2024 11:12
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.

3 participants