harb/tools/push3-transpiler/package.json
openhands 1e75285579 fix: fix: transpiler outputs raw int literals for uint24 anchorWidth — overflow crashes forge (#900)
Clamp anchorWidth output with `% (2**24)` before the uint24 cast so that
large literal values (e.g. 1e18 from evolved constants) produce valid
Solidity instead of a compile-time overflow error.

Add test_transpiler_clamping.sh (Test 5) verifying that a Push3 program
outputting 1e18 for anchorWidth generates `uint24(... % (2**24))` and not
the raw overflowing literal. Update package.json to run both test suites.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 06:40:30 +00:00

18 lines
462 B
JSON

{
"name": "push3-transpiler",
"version": "1.0.0",
"description": "Push3 to Solidity transpiler for OptimizerV3",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"transpile": "ts-node src/index.ts",
"test": "bash test_inject_extraction.sh && bash test_transpiler_clamping.sh"
},
"dependencies": {},
"devDependencies": {
"typescript": "^5.0.0",
"ts-node": "^10.0.0",
"@types/node": "^20.0.0"
}
}