Latest Repo Discovered
RandNum
JavaScript
·
MIT License
Top Contributor of the Month
10811 commits in all time
Jan 20, 2026 04:21 – Apr 20, 2026 04:21 UTC
fix: only fold `0 || b` / `b || 0` to `b` in a bool context
The identity fold is only valid when `b` is boolean (0 or 1), since AVM `||` always returns 0 or 1. Guard with `bool_context` so the fold still applies where we know `b` is bool-typed.
b8ffe5c1
fix/logical-fold-non-bool
1/6 ++ 2 --
test: add regression test for || identity fold with non-bool operand
The intrinsic simplifier folds `0 || b` and `b || 0` to `b` unconditionally, but this is only valid when `b` is boolean (0 or 1) — AVM `||` always returns 0 or 1. For non-bool `b`, the fold produces the wrong value. This is only reachable from AWST (not Algorand Python source), so the test uses an LLM generated AWST JSON test case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d6010965
fix/logical-fold-non-bool
54/2,779 ++ 0 --
test: add regression test for && and || non-boolean constant folding
The intrinsic simplifier uses Python's `and`/`or` to fold AVM `&&`/`||`, which returns operand values instead of 0/1 for non-boolean constants. For example, `int(5 and 3)` returns 3, but AVM `&&` returns 1. This is only reachable from AWST (not Algorand Python source), so the test uses an LLM generated AWST JSON test case.
3effaef5
fix/logical-fold-non-bool
55/2,663 ++ 1 --
test: add regression test for && and || non-boolean constant folding
The intrinsic simplifier uses Python's `and`/`or` to fold AVM `&&`/`||`, which returns operand values instead of 0/1 for non-boolean constants. For example, `int(5 and 3)` returns 3, but AVM `&&` returns 1. This is only reachable from AWST (not Algorand Python source), so the test uses a hand-crafted AWST JSON test case.
f222dcfd
fix/logical-fold-non-bool
55/2,736 ++ 1 --
Merge 2f70bdccc1b4caeabfad5d4ceadf1bc71faf32a8 into 5523fbf696623f4b6976a538563b4b95cdf659fb
848b41cd
pull/825/merge
1/1 ++ 1 --
build(deps-dev): update eslint requirement from ^10.2.0 to ^10.2.1
Updates the requirements on [eslint](https://github.com/eslint/eslint) to permit the latest version. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.2.0...v10.2.1) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.2.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
2f70bdcc
dependabot/npm_and_yarn/eslint-tw-10.2.1
1/1 ++ 1 --
fix: guard extract/substring constant fold against OOB indices
Three related fixes: 1. Extract folding now checks len(source) < S+L before slicing, preventing Python's silent truncation from masking the AVM panic. 2. Substring folding now checks S <= E <= len(source) using a chained comparison, adding the missing upper bound check. 3. _get_bytes_length_safe now inductively verifies the source length before trusting an extract instruction's immediate length. Without this, a secondary optimization path could fold using an incorrect length even after the direct fold guard fires.
32abcc2c
main
2/52 ++ 3 --
test: add regression test for OOB extract/substring constant folding
The intrinsic simplifier folds extract and substring even when the indices are out of bounds, silently truncating the result. The AVM panics in these cases. Three separate contracts (ExtractLengthOOB, ExtractStartOOB, SubstringEndOOB) allow the on-chain tests to verify each error message independently.
05c02161
main
153/1,435 ++ 0 --
fix: guard extract/substring constant fold against OOB indices
Three related fixes: 1. Extract folding now checks len(source) < S+L before slicing, preventing Python's silent truncation from masking the AVM panic. 2. Substring folding now checks S <= E <= len(source) using a chained comparison, adding the missing upper bound check. 3. _get_bytes_length_safe now inductively verifies the source length before trusting an extract instruction's immediate length. Without this, a secondary optimization path could fold using an incorrect length even after the direct fold guard fires.
492255dc
pull/706/head
2/52 ++ 3 --
test: add regression test for OOB extract/substring constant folding
The intrinsic simplifier folds extract and substring even when the indices are out of bounds, silently truncating the result. The AVM panics in these cases. Three separate contracts (ExtractLengthOOB, ExtractStartOOB, SubstringEndOOB) allow the on-chain tests to verify each error message independently.
f42ad0ba
pull/706/head
153/1,435 ++ 0 --
test: add regression test for uint64 overflow constant folding
The intrinsic simplifier folds uint64 add/mul/exp even when the result exceeds 2^64-1. The AVM panics on overflow, but the optimizer produces oversized constants that propagate through subsequent folds. Three separate contracts (add, mul, exp) allow the on-chain tests to verify each overflow error message independently.
c7b46e15
main
153/1,438 ++ 0 --
fix: guard uint64 constant fold against overflow
The uint64 binary op folding only guarded against negative results but not overflow beyond MAX_UINT64. Operations like (2^64-1) + 1 produced oversized constants that propagated through subsequent folds. Now checks 0 <= c <= MAX_UINT64 before folding, preserving the AVM overflow panic.
6cf6b7c1
main
2/45 ++ 5 --