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

Seems like doesn't compile with 0.8.4 solidity. #42

Closed
andrewshvv opened this issue Jan 18, 2022 · 3 comments · Fixed by #46
Closed

Seems like doesn't compile with 0.8.4 solidity. #42

andrewshvv opened this issue Jan 18, 2022 · 3 comments · Fixed by #46

Comments

@andrewshvv
Copy link

Compiling 2 files with 0.8.4
TypeError: Unary operator - cannot be applied to type uint64
   --> @lazyledger/protobuf3-solidity-lib/contracts/ProtobufLib.sol:255:43:
    |
255 |         uint64 zigzag_val = (val >> 1) ^ (-(val & 1));
    |                                           ^^^^^^^^^^


TypeError: Unary operator - cannot be applied to type uint64
   --> @lazyledger/protobuf3-solidity-lib/contracts/ProtobufLib.sol:281:43:
    |
281 |         uint64 zigzag_val = (val >> 1) ^ (-(val & 1));
    |                                           ^^^^^^^^^^


TypeError: Explicit type conversion not allowed from "int32" to "uint64".
   --> @lazyledger/protobuf3-solidity-lib/contracts/ProtobufLib.sol:658:30:
    |
658 |         return encode_varint(uint64(n));
    |                              ^^^^^^^^^


Error HH600: Compilation failed
@andrewshvv andrewshvv changed the title Seems like doesn't work with 0.8.4 solidity. Seems like doesn't compile with 0.8.4 solidity. Jan 18, 2022
@andrewshvv
Copy link
Author

andrewshvv commented Jan 19, 2022

@adlerjohn

We have fixed it here, but also introduced some unnecessary changes, let me know if I need to create a pull request. All tests seem to be working. Overall thanks for such a library!

We probably plan to use it to store NFT metadata, because metadata is used inside the smart contract. And .proto inside the IPFS for UI to understand the metadata.

Changes:

  • support of sol ^0.8.0 (103f9cfd05c99837788c229a1354068a6a3592b7 for cherry-pick)
  • added waffle instead of truffle, truffle lagged for me when I tried to spin up the tests.
  • added a hardhat, because of console.log and better revert messages.
  • added chai, and rewrote tests a bit (only syntaxis changed).

@adlerjohn
Copy link
Member

adlerjohn commented Jan 19, 2022

Thanks, that's amazing! A PR would definitely be appreciated. Could you open one for each of the above 4 features, so they can be reviewed and tested in isolation (or use your best judgement to break it up into atomic changesets)?

@andrewshvv
Copy link
Author

hey, I remember about this, just didn't have the time to break it down yet.

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 a pull request may close this issue.

2 participants