diff --git a/lib/tests/2wp.js b/lib/tests/2wp.js index d17f07f1..95e891c0 100644 --- a/lib/tests/2wp.js +++ b/lib/tests/2wp.js @@ -1,5 +1,5 @@ const expect = require('chai').expect -const { ensure0x } = require('../utils'); +const { ensure0x, removePrefix0x} = require('../utils'); const whitelistingAssertions = require('../assertions/whitelisting'); const rskUtils = require('../rsk-utils'); const CustomError = require('../CustomError'); @@ -10,6 +10,7 @@ const { getDerivedRSKAddressInformation } = require('@rsksmart/btc-rsk-derivatio const btcEthUnitConverter = require('@rsksmart/btc-eth-unit-converter'); const { sendTxToBridge, sendPegin, ensurePeginIsRegistered, donateToBridge } = require('../2wp-utils'); const { waitAndUpdateBridge } = require('../rsk-utils'); +const {VarInt} = require("../varint"); const DONATION_AMOUNT = 250; const REJECTED_REASON = 1; @@ -180,7 +181,11 @@ const execute = (description, getRskHost) => { if (isLovell700AlreadyActive) { const pegoutTransactionCreatedEvent = await rskUtils.findEventInBlock(localRskTxHelper, 'pegout_transaction_created'); expect(pegoutTransactionCreatedEvent).to.not.be.null; - expect(pegoutTransactionCreatedEvent.arguments.utxoOutpointValues.includes("fe80f0fa02")).to.be.true; + let utxoOutpointValuesAsHex = pegoutTransactionCreatedEvent.arguments.utxoOutpointValues; + + // 0xfe80f0fa02 = 50000000 + const expectedResult = ensure0x(Buffer.from(new VarInt(pegoutValueInSatoshis).encode()).toString("hex")); + expect(utxoOutpointValuesAsHex).to.equal(expectedResult, "Outpoint values are different."); } }; diff --git a/lib/varint-tests.js b/lib/varint-tests.js new file mode 100644 index 00000000..b0b8d952 --- /dev/null +++ b/lib/varint-tests.js @@ -0,0 +1,65 @@ +const { expect } = require('chai'); +const { VarInt, Utils } = require('./varint'); + +describe('VarInt Tests', function() { + + it('testBytes', function() { + let a = new VarInt(10); + expect(a.getSizeInBytes()).to.equal(1); + expect(a.encode().length).to.equal(1); + expect(new VarInt(a.encode(), 0).value).to.equal(10n); + }); + + it('testShorts', function() { + let a = new VarInt(64000); + expect(a.getSizeInBytes()).to.equal(3); + expect(a.encode().length).to.equal(3); + expect(new VarInt(a.encode(), 0).value).to.equal(64000n); + }); + + it('testShortFFFF', function() { + let a = new VarInt(0xFFFF); + expect(a.getSizeInBytes()).to.equal(3); + expect(a.encode().length).to.equal(3); + expect(new VarInt(a.encode(), 0).value).to.equal(0xFFFFn); + }); + + it('testSizeOfNegativeInt', function() { + expect(VarInt.sizeOf(-1n)).to.equal(new VarInt(-1n).encode().length); + }); + + it('testMaxInt', function() { + let varInt = new VarInt(BigInt(Number.MAX_SAFE_INTEGER)); + console.log(Buffer.from(varInt.encode()).toString('hex')); + }); + + it('testDeserializeListOfValuesInHex', function() { + let expectedValues = [14435729n, 255n, 187n, 13337n]; + let values = Buffer.from('FE9145DC00FDFF00BBFD1934', 'hex'); + let offset = 0; + let idx = 0; + while (values.length > offset) { + let varIntValue = new VarInt(values, offset); + offset += varIntValue.getSizeInBytes(); + expect(varIntValue.value).to.equal(expectedValues[idx]); + idx++; + console.log(new Intl.NumberFormat().format(varIntValue.value)); + } + }); + + it('testSerializeListOfValuesInHex', function() { + // FF0040075AF0750700 + const maxBitcoin = 2100000000000000n; + let values = [maxBitcoin, 14435729n, 255n, 187n, 13337n]; + let stream = []; + values.forEach(value => { + let varIntValue = new VarInt(value); + console.log(Buffer.from(varIntValue.encode()).toString('hex')); + stream = stream.concat(Array.from(varIntValue.encode())); + }); + + let expectedResult = Buffer.from('FF0040075AF0750700FE9145DC00FDFF00BBFD1934', 'hex'); + expect(Buffer.from(stream)).to.deep.equal(expectedResult); + }); + +}); diff --git a/lib/varint.js b/lib/varint.js new file mode 100644 index 00000000..36786468 --- /dev/null +++ b/lib/varint.js @@ -0,0 +1,93 @@ +class VarInt { + constructor(valueOrBuf, offset = 0) { + if (typeof valueOrBuf === 'number' || typeof valueOrBuf === 'bigint') { + this.value = BigInt.asUintN(64, BigInt(valueOrBuf)); // Ensure value is treated as unsigned 64-bit integer + this.originallyEncodedSize = this.getSizeInBytes(); + } else if (valueOrBuf instanceof Uint8Array) { + const buf = valueOrBuf; + const first = buf[offset] & 0xFF; + if (first < 253) { + this.value = BigInt(first); + this.originallyEncodedSize = 1; + } else if (first === 253) { + this.value = BigInt((buf[offset + 1] & 0xFF) | ((buf[offset + 2] & 0xFF) << 8)); + this.originallyEncodedSize = 3; + } else if (first === 254) { + this.value = Utils.readUint32(buf, offset + 1); + this.originallyEncodedSize = 5; + } else { + this.value = Utils.readInt64(buf, offset + 1); + this.originallyEncodedSize = 9; + } + } else { + throw new Error('Invalid constructor argument'); + } + } + + getOriginalSizeInBytes() { + return this.originallyEncodedSize; + } + + getSizeInBytes() { + return VarInt.sizeOf(this.value); + } + + static sizeOf(value) { + if (value < 0) return 9; // 1 marker + 8 data bytes + if (value < 253) return 1; // 1 data byte + if (value <= 0xFFFFn) return 3; // 1 marker + 2 data bytes + if (value <= 0xFFFFFFFFn) return 5; // 1 marker + 4 data bytes + return 9; // 1 marker + 8 data bytes + } + + encode() { + let bytes; + switch (VarInt.sizeOf(this.value)) { + case 1: + return new Uint8Array([Number(this.value)]); + case 3: + return new Uint8Array([253, Number(this.value) & 0xFF, (Number(this.value) >> 8) & 0xFF]); + case 5: + bytes = new Uint8Array(5); + bytes[0] = 254; + Utils.uint32ToByteArrayLE(this.value, bytes, 1); + return bytes; + default: + bytes = new Uint8Array(9); + bytes[0] = 255; + Utils.uint64ToByteArrayLE(this.value, bytes, 1); + return bytes; + } + } +} + +class Utils { + static readUint32(buf, offset) { + return BigInt((buf[offset] & 0xFF) | + ((buf[offset + 1] & 0xFF) << 8) | + ((buf[offset + 2] & 0xFF) << 16) | + ((buf[offset + 3] & 0xFF) << 24) >>> 0); + } + + static readInt64(buf, offset) { + let low = Utils.readUint32(buf, offset); + let high = Utils.readUint32(buf, offset + 4); + return (high << 32n) + low; + } + + static uint32ToByteArrayLE(value, buf, offset) { + value = BigInt(value); + buf[offset] = Number(value & 0xFFn); + buf[offset + 1] = Number((value >> 8n) & 0xFFn); + buf[offset + 2] = Number((value >> 16n) & 0xFFn); + buf[offset + 3] = Number((value >> 24n) & 0xFFn); + } + + static uint64ToByteArrayLE(value, buf, offset) { + value = BigInt(value); + Utils.uint32ToByteArrayLE(value & 0xFFFFFFFFn, buf, offset); + Utils.uint32ToByteArrayLE(value >> 32n, buf, offset + 4); + } +} + +module.exports = { VarInt, Utils }; diff --git a/package-lock.json b/package-lock.json index 8c622ba1..2728c65c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,14 +50,6 @@ "shelljs": "^0.8.5" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -67,19 +59,19 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.6", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -233,6 +225,17 @@ "node": ">=14" } }, + "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", @@ -676,7 +679,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@noble/hashes": { + "node_modules/@noble/curves/node_modules/@noble/hashes": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", @@ -687,6 +690,17 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@rsksmart/bridge-state-data-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@rsksmart/bridge-state-data-parser/-/bridge-state-data-parser-1.2.0.tgz", @@ -781,6 +795,12 @@ "web3": "^1.3.6" } }, + "node_modules/@rsksmart/rsk-precompiled-abis-lovell700": { + "name": "@rsksmart/rsk-precompiled-abis", + "version": "7.0.0-LOVELL", + "resolved": "git+ssh://git@github.com/rsksmart/precompiled-abis.git#c9cddf4f20a9152046ae5823798b7401a31fd4cb", + "license": "ISC" + }, "node_modules/@scure/base": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", @@ -802,6 +822,17 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@scure/bip32/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@scure/bip39": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.2.tgz", @@ -814,6 +845,17 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@scure/bip39/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -1114,9 +1156,9 @@ } }, "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -1327,11 +1369,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1349,18 +1391,10 @@ "node_modules/bridge-transaction-parser-lovell700": { "name": "@rsksmart/bridge-transaction-parser", "version": "1.1.2", - "resolved": "git+ssh://git@github.com/rsksmart/bridge-transaction-parser.git#62c846ddaabd45a45dbc3dfb8432358d4ac8a0db", + "resolved": "git+ssh://git@github.com/rsksmart/bridge-transaction-parser.git#1f4652f0eb9a3cbc465a8560aa02760ca4be65a3", "license": "MIT", "dependencies": { - "@rsksmart/rsk-precompiled-abis": "^5.0.0-FINGERROOT" - } - }, - "node_modules/bridge-transaction-parser-lovell700/node_modules/@rsksmart/rsk-precompiled-abis": { - "version": "5.0.0-HOP", - "resolved": "https://registry.npmjs.org/@rsksmart/rsk-precompiled-abis/-/rsk-precompiled-abis-5.0.0-HOP.tgz", - "integrity": "sha512-VCSQRNE+3qeyMUsEPTxHTbj1MxmJSVJaeBwrYZg7vN46KFE4FaZd9hYp8iNpOUmpyZNhXySdVSFV9wlcubR1Gw==", - "dependencies": { - "web3": "^1.3.6" + "@rsksmart/rsk-precompiled-abis-lovell700": "git+https://github.com/rsksmart/precompiled-abis#master" } }, "node_modules/brorand": { @@ -1576,14 +1610,14 @@ } }, "node_modules/chai-as-promised": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", - "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", "dependencies": { "check-error": "^1.0.2" }, "peerDependencies": { - "chai": ">= 2.1.2 < 5" + "chai": ">= 2.1.2 < 6" } }, "node_modules/chalk": { @@ -2571,11 +2605,11 @@ } }, "node_modules/ethereum-bloom-filters": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", - "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.1.0.tgz", + "integrity": "sha512-J1gDRkLpuGNvWYzWslBQR9cDV4nd4kfvVTE/Wy4Kkm4yb3EYRSlyi0eB/inTsSTTVyA0+HyzHgbr95Fn/Z1fSw==", "dependencies": { - "js-sha3": "^0.8.0" + "@noble/hashes": "^1.4.0" } }, "node_modules/ethereum-common": { @@ -2830,9 +2864,9 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3094,6 +3128,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3447,6 +3482,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3855,17 +3891,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -4009,11 +4034,6 @@ "yallist": "^3.0.0" } }, - "node_modules/minipass/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, "node_modules/minizlib": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", @@ -4119,6 +4139,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4271,9 +4292,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -4369,16 +4390,16 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -4483,9 +4504,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", + "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==" }, "node_modules/pathval": { "version": "1.1.1", @@ -4600,9 +4621,9 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -4656,7 +4677,7 @@ "node_modules/precompiled-lovell700": { "name": "@rsksmart/rsk-precompiled-abis", "version": "7.0.0-LOVELL", - "resolved": "git+ssh://git@github.com/rsksmart/precompiled-abis.git#e80e6227b85c71cf71f9e07a3aaee7ca0abb1c3f", + "resolved": "git+ssh://git@github.com/rsksmart/precompiled-abis.git#c9cddf4f20a9152046ae5823798b7401a31fd4cb", "license": "ISC" }, "node_modules/precompiled-orchid": { @@ -4988,6 +5009,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dependencies": { "glob": "^7.1.3" }, @@ -5084,12 +5106,9 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -5405,6 +5424,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dependencies": { "glob": "^7.1.3" }, @@ -5704,14 +5724,14 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", + "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", @@ -5759,11 +5779,6 @@ "node": ">=4.5" } }, - "node_modules/tar/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6412,6 +6427,17 @@ "node": ">=8.0.0" } }, + "node_modules/web3-utils/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/web3-utils/node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -6434,13 +6460,13 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.35.tgz", + "integrity": "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==", "dependencies": { "bufferutil": "^4.0.1", "debug": "^2.2.0", - "es5-ext": "^0.10.50", + "es5-ext": "^0.10.63", "typedarray-to-buffer": "^3.1.5", "utf-8-validate": "^5.0.2", "yaeti": "^0.0.6" @@ -6511,6 +6537,14 @@ "bs58check": "<3.0.0" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -6634,9 +6668,9 @@ } }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yargs": { "version": "16.2.0",