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

Conversions between fixed-size byte arrays of different lengths are wrong #234

Open
ellab123 opened this issue Jan 24, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@ellab123
Copy link
Collaborator

From Solidity v.0.6.1 doc:
If a fixed-size bytes type is explicitly converted to a larger type, it is padded on the right, for example:
bytes2 a = 0x1234;
bytes4 b = bytes4(a); // b will be 0x12340000

In VeriSol, the value of b is exactly the same as the value of a.

@ellab123 ellab123 added the bug Something isn't working label Jan 24, 2020
@shuvendu-lahiri
Copy link
Member

shuvendu-lahiri commented Jan 28, 2020

the test is added as a comment in BytesTypes.sol by Ella.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants