Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(torii): add support for erc1155 #2955
base: main
Are you sure you want to change the base?
feat(torii): add support for erc1155 #2955
Changes from all commits
9637ab9
bd1a72d
4cec8ce
9201560
51b1185
91126fc
b0a9c08
32b3682
ea78b86
9dccfed
f123ced
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 32 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L27-L32
Check warning on line 36 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L34-L36
Check warning on line 40 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L38-L40
Check warning on line 73 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L51-L73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add bounds checking for array access, sensei.
The current implementation might panic if
ids_len
is larger than the actual data array. Consider adding a bounds check before accessing the array.Here's a suggested fix:
📝 Committable suggestion
Check warning on line 78 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L77-L78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add bounds check for values_len access.
Similar to the ids_len issue, the values_len access should be protected against out-of-bounds access.
Here's a suggested fix:
📝 Committable suggestion
Check warning on line 84 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L81-L84
Check warning on line 99 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L86-L99
Check warning on line 101 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L101
Check warning on line 107 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L107
Check warning on line 112 in crates/torii/indexer/src/processors/erc1155_transfer_batch.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_batch.rs#L111-L112
Check warning on line 31 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L27-L31
Check warning on line 35 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L33-L35
Check warning on line 39 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L37-L39
Check warning on line 53 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L50-L53
Check warning on line 56 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L55-L56
Check warning on line 72 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L58-L72
Check warning on line 75 in crates/torii/indexer/src/processors/erc1155_transfer_single.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc1155_transfer_single.rs#L74-L75
Check warning on line 83 in crates/torii/indexer/src/processors/erc721_legacy_transfer.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc721_legacy_transfer.rs#L83
Check warning on line 88 in crates/torii/indexer/src/processors/erc721_legacy_transfer.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc721_legacy_transfer.rs#L88
Check warning on line 83 in crates/torii/indexer/src/processors/erc721_transfer.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc721_transfer.rs#L83
Check warning on line 88 in crates/torii/indexer/src/processors/erc721_transfer.rs
Codecov / codecov/patch
crates/torii/indexer/src/processors/erc721_transfer.rs#L88
Check warning on line 82 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L82
Check warning on line 88 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L88
Check warning on line 99 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L99
Check warning on line 106 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L106
Check warning on line 123 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L123
Check warning on line 131 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L131
Check warning on line 223 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L223
Check warning on line 232 in crates/torii/sqlite/src/erc.rs
Codecov / codecov/patch
crates/torii/sqlite/src/erc.rs#L232