Skip to content

Conversation

@joe-p
Copy link
Contributor

@joe-p joe-p commented Jun 28, 2025

Closes #586

@netlify
Copy link

netlify bot commented Jun 28, 2025

Deploy Preview for tealscript ready!

Name Link
🔨 Latest commit 84d30bc
🔍 Latest deploy log https://app.netlify.com/projects/tealscript/deploys/68605c0a35df3c0008f453f9
😎 Deploy Preview https://deploy-preview-587--tealscript.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@joe-p joe-p requested a review from Copilot June 28, 2025 15:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for bitwise operations on byte inputs by introducing new functions in the contract, updating ABI artifacts and TEAL code, and adding corresponding opcodes in the compiler.

  • Added contract methods for bitwise XOR, AND, OR, and NOT in tests/contracts/binary.algo.ts.
  • Updated ABI JSON definitions and TEAL approval logic to support the new bitwise operations.
  • Updated the snapshot and compiler opcode mappings to reflect these changes.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/contracts/binary.algo.ts Added wrapper functions calling bitwise operations on bytes.
tests/contracts/artifacts/*.json Updated ABI artifacts to include new bitwise operation methods.
tests/contracts/artifacts/BinaryTest.approval.teal Added new subroutines and abi routes for bitwise op methods.
tests/snapshots/binary.test.ts.snap Updated snapshot reflecting the new program size.
src/lib/compiler.ts Introduced new opcode mappings for bitwise operations.
Comments suppressed due to low confidence (2)

src/lib/compiler.ts:6944

  • Consider adding inline documentation for the new bitwise opcodes (bitwiseXor, bitwiseAnd, bitwiseOr, bitwiseNot) to clarify their behavior and mapping to TEAL instructions.
    bitwiseXor: 'b^',

tests/snapshots/binary.test.ts.snap:3

  • [nitpick] Verify that the updated snapshot reflecting an increased program size is intended and that it covers the changes introduced by the new bitwise operations.
exports[`Binary Expressions BinaryTest Artifacts Maintains program size 1`] = `461`;

@joe-p joe-p merged commit 93d491d into dev Jun 28, 2025
6 checks passed
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 this pull request may close these issues.

BitwiseXor for Bytes

2 participants