From 455cf2957514b73a43862ad573adff4d87d22972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Vasconcelos=20J=C3=BAnior?= <64055364+luiz-lvj@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:59:57 -0300 Subject: [PATCH 1/3] add a dispatchable workflow to set npm dist-tags (#151) --- .github/workflows/npm-dist-tag.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/npm-dist-tag.yml diff --git a/.github/workflows/npm-dist-tag.yml b/.github/workflows/npm-dist-tag.yml new file mode 100644 index 0000000..72ae773 --- /dev/null +++ b/.github/workflows/npm-dist-tag.yml @@ -0,0 +1,32 @@ +name: Set npm dist-tag + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to tag (e.g. 5.6.0-rc.1)' + required: true + type: string + tag: + description: 'dist-tag to set' + required: true + default: latest + type: string + +jobs: + dist-tag: + name: Tag ${{ inputs.version }} as ${{ inputs.tag }} + environment: npm + runs-on: ubuntu-latest + steps: + - name: Authenticate to npm + # Intentionally escape $ to avoid interpolation and writing the token to disk + run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc + - name: Set dist-tag on both packages + run: | + npm dist-tag add "@openzeppelin/tron-contracts@$VERSION" "$TAG" + npm dist-tag add "@openzeppelin/tron-contracts-upgradeable@$VERSION" "$TAG" + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + VERSION: ${{ inputs.version }} + TAG: ${{ inputs.tag }} From 6459d15187e22180fbaa59b9e751e1d242a5b201 Mon Sep 17 00:00:00 2001 From: Pepe Blasco Date: Mon, 24 Aug 2026 10:47:52 +0200 Subject: [PATCH 2/3] Refresh package-lock.json for the moved hardhat-tron main The @openzeppelin/hardhat-tron git dependency tracks main. Their main now consumes @openzeppelin/tron-runtime ^0.1.0 from npm and bumps tronweb to 6.5.0, so npm ci fails against the stale lockfile on every branch. Re-resolve the lockfile. The jar-patch source pin follows the lockfile, so TRE jars now build from hardhat-tron 603106cd. Validated locally: clean npm ci, jar rebuild via build-tre-fork.sh (tre_version reports v1.0.4-oz-tron), tron-solc compile, and TRE smoke tests (P256 and Create2 suites) against the rebuilt jar. Co-Authored-By: Claude Fable 5 --- package-lock.json | 156 +++++++++++++--------------------------------- 1 file changed, 45 insertions(+), 111 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51a9c56..7a5670c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openzeppelin-tron-solidity", - "version": "0.0.1", + "version": "5.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openzeppelin-tron-solidity", - "version": "0.0.1", + "version": "5.5.0", "hasInstallScript": true, "license": "MIT", "devDependencies": { @@ -20,7 +20,7 @@ "@nomicfoundation/hardhat-ethers": "^3.0.9", "@nomicfoundation/hardhat-network-helpers": "^1.0.13", "@openzeppelin/docs-utils": "^0.1.5", - "@openzeppelin/hardhat-tron": "github:OpenZeppelin/hardhat-tron#main", + "@openzeppelin/hardhat-tron": "github:openzeppelin/hardhat-tron#main", "@openzeppelin/merkle-tree": "^1.0.7", "@openzeppelin/upgrade-safe-transpiler": "^0.4.1", "@openzeppelin/upgrades-core": "^1.20.6", @@ -59,9 +59,9 @@ } }, "node_modules/@adraffy/ens-normalize": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", + "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", "dev": true, "license": "MIT" }, @@ -2108,16 +2108,17 @@ }, "node_modules/@openzeppelin/hardhat-tron": { "version": "0.1.0", - "resolved": "git+ssh://git@github.com/OpenZeppelin/hardhat-tron.git#63474e038c9984a3deebfc227c49c71f7b00684f", + "resolved": "git+ssh://git@github.com/openzeppelin/hardhat-tron.git#603106cdbc35930a08787059e51f997f640a7185", "dev": true, "license": "MIT", "dependencies": { + "@openzeppelin/tron-runtime": "^0.1.0", "micromatch": "^4.0.8", "solc": "^0.8.26", "tronweb": "^6.2.2" }, "engines": { - "node": ">=18" + "node": ">=22" }, "peerDependencies": { "ethers": "^6.13.0", @@ -2135,6 +2136,22 @@ "ethereum-cryptography": "^3.0.0" } }, + "node_modules/@openzeppelin/tron-runtime": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/tron-runtime/-/tron-runtime-0.1.0.tgz", + "integrity": "sha512-ot5EdUIlUg8b6AoJZAUEyZyu8T7f1PpA8P5zxOi8C4rnG2Gb+NgOKg6cmimTLZt/4cSe/ERfaKSwS98GV1Ln+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ethers": "^6.14.0" + }, + "engines": { + "node": ">=22" + }, + "peerDependencies": { + "tronweb": "^6.4.0" + } + }, "node_modules/@openzeppelin/upgrade-safe-transpiler": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@openzeppelin/upgrade-safe-transpiler/-/upgrade-safe-transpiler-0.4.1.tgz", @@ -2909,14 +2926,15 @@ } }, "node_modules/axios": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz", - "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.0.tgz", + "integrity": "sha512-E32NzpYKp++W7XRe52rHiXV2ehxmh3wbdgO7MHeFM+vqxLBYHzt0ElkiImtOBxtOmyp0yoC8C6uESVV84Y2/hw==", "dev": true, "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.11", + "follow-redirects": "^1.16.0", "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } }, @@ -4763,9 +4781,9 @@ } }, "node_modules/ethers": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.14.0.tgz", - "integrity": "sha512-KgHwltNSMdbrGWEyKkM0Rt2s+u1nDH/5BVDQakLinzGEJi4bWindBzZSCC4gKsbZjwDTI6ex/8suR9Ihbmz4IQ==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.17.0.tgz", + "integrity": "sha512-BpyrpIPJ3ydEVow8zGaz1DuPS7YU8DcWxuBnY9a0UA/lvAPwrMr+EPXsfrul628SRaekPNeIM4UFh/91GWZang==", "dev": true, "funding": [ { @@ -4780,13 +4798,13 @@ "license": "MIT", "peer": true, "dependencies": { - "@adraffy/ens-normalize": "1.10.1", + "@adraffy/ens-normalize": "1.11.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", - "ws": "8.17.1" + "ws": "8.21.0" }, "engines": { "node": ">=14.0.0" @@ -8764,13 +8782,6 @@ "node": "*" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" - }, "node_modules/registry-auth-token": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", @@ -10483,36 +10494,24 @@ "license": "MIT" }, "node_modules/tronweb": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/tronweb/-/tronweb-6.3.0.tgz", - "integrity": "sha512-5CAjDO4/KfymgjKFgnXgfKKQp0xgOn8otCBYjgYAEIpLZDKNAk14Z0dDeg0UqYuceCiyMHjW7a19Rsz8EmhAOw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/tronweb/-/tronweb-6.5.0.tgz", + "integrity": "sha512-1OlkUqrFZpVSx0Gvwi9311iOVHbALobHg4SEEvOR3rhAUY+IjUIBCCwJB/u8QFpxx9GK6R6Njyqx45BMX3tjmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@babel/runtime": "7.26.10", - "axios": "1.15.0", + "axios": "1.18.0", "bignumber.js": "9.1.2", "ethereum-cryptography": "2.2.1", - "ethers": "6.13.5", + "ethers": "6.17.0", "eventemitter3": "5.0.1", "google-protobuf": "3.21.4", "semver": "7.7.1", + "tslib": "2.7.0", "validator": "13.15.23" } }, - "node_modules/tronweb/node_modules/@babel/runtime": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz", - "integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/tronweb/node_modules/@noble/curves": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", @@ -10578,16 +10577,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/tronweb/node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.19.2" - } - }, "node_modules/tronweb/node_modules/bignumber.js": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", @@ -10611,61 +10600,6 @@ "@scure/bip39": "1.3.0" } }, - "node_modules/tronweb/node_modules/ethers": { - "version": "6.13.5", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.5.tgz", - "integrity": "sha512-+knKNieu5EKRThQJWwqaJ10a6HE9sSehGeqWN65//wE7j47ZpFhKAnHB/JJFibwwg61I/koxaPsXbXpD/skNOQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "22.7.5", - "aes-js": "4.0.0-beta.5", - "tslib": "2.7.0", - "ws": "8.17.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tronweb/node_modules/ethers/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/tronweb/node_modules/ethers/node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", @@ -11184,9 +11118,9 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", "dev": true, "license": "MIT", "peer": true, From 469abc63465234c6e2f991a76b84def3a643d26e Mon Sep 17 00:00:00 2001 From: Pepe Blasco Date: Mon, 24 Aug 2026 10:58:32 +0200 Subject: [PATCH 3/3] Fix the toBeArray call broken by the ethers 6.17 width parameter ethers 6.17 adds a width parameter to toBeArray. Array.map passes the element index as the second argument, so .map(ethers.toBeArray) now throws a NUMERIC_FAULT overflow for width 0. Call it with the value only, matching upstream openzeppelin-contracts. Co-Authored-By: Claude Fable 5 --- test/utils/cryptography/MerkleProof.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/utils/cryptography/MerkleProof.test.js b/test/utils/cryptography/MerkleProof.test.js index 93ee964..fd480dd 100644 --- a/test/utils/cryptography/MerkleProof.test.js +++ b/test/utils/cryptography/MerkleProof.test.js @@ -187,7 +187,10 @@ describe('MerkleProof', function () { const root = nodeHash(leave, ethers.ZeroHash); // Now we can pass any **malicious** fake leaves as valid! - const maliciousLeaves = ['malicious', 'leaves'].map(ethers.id).map(ethers.toBeArray).sort(Buffer.compare); + const maliciousLeaves = ['malicious', 'leaves'] + .map(ethers.id) + .map(id => ethers.toBeArray(id)) + .sort(Buffer.compare); const maliciousProof = [leave, leave]; const maliciousProofFlags = [true, true, false];