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

fix: SSTORE2MetadataProvider indexing #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contracts/renderers/SSTORE2MetadataProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract SSTORE2MetadataProvider is MetadataProvider {
}

/// @notice The next index to use for storing metadata.
uint256 public nextIndex;
uint256 public nextIndex = 1;

/// @notice The metadata for each Party instance.
mapping(uint256 index => address file) public files;
Expand All @@ -35,6 +35,9 @@ contract SSTORE2MetadataProvider is MetadataProvider {
uint256
) external view override returns (bytes memory data) {
Indexes memory index = indexes[instance];

if (index.start == 0 && index.end == 0) return "";

for (uint256 i = index.start; i <= index.end; i++) {
data = abi.encodePacked(data, SSTORE2.read(files[i]));
}
Expand Down
Loading