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

feat: added bitwise coverage solidity example contract (#519) #522

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

quiet-node
Copy link
Member

@quiet-node quiet-node commented Oct 23, 2023

Description:

  • added Bitwise contract to cover below opcodes
    • not(x)
    • and(x, y)
    • or(x, y)
    • xor(x, y)
    • byte(n, x)
    • shl(x, y)
    • shr(x, y)
    • sar(x, y)
  • added unit tests to cover Bitwise cotract

Related issue(s): #519

Fixes #519

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@quiet-node quiet-node added enhancement New feature or request P2 EVM evm related Tooling tooling labels Oct 23, 2023
@quiet-node quiet-node added this to the 0.6.0 milestone Oct 23, 2023
@quiet-node quiet-node self-assigned this Oct 23, 2023
@quiet-node quiet-node force-pushed the 519-Bitwise-coverage branch from 6fda40e to 17edf4d Compare October 23, 2023 19:02
@github-actions
Copy link

github-actions bot commented Oct 23, 2023

Test Results

  15 files  +  1    66 suites  +2   8m 11s ⏱️ +28s
198 tests +  2  191 ✔️ +  3  6 💤 ±0  1  - 1 
208 runs  +10  201 ✔️ +11  6 💤 ±0  1  - 1 

For more details on these failures, see this check.

Results for commit afbaed5. ± Comparison against base commit e7dd7b7.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
"before all" hook for "should test that hollow account is created and the amount of non-fungible tokens is correctly transferred via precompile" ‑ HIP583 Test Suite - Ethereum Transfer TX via Precompile Non-Fungible Token Test "before all" hook for "should test that hollow account is created and the amount of non-fungible tokens is correctly transferred via precompile"
should test that can make non-fungible token transfer via precompile from hollow account to another ‑ HIP583 Test Suite - Ethereum Transfer TX via Precompile Non-Fungible Token Test should test that can make non-fungible token transfer via precompile from hollow account to another
should test that hollow account is created and the amount of non-fungible tokens is correctly transferred via precompile ‑ HIP583 Test Suite - Ethereum Transfer TX via Precompile Non-Fungible Token Test should test that hollow account is created and the amount of non-fungible tokens is correctly transferred via precompile
should test that second transfer non-fungible tokens via precompile to the hollow account is successful ‑ HIP583 Test Suite - Ethereum Transfer TX via Precompile Non-Fungible Token Test should test that second transfer non-fungible tokens via precompile to the hollow account is successful

♻️ This comment has been updated with latest results.

@quiet-node quiet-node force-pushed the 519-Bitwise-coverage branch from 17edf4d to 6d0f2be Compare October 24, 2023 18:53
Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Blank line at the end of the file. Otherwise LG.

Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the Nit that Eric left and a Question.
Looks good!

const { expect } = require('chai')
const { ethers } = require('hardhat')

describe('@solidityequiv5 Bitwise Tests', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are we deciding what number to put after the solidityequiv?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah for this I thought with this new batch of test suites for Yul support I just give it a new number. I believe before the Yul support, it went up to solidityequiv4 so I just made it solidityequiv5

Signed-off-by: Logan Nguyen <[email protected]>
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG
License fix

@@ -0,0 +1,65 @@
// SPDX-License-Identifier: UNLICENSED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Apache 2.0 for all licenses

@quiet-node quiet-node force-pushed the 519-Bitwise-coverage branch from db9953b to afbaed5 Compare October 26, 2023 03:43
@quiet-node quiet-node requested a review from Nana-EC October 26, 2023 03:51
@quiet-node quiet-node merged commit 9fc8a03 into main Nov 1, 2023
20 of 21 checks passed
@quiet-node quiet-node deleted the 519-Bitwise-coverage branch November 1, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request EVM evm related P2 Tooling tooling
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Solidity Assembly Yul support] Bitwise coverage
4 participants