-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Reject interoperable addresses whith both chain reference and addresses empty #6331
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'openzeppelin-solidity': minor | ||
| --- | ||
|
|
||
| `InteroperableAddress`: reject inputs with both chain reference and addresses empty. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -116,11 +116,13 @@ describe('ERC7390', function () { | |||||
| // version 2 + some data | ||||||
| 'unsupported version': '0x00020000010100', | ||||||
| // version + ref: missing chainReferenceLength and addressLength | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case there is not address length. There is no chainReferenceLength, and no addressLength. We are not even looking into the chain reference and address buffer |
||||||
| 'too short (case 1)': '0x00010000', | ||||||
| 'too short (case 1)': '0x00010042', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get why we're changing this test case. With the new code, this is rejected because both
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current test uses an (invalid) interroperable address with a That is why I think we should use a non zero chaintype to make a clear distinction. |
||||||
| // version + ref + chainReference: missing addressLength | ||||||
| 'too short (case 2)': '0x000100000101', | ||||||
| 'too short (case 2)': '0x000100420101', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the old test here was fine
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same answer :) |
||||||
| // version + ref + chainReference + addressLength + part of the address: missing 2 bytes of the address | ||||||
| 'too short (case 3)': '0x00010000010114d8da6bf26964af9d7eed9e03e53415d37aa9', | ||||||
| 'too short (case 3)': '0x00010042010114d8da6bf26964af9d7eed9e03e53415d37aa9', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same answer :) |
||||||
| // empry chain reference and address | ||||||
Amxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| 'empty chain reference and address': '0x000100420000', | ||||||
Amxx marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| })) { | ||||||
| it(title, async function () { | ||||||
| await expect(this.mock.$parseV1(binary)) | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.