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 few codegen errors to allow solidity compilation in Mock mode. #409

Closed
wants to merge 3 commits into from

Conversation

0xalexbel
Copy link

Issue:

  • Impl.sol does not compile in mock mode due to select function declared twice.
DeclarationError: Function with same name and parameter types defined twice.
   --> fhevm/mocks/Impl.sol:122:5:
    |
122 |     function select(uint256 control, uint256 ifTrue, uint256 ifFalse) internal pure returns (uint256 result) {
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Other declaration is here:
   --> fhevm/mocks/Impl.sol:126:5:
    |
126 |     function select(uint256 control, uint256 ifTrue, uint256 ifFalse) internal pure returns (uint256 result) {
    |     ^ (Relevant source part starts here and spans across multiple lines).
  • Impl.sol does not compile in mock mode due to implicit conversion error in verify function
  • TFHE.sol does not compile in mock mode due to missing functions in Impl.sol

Solution:

  • Remove the duplicate declaration in codegen/template.ts
  • Change verify from einput to bytes32
  • Add dummy ineffective missing functions in Impl.sol : allow + clearTranscientStorage

Copy link

cla-bot bot commented Jun 24, 2024

Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @0xalexbel on file. In order for us to review and merge your code, please sign:

  • For individual contribution: our CLA
  • for Bounty submission, if you are an individual: our T&C
  • for Bounty submission, if you are a company: our T&C
    to get yourself added.

If you already signed one of this document, just wait to be added to the bot config.

@aquint-zama
Copy link
Contributor

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Jun 24, 2024
Copy link

cla-bot bot commented Jun 24, 2024

The cla-bot has been summoned, and re-checked this pull request!

@immortal-tofu
Copy link
Collaborator

The mock has been fixed in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants