diff --git a/lib/2wp-utils.js b/lib/2wp-utils.js index e513c6f6..66d6f22b 100644 --- a/lib/2wp-utils.js +++ b/lib/2wp-utils.js @@ -13,6 +13,7 @@ const { getBtcAddressBalanceInSatoshis, } = require('./btc-utils'); const { getBridge } = require('./bridge-provider'); +const { getStorageBytesAt } = require('./rsk-rpc-utils'); const { getDerivedRSKAddressInformation } = require('@rsksmart/btc-rsk-derivation'); const btcEthUnitConverter = require('@rsksmart/btc-eth-unit-converter'); const { PEGIN_EVENTS, DEFAULT_RSK_ADDRESS_FUNDING_IN_BTC } = require('./constants/pegin-constants'); @@ -50,7 +51,7 @@ const assertRefundUtxosSameAsPeginUtxos = async ( refundAddress ) => { const bridge = await getBridge(rskTxHelper.getClient()); - const federationAddress = await bridge.methods.getFederationAddress().call(); + const federationAddress = await bridge.getFederationAddress(); const peginTx = await btcTxHelper.getTransaction(peginTxHash); const outputsForFederation = peginTx.outs.filter( (output) => btcTxHelper.getOutputAddress(output.script) === federationAddress @@ -74,10 +75,10 @@ const assertRefundUtxosSameAsPeginUtxos = async ( * @param {BN} amountInWeisBN * @param {string} rskFromAddress * @param {boolean} mine If true, mines 1 block after sending the transaction. If false, it will not mine the tx and will return undefined. Defaults to true. - * @returns {Promise} the rsk tx receipt if `mine` is true, otherwise the tx promise. + * @returns {Promise} the rsk tx receipt if `mine` is true, otherwise the tx hash. */ const sendTxToBridge = async (rskTxHelper, amountInWeisBN, rskFromAddress, mine = true) => { - const txPromise = rskTxHelper.sendTransaction({ + const txHash = await rskTxHelper.sendTransaction({ from: rskFromAddress, to: BRIDGE_ADDRESS, value: amountInWeisBN, @@ -85,15 +86,14 @@ const sendTxToBridge = async (rskTxHelper, amountInWeisBN, rskFromAddress, mine }); if (!mine) { - return txPromise; + return txHash; } // Wait for the rsk tx to be in the rsk mempool before mining await waitForRskMempoolToGetNewTxs(rskTxHelper); await mineWithSubmitterAndSync(rskTxHelper); - const result = await txPromise; - return result; + return await rskTxHelper.getTxReceipt(txHash); }; /** @@ -125,9 +125,11 @@ const createPegoutRequest = async (rskTxHelper, amountInRBTC, requestSize = 1) = }; const getActiveFederationUtxos = async (rskTxHelper) => { - const activeUtxosRlpEncoded = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, newFederationBtcUTXOSStorageIndex); + const activeUtxosRlpEncoded = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + newFederationBtcUTXOSStorageIndex + ); if (activeUtxosRlpEncoded !== '0x0') { return parseRLPToActiveFederationUtxos(activeUtxosRlpEncoded); } @@ -135,9 +137,11 @@ const getActiveFederationUtxos = async (rskTxHelper) => { }; const getOldFederationUtxos = async (rskTxHelper) => { - const oldUtxosRlpEncoded = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, oldFederationBtcUTXOSStorageIndex); + const oldUtxosRlpEncoded = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + oldFederationBtcUTXOSStorageIndex + ); if (oldUtxosRlpEncoded !== '0x0') { return parseRLPToActiveFederationUtxos(oldUtxosRlpEncoded); } @@ -231,8 +235,8 @@ const sendPeginToActiveAndRetiringFederations = async ( } const bridge = await getBridge(rskTxHelper.getClient()); - const federationAddress = await bridge.methods.getFederationAddress().call(); - const retiringFederationAddress = await bridge.methods.getRetiringFederationAddress().call(); + const federationAddress = await bridge.getFederationAddress(); + const retiringFederationAddress = await bridge.getRetiringFederationAddress(); const recipientsTransferInformation = outputAmountsInBtcForActiveFederation.map((amount) => ({ recipientAddress: federationAddress, @@ -276,7 +280,7 @@ const sendPeginToActiveFederation = async ( data ) => { const bridge = await getBridge(rskTxHelper.getClient()); - const federationAddress = await bridge.methods.getFederationAddress().call(); + const federationAddress = await bridge.getFederationAddress(); return await sendPegin( rskTxHelper, btcTxHelper, @@ -305,7 +309,7 @@ const sendPeginToRetiringFederation = async ( data ) => { const bridge = await getBridge(rskTxHelper.getClient()); - const retiringFederationAddress = await bridge.methods.getRetiringFederationAddress().call(); + const retiringFederationAddress = await bridge.getRetiringFederationAddress(); return await sendPegin( rskTxHelper, btcTxHelper, @@ -350,9 +354,7 @@ const ensurePeginIsRegistered = async (rskTxHelper, peginBtcTxHash, expectedUtxo ); const bridge = await getBridge(rskTxHelper.getClient()); - const isBtcTxHashAlreadyProcessed = await bridge.methods - .isBtcTxHashAlreadyProcessed(peginBtcTxHash) - .call(); + const isBtcTxHashAlreadyProcessed = await bridge.isBtcTxHashAlreadyProcessed(peginBtcTxHash); if (utxoIsRegisteredInTheBridge && isBtcTxHashAlreadyProcessed) { logger.debug( @@ -472,8 +474,8 @@ const getBridgeUtxosBalance = async (rskTxHelper) => { */ const get2wpBalances = async (rskTxHelper, btcTxHelper) => { const bridge = await getBridge(rskTxHelper.getClient()); - const federationAddress = await bridge.methods.getFederationAddress().call(); - const retiringFederationAddress = await bridge.methods.getRetiringFederationAddress().call(); + const federationAddress = await bridge.getFederationAddress(); + const retiringFederationAddress = await bridge.getRetiringFederationAddress(); const federationAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis( btcTxHelper, federationAddress diff --git a/lib/assertions/contractMethods.js b/lib/assertions/contractMethods.js index 1b5d5a9d..9b07a05a 100644 --- a/lib/assertions/contractMethods.js +++ b/lib/assertions/contractMethods.js @@ -2,19 +2,29 @@ const chai = require('chai'); const expect = chai.expect; chai.use(require('chai-as-promised')); -const assertContractCallReturnsWithCallback = async (methodCall, expectedCallback, options) => { - const result = await methodCall.call(options); +const assertContractCallReturnsWithCallback = async ( + contract, + methodName, + methodArgs, + expectedCallback, + options +) => { + const args = options ? [...methodArgs, options] : methodArgs; + const result = await contract[methodName].staticCall(...args); return await expectedCallback(result); }; -const assertContractCallReturns = async (methodCall, expected) => { - return assertContractCallReturnsWithCallback(methodCall, (result) => - expect(result).to.be.eq(expected) +const assertContractCallReturns = async (contract, methodName, methodArgs, expected) => { + // `result` may be a bigint for numeric return types; stringify both sides so a string + // `expected` (the caller's usual convention) still compares correctly. + return assertContractCallReturnsWithCallback(contract, methodName, methodArgs, (result) => + expect(result.toString()).to.be.eq(expected.toString()) ); }; -const assertContractCallFails = async (methodCall, options) => { - await expect(methodCall.call(options)).to.be.rejected; +const assertContractCallFails = async (contract, methodName, methodArgs, options) => { + const args = options ? [...methodArgs, options] : methodArgs; + await expect(contract[methodName].staticCall(...args)).to.be.rejected; }; module.exports = { diff --git a/lib/assertions/whitelisting.js b/lib/assertions/whitelisting.js index 43feca1e..120aaec2 100644 --- a/lib/assertions/whitelisting.js +++ b/lib/assertions/whitelisting.js @@ -39,7 +39,7 @@ const assertAddOneOffWhitelistAddress = async ( ) => { const bridge = await getBridge(rskTxHelper.getClient()); - const initialWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const initialWhitelistSize = Number(await bridge.getLockWhitelistSize()); const unlocked = await rskUtils.getUnlockedAddress( rskTxHelper, @@ -49,27 +49,26 @@ const assertAddOneOffWhitelistAddress = async ( expect(unlocked).to.be.true; - const addOneOffLockWhitelistAddressMethod = bridge.methods.addOneOffLockWhitelistAddress( - btcAddress, - maxTransferValueInSatoshis - ); - await rskUtils.sendTxWithCheck( rskTxHelper, - addOneOffLockWhitelistAddressMethod, + bridge, + 'addOneOffLockWhitelistAddress', + [btcAddress, maxTransferValueInSatoshis], WHITELIST_CHANGE_ADDR, (addResult) => expect(Number(addResult)).to.equal(1) ); const addResult = Number( - await bridge.methods - .addOneOffLockWhitelistAddress(btcAddress, maxTransferValueInSatoshis) - .call({ from: WHITELIST_CHANGE_ADDR }) + await bridge.addOneOffLockWhitelistAddress.staticCall( + btcAddress, + maxTransferValueInSatoshis, + { from: WHITELIST_CHANGE_ADDR } + ) ); expect(addResult).to.equal(-1); - const finalLockWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const finalLockWhitelistSize = Number(await bridge.getLockWhitelistSize()); expect(finalLockWhitelistSize).to.equal(initialWhitelistSize + 1); @@ -101,14 +100,11 @@ const assertAddLockWhitelistAddress = async ( expect(unlocked).to.be.true; - const addLockWhitelistAddressMethod = bridge.methods.addLockWhitelistAddress( - btcAddress, - maxTransferValueInSatoshis - ); - await rskUtils.sendTxWithCheck( rskTxHelper, - addLockWhitelistAddressMethod, + bridge, + 'addLockWhitelistAddress', + [btcAddress, maxTransferValueInSatoshis], WHITELIST_CHANGE_ADDR, (addResult) => expect(Number(addResult)).to.be.equal(1) ); @@ -126,7 +122,7 @@ const assertAddLockWhitelistAddress = async ( const assertAddUnlimitedWhitelistAddress = async (rskTxHelper, btcAddress) => { const bridge = await getBridge(rskTxHelper.getClient()); - const initialWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const initialWhitelistSize = Number(await bridge.getLockWhitelistSize()); const unlocked = await rskUtils.getUnlockedAddress( rskTxHelper, @@ -136,25 +132,24 @@ const assertAddUnlimitedWhitelistAddress = async (rskTxHelper, btcAddress) => { expect(unlocked).to.be.true; - const addUnlimitedLockWhitelistAddressMethod = - bridge.methods.addUnlimitedLockWhitelistAddress(btcAddress); - await rskUtils.sendTxWithCheck( rskTxHelper, - addUnlimitedLockWhitelistAddressMethod, + bridge, + 'addUnlimitedLockWhitelistAddress', + [btcAddress], WHITELIST_CHANGE_ADDR, (addResult) => expect(Number(addResult)).to.equal(1) ); const addResult = Number( - await bridge.methods - .addUnlimitedLockWhitelistAddress(btcAddress) - .call({ from: WHITELIST_CHANGE_ADDR }) + await bridge.addUnlimitedLockWhitelistAddress.staticCall(btcAddress, { + from: WHITELIST_CHANGE_ADDR, + }) ); expect(addResult).to.equal(-1); - const finalWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const finalWhitelistSize = Number(await bridge.getLockWhitelistSize()); expect(finalWhitelistSize).to.equal(initialWhitelistSize + 1); @@ -171,15 +166,15 @@ const assertAddUnlimitedWhitelistAddress = async (rskTxHelper, btcAddress) => { const assertRemoveWhitelistAddress = async (rskTxHelper, btcAddress) => { const bridge = await getBridge(rskTxHelper.getClient()); - const initialWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const initialWhitelistSize = Number(await bridge.getLockWhitelistSize()); await assertWhitelistAddressPresence(rskTxHelper, btcAddress, true); - const removeLockWhitelistAddressMethod = bridge.methods.removeLockWhitelistAddress(btcAddress); - await rskUtils.sendTxWithCheck( rskTxHelper, - removeLockWhitelistAddressMethod, + bridge, + 'removeLockWhitelistAddress', + [btcAddress], WHITELIST_CHANGE_ADDR, (removeResult) => expect(Number(removeResult)).to.equal(1) ); @@ -187,14 +182,14 @@ const assertRemoveWhitelistAddress = async (rskTxHelper, btcAddress) => { await assertWhitelistAddressPresence(rskTxHelper, btcAddress, false); const removeResult = Number( - await bridge.methods - .removeLockWhitelistAddress(btcAddress) - .call({ from: WHITELIST_CHANGE_ADDR }) + await bridge.removeLockWhitelistAddress.staticCall(btcAddress, { + from: WHITELIST_CHANGE_ADDR, + }) ); expect(removeResult).to.equal(-1); - const finalWhitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const finalWhitelistSize = Number(await bridge.getLockWhitelistSize()); expect(finalWhitelistSize).to.equal(initialWhitelistSize - 1); }; @@ -208,11 +203,11 @@ const assertRemoveWhitelistAddress = async (rskTxHelper, btcAddress) => { const assertWhitelistAddressPresence = async (rskTxHelper, btcAddress, present) => { const bridge = await getBridge(rskTxHelper.getClient()); - const whitelistSize = Number(await bridge.methods.getLockWhitelistSize().call()); + const whitelistSize = Number(await bridge.getLockWhitelistSize()); const isPresentFromIndex = async (addressToSearch, size, index) => { for (let i = index; i < size; i++) { - const returnedAddress = await bridge.methods.getLockWhitelistAddress(i).call(); + const returnedAddress = await bridge.getLockWhitelistAddress(i); if (returnedAddress === addressToSearch) { return true; } diff --git a/lib/bridge-provider.js b/lib/bridge-provider.js index 3b51f00e..22f045f5 100644 --- a/lib/bridge-provider.js +++ b/lib/bridge-provider.js @@ -1,14 +1,16 @@ +const { ethers } = require('ethers'); const precompiledAbis = require('@rsksmart/rsk-precompiled-abis'); /** * Returns a new bridge. - * @param {Web3} rskClient - * @returns {Bridge} + * @param {import('ethers').JsonRpcProvider} rskClient + * @returns {import('ethers').Contract} Bridge */ const getBridge = async (rskClient) => { - return new rskClient.eth.Contract( + return new ethers.Contract( + precompiledAbis.bridge.address, precompiledAbis.bridge.abi, - precompiledAbis.bridge.address + rskClient ); }; diff --git a/lib/federation-utils.js b/lib/federation-utils.js index 8f2e095a..b7e171a6 100644 --- a/lib/federation-utils.js +++ b/lib/federation-utils.js @@ -2,7 +2,7 @@ const { KEY_TYPE_BTC, KEY_TYPE_RSK, KEY_TYPE_MST } = require('./constants/federa const { ethToWeis } = require('@rsksmart/btc-eth-unit-converter'); const rskUtils = require('./rsk-utils'); const federateStarter = require('./federate-starter'); -const { wait } = require('./utils'); +const { wait, ensure0x } = require('./utils'); const comparePublicKeys = (publicKeyA, publicKeyB) => { if (publicKeyA < publicKeyB) { @@ -86,8 +86,10 @@ const startNewFederationNodes = async (newFederationConfig, rskTxHelper) => { const fundNewFederators = async (rskTxHelper, newFederationConfig) => { for (const newFederatorConfig of newFederationConfig) { const newFederatorRskCompressedPublicKey = newFederatorConfig.publicKeys.rsk; - const newFederatorRskAddress = rskUtils.getAddressFromUncompressedPublicKey( - rskUtils.uncompressPublicKey(newFederatorRskCompressedPublicKey) + const newFederatorRskAddress = ensure0x( + rskUtils.getAddressFromUncompressedPublicKey( + rskUtils.uncompressPublicKey(newFederatorRskCompressedPublicKey) + ) ); await rskUtils.sendFromCow(rskTxHelper, newFederatorRskAddress, ethToWeis(0.1)); } @@ -96,18 +98,12 @@ const fundNewFederators = async (rskTxHelper, newFederationConfig) => { const getActiveFederationPublicKeys = async (bridge) => { const initialFederationKeys = []; - const initialFederationSize = Number(await bridge.methods.getFederationSize().call()); + const initialFederationSize = Number(await bridge.getFederationSize()); for (let i = 0; i < initialFederationSize; i++) { - const federatorBtcPublicKey = await bridge.methods - .getFederatorPublicKeyOfType(i, KEY_TYPE_BTC) - .call(); - const federatorRskPublicKey = await bridge.methods - .getFederatorPublicKeyOfType(i, KEY_TYPE_RSK) - .call(); - const federatorMstPublicKey = await bridge.methods - .getFederatorPublicKeyOfType(i, KEY_TYPE_MST) - .call(); + const federatorBtcPublicKey = await bridge.getFederatorPublicKeyOfType(i, KEY_TYPE_BTC); + const federatorRskPublicKey = await bridge.getFederatorPublicKeyOfType(i, KEY_TYPE_RSK); + const federatorMstPublicKey = await bridge.getFederatorPublicKeyOfType(i, KEY_TYPE_MST); initialFederationKeys.push({ [KEY_TYPE_BTC]: federatorBtcPublicKey, @@ -122,18 +118,21 @@ const getActiveFederationPublicKeys = async (bridge) => { const getProposedFederationPublicKeys = async (bridge) => { const proposedFederationKeys = []; - const proposedFederationSize = Number(await bridge.methods.getProposedFederationSize().call()); + const proposedFederationSize = Number(await bridge.getProposedFederationSize()); for (let i = 0; i < proposedFederationSize; i++) { - const federatorBtcPublicKey = await bridge.methods - .getProposedFederatorPublicKeyOfType(i, KEY_TYPE_BTC) - .call(); - const federatorRskPublicKey = await bridge.methods - .getProposedFederatorPublicKeyOfType(i, KEY_TYPE_RSK) - .call(); - const federatorMstPublicKey = await bridge.methods - .getProposedFederatorPublicKeyOfType(i, KEY_TYPE_MST) - .call(); + const federatorBtcPublicKey = await bridge.getProposedFederatorPublicKeyOfType( + i, + KEY_TYPE_BTC + ); + const federatorRskPublicKey = await bridge.getProposedFederatorPublicKeyOfType( + i, + KEY_TYPE_RSK + ); + const federatorMstPublicKey = await bridge.getProposedFederatorPublicKeyOfType( + i, + KEY_TYPE_MST + ); proposedFederationKeys.push({ [KEY_TYPE_BTC]: federatorBtcPublicKey, @@ -148,18 +147,21 @@ const getProposedFederationPublicKeys = async (bridge) => { const getRetiringFederationPublicKeys = async (bridge) => { const retiringFederationKeys = []; - const retiringFederationSize = Number(await bridge.methods.getRetiringFederationSize().call()); + const retiringFederationSize = Number(await bridge.getRetiringFederationSize()); for (let i = 0; i < retiringFederationSize; i++) { - const federatorBtcPublicKey = await bridge.methods - .getRetiringFederatorPublicKeyOfType(i, KEY_TYPE_BTC) - .call(); - const federatorRskPublicKey = await bridge.methods - .getRetiringFederatorPublicKeyOfType(i, KEY_TYPE_RSK) - .call(); - const federatorMstPublicKey = await bridge.methods - .getRetiringFederatorPublicKeyOfType(i, KEY_TYPE_MST) - .call(); + const federatorBtcPublicKey = await bridge.getRetiringFederatorPublicKeyOfType( + i, + KEY_TYPE_BTC + ); + const federatorRskPublicKey = await bridge.getRetiringFederatorPublicKeyOfType( + i, + KEY_TYPE_RSK + ); + const federatorMstPublicKey = await bridge.getRetiringFederatorPublicKeyOfType( + i, + KEY_TYPE_MST + ); retiringFederationKeys.push({ [KEY_TYPE_BTC]: federatorBtcPublicKey, @@ -173,10 +175,10 @@ const getRetiringFederationPublicKeys = async (bridge) => { const getActiveFederationInfo = async (bridge) => { const activeFederationInfoResponses = await Promise.all([ - bridge.methods.getFederationSize().call(), - bridge.methods.getFederationAddress().call(), - bridge.methods.getFederationCreationBlockNumber().call(), - bridge.methods.getFederationCreationTime().call(), + bridge.getFederationSize(), + bridge.getFederationAddress(), + bridge.getFederationCreationBlockNumber(), + bridge.getFederationCreationTime(), ]); const size = Number(activeFederationInfoResponses[0]); @@ -194,10 +196,10 @@ const getActiveFederationInfo = async (bridge) => { const getProposedFederationInfo = async (bridge) => { const proposedFederationInfoResponses = await Promise.all([ - bridge.methods.getProposedFederationSize().call(), - bridge.methods.getProposedFederationAddress().call(), - bridge.methods.getProposedFederationCreationBlockNumber().call(), - bridge.methods.getProposedFederationCreationTime().call(), + bridge.getProposedFederationSize(), + bridge.getProposedFederationAddress(), + bridge.getProposedFederationCreationBlockNumber(), + bridge.getProposedFederationCreationTime(), ]); const size = Number(proposedFederationInfoResponses[0]); @@ -215,10 +217,10 @@ const getProposedFederationInfo = async (bridge) => { const getRetiringFederationInfo = async (bridge) => { const retiringFederationInfoResponses = await Promise.all([ - bridge.methods.getRetiringFederationSize().call(), - bridge.methods.getRetiringFederationAddress().call(), - bridge.methods.getRetiringFederationCreationBlockNumber().call(), - bridge.methods.getRetiringFederationCreationTime().call(), + bridge.getRetiringFederationSize(), + bridge.getRetiringFederationAddress(), + bridge.getRetiringFederationCreationBlockNumber(), + bridge.getRetiringFederationCreationTime(), ]); const size = Number(retiringFederationInfoResponses[0]); diff --git a/lib/liquidity-bridge-contract.js b/lib/liquidity-bridge-contract.js index 8a7874c5..1125d539 100644 --- a/lib/liquidity-bridge-contract.js +++ b/lib/liquidity-bridge-contract.js @@ -1,4 +1,5 @@ const fs = require('node:fs'); +const { ethers } = require('ethers'); const { getRskTransactionHelper } = require('../lib/rsk-tx-helper-provider'); const { compileAndDeploy } = require('./sol-utils'); @@ -21,7 +22,7 @@ const deployLiquidityBridgeContract = async (host = null) => { fromAddress, Number(btcToWeis(INITIAL_RSK_BALANCE_IN_BTC)) ); - await rskTransactionHelper.unlockAccount(fromAddress, ''); + await rskTransactionHelper.unlockAccount(fromAddress); try { const source = fs.readFileSync(LIQUIDITY_BRIDGE_CONTRACT_FILE).toString(); @@ -52,7 +53,11 @@ const getLiquidityBridgeContract = async (host = null) => { if (!host.startsWith('http') && !host.startsWith('https')) { host = 'http://' + host; } - contractInstance.setProvider(host); + contractInstance = new ethers.Contract( + contractInstance.target, + contractInstance.interface, + new ethers.JsonRpcProvider(host) + ); } return contractInstance; @@ -60,9 +65,11 @@ const getLiquidityBridgeContract = async (host = null) => { const getDerivationHash = async (preHash, userBtcRefundAddress, liquidityProviderBtcAddress) => { let instance = await getLiquidityBridgeContract(); - let derivationHash = await instance.methods - .getDerivationHash(preHash, userBtcRefundAddress, liquidityProviderBtcAddress) - .call(); + let derivationHash = await instance.getDerivationHash( + preHash, + userBtcRefundAddress, + liquidityProviderBtcAddress + ); return derivationHash; }; diff --git a/lib/rsk-rpc-utils.js b/lib/rsk-rpc-utils.js new file mode 100644 index 00000000..0dd0e81b --- /dev/null +++ b/lib/rsk-rpc-utils.js @@ -0,0 +1,16 @@ +/** + * Calls the RSK-specific `rsk_getStorageBytesAt` JSON-RPC method, which reads raw storage bytes + * (as opposed to the single 32-byte word the standard `eth_getStorageAt` returns). + * @param {import('ethers').JsonRpcProvider} client + * @param {string} address the contract address to read storage from + * @param {string} storageIndex the storage index/key, as a 0x-prefixed hex string + * @param {string|number} blockNumber defaults to 'latest' + * @returns {Promise} the storage value, RLP-encoded as a 0x-prefixed hex string + */ +const getStorageBytesAt = (client, address, storageIndex, blockNumber = 'latest') => { + return client.send('rsk_getStorageBytesAt', [address, storageIndex, blockNumber]); +}; + +module.exports = { + getStorageBytesAt, +}; diff --git a/lib/rsk-tx-helper-provider.js b/lib/rsk-tx-helper-provider.js index 7a81c9a0..f06cf45c 100644 --- a/lib/rsk-tx-helper-provider.js +++ b/lib/rsk-tx-helper-provider.js @@ -1,5 +1,4 @@ -const { RskTransactionHelper } = require('rsk-transaction-helper'); -const { extendWeb3WithRskModule } = require('../lib/web3-utils'); +const { RskTransactionHelper } = require('@rsksmart/rootstock-transaction-helper'); /** * Creates and returns a list of RskTransactionHelper instances for each federate node @@ -8,11 +7,9 @@ const { extendWeb3WithRskModule } = require('../lib/web3-utils'); */ const getRskTransactionHelpers = (federates) => { federates = federates || Runners.hosts.federates; - const rskTransactionHelpers = federates.map((federate) => { - const rskTxHelper = getRskTransactionHelper(federate.host); - extendWeb3WithRskModule(rskTxHelper.getClient()); - return rskTxHelper; - }); + const rskTransactionHelpers = federates.map((federate) => + getRskTransactionHelper(federate.host) + ); return rskTransactionHelpers; }; @@ -23,12 +20,10 @@ const getRskTransactionHelpers = (federates) => { * @returns {RskTransactionHelper} */ const getRskTransactionHelper = (host, maxAttempts = 5) => { - const rskTransactionHelper = new RskTransactionHelper({ + return new RskTransactionHelper({ hostUrl: host || Runners.hosts.federate.host, maxAttempts, }); - extendWeb3WithRskModule(rskTransactionHelper.getClient()); - return rskTransactionHelper; }; module.exports = { diff --git a/lib/rsk-utils.js b/lib/rsk-utils.js index 439b687a..7aa40947 100644 --- a/lib/rsk-utils.js +++ b/lib/rsk-utils.js @@ -1,5 +1,5 @@ const expect = require('chai').expect; -const Web3 = require('web3'); +const { ethers } = require('ethers'); const { getBridgeState } = require('@rsksmart/bridge-state-data-parser'); const { getBridge } = require('./bridge-provider'); const BridgeTransactionParser = require('@rsksmart/bridge-transaction-parser'); @@ -42,7 +42,15 @@ import('@noble/secp256k1').then((secpModule) => { * @param {RskTransactionHelper} rskTxHelper * @returns {string} the RPC host url the rskTxHelper's client is connected to */ -const getRskHost = (rskTxHelper) => rskTxHelper.getClient().currentProvider.host; +const getRskHost = (rskTxHelper) => { + const hostUrl = rskTxHelper.rskConfig.hostUrl; + // `rskConfig.hostUrl` preserves whatever was originally passed in, which may be missing a + // protocol (`RskTransactionHelper` only normalizes it for its own internal ethers provider). + // Some consumers (e.g. `fetch`-based calls) need a fully-qualified URL, so normalize here too. + return hostUrl.startsWith('http://') || hostUrl.startsWith('https://') + ? hostUrl + : `http://${hostUrl}`; +}; /** * @@ -79,7 +87,7 @@ const waitForSync = async (rskTransactionHelpers) => { * It will reset the attempts counter every time the blockchain advances as least 1 block. * It will potentially try to find new blocks `maxAttempts` times for every block. * If the blockchain is at least advancing, we know that some time in the future the `blockNumber` will be reached, so no need to stop trying to find it. - * @param {Web3} rskClient web3 client to make calls to the rsk network. + * @param {import('ethers').JsonRpcProvider} rskClient client to make calls to the rsk network. * @param {Number} blockNumber min block height to wait for. * @param {Number} waitTime defaults to 500 milliseconds. Time to wait before checking for the block on every iteration. * @param {Number} maxAttempts defaults to 500 attempts by block. @@ -91,7 +99,7 @@ const waitForBlock = (rskClient, blockNumber, waitTime = 2000, maxAttempts = 500 let latestBlockNumber = -1; let maxAttemptsOnError = 5; const checkBlockNumber = () => { - rskClient.eth + rskClient .getBlockNumber() .then((newLatestBlockNumber) => { const expectedMinBlockHeightReached = newLatestBlockNumber >= blockNumber; @@ -171,25 +179,31 @@ const sendFromCow = async (rskTxHelper, recipientAddress, amountInWeis) => { const cowAddress = await rskTxHelper.newAccountWithSeed('cow'); const initialAddressBalanceInWeis = Number(await rskTxHelper.getBalance(recipientAddress)); - const txPromise = rskTxHelper.getClient().eth.sendTransaction({ + // `sendTransaction` resolves once the node accepts the tx into its mempool (same timing + // as web3's `transactionHash` event), so the tx is ready to be included in a block mined + // by this same node right after this call. + const txHash = await rskTxHelper.sendTransaction({ from: cowAddress, to: recipientAddress, value: amountInWeis, }); - // The node emits the tx hash once it accepts the tx into its mempool, so after this - // point the tx is ready to be included in a block mined by this same node. - await new Promise((resolve, reject) => { - txPromise.once('transactionHash', resolve); - txPromise.once('error', reject); - }); - await mineWithSubmitterAndSync(rskTxHelper); - await txPromise; - const finalBalance = await rskTxHelper.getBalance(recipientAddress); + const txReceipt = await rskTxHelper.getTxReceipt(txHash); + expect(txReceipt?.status, `Transfer from cow to ${recipientAddress} failed`).to.be.true; + expect( + txReceipt.to?.toLowerCase(), + `Transfer landed on an unexpected recipient: expected ${recipientAddress}, got ${txReceipt.to}` + ).to.equal(recipientAddress.toLowerCase()); + + // Read the balance pinned to the block the transfer was mined in, rather than an implicit + // "latest", in case "latest" doesn't yet reflect that block on whichever node is queried. + const finalBalance = Number( + await rskTxHelper.getClient().getBalance(recipientAddress, txReceipt.blockNumber) + ); - expect(Number(finalBalance)).to.equal(initialAddressBalanceInWeis + Number(amountInWeis)); + expect(finalBalance).to.equal(initialAddressBalanceInWeis + Number(amountInWeis)); }; /** @@ -199,9 +213,7 @@ const sendFromCow = async (rskTxHelper, recipientAddress, amountInWeis) => { const increaseBlockToNextPegoutHeight = async (rskTransactionHelpers) => { const rskTransactionHelper = rskTransactionHelpers[0]; const bridge = await getBridge(rskTransactionHelper.getClient()); - const nextPegoutCreationBlockNumber = await bridge.methods - .getNextPegoutCreationBlockNumber() - .call(); + const nextPegoutCreationBlockNumber = Number(await bridge.getNextPegoutCreationBlockNumber()); const currentBlockNumber = await getMaxBlockNumber(rskTransactionHelpers); const blocksNeededToReachHeight = nextPegoutCreationBlockNumber - currentBlockNumber; if (blocksNeededToReachHeight > 0) { @@ -226,7 +238,7 @@ const waitAndUpdateBridge = async ( // triggered by the `updateBridge` call below. const initialMempoolTxs = await getRskMempoolTransactionsToTheBridge(rskTxHelper, true); const initialUpdateCollectionsTxsCount = initialMempoolTxs.filter((tx) => - tx.input?.startsWith(BRIDGE_TX_TYPES.UPDATE_COLLECTIONS.methodSelector) + tx.data?.startsWith(BRIDGE_TX_TYPES.UPDATE_COLLECTIONS.methodSelector) ).length; await rskTxHelper.updateBridge(); @@ -249,10 +261,13 @@ const waitAndUpdateBridge = async ( * @returns {Promise} array of tx hashes in the mempool */ const getRskMempoolTransactionsToTheBridge = async (rskTxHelper, withTxsDecoded = false) => { - const mempoolBlock = await rskTxHelper.getClient().eth.getBlock('pending', withTxsDecoded); - const transactionsToTheBridge = mempoolBlock.transactions.filter( - (tx) => tx.to === BRIDGE_ADDRESS - ); + const mempoolBlock = await rskTxHelper.getClient().getBlock('pending', withTxsDecoded); + // `Block.transactions` is always an array of tx hashes; the full tx objects (`.to`, `.data`, etc.) + // requested via `withTxsDecoded` are only available through `prefetchedTransactions`. + const transactions = withTxsDecoded + ? mempoolBlock.prefetchedTransactions + : mempoolBlock.transactions; + const transactionsToTheBridge = transactions.filter((tx) => tx.to === BRIDGE_ADDRESS); return transactionsToTheBridge; }; @@ -296,7 +311,7 @@ const waitForRskMempoolToGetThisCountOfThisTxType = async ( ) => { const method = async () => { const mempoolTxs = await getRskMempoolTransactionsToTheBridge(rskTxHelper, true); - const txsToBridge = mempoolTxs.filter((tx) => tx.input?.startsWith(txType.methodSelector)); + const txsToBridge = mempoolTxs.filter((tx) => tx.data?.startsWith(txType.methodSelector)); if (txsToBridge.length >= expectedCount) { logger.debug( @@ -375,7 +390,7 @@ const waitForRskTxToBeInTheMempool = async ( checkEveryMilliseconds = 500 ) => { const method = async () => { - const tx = await rskTxHelper.getClient().eth.getTransaction(txHash); + const tx = await rskTxHelper.getClient().getTransaction(txHash); const isTxInTheMempool = tx && !tx?.blockNumber; @@ -584,62 +599,78 @@ const triggerRelease = async ( }; /** - * Calls the `method` as a `send` transaction and wait for the transaction receipt to be available. + * Calls `contract[methodName](...methodArgs)` as a signed transaction from `from` and waits for + * the transaction receipt to be available. * @param {RskTransactionHelper} rskTxHelper to make transactions to the rsk network - * @param {web3.eth.Contract.ContractSendMethod} method contract method to be invoked - * @param {string} from rsk address to send the transaction from + * @param {import('ethers').Contract} contract the contract to call the method on + * @param {string} methodName name of the contract method to invoke + * @param {Array} methodArgs arguments to invoke the method with + * @param {string} from rsk address to send the transaction from. Must be unlocked/imported on the node. * @param {number} valueInWeis amount in weis to be sent with the transaction * @param {number} gas to be used in the transaction. Defaults to 100000 - * @returns {Promise} txReceipt + * @returns {Promise} txReceipt */ -const sendTransaction = async (rskTxHelper, method, from, valueInWeis = 0, gas = 100000) => { - const txReceiptPromise = method.send({ from, value: valueInWeis, gas }); - - // Any path that exits before `return await txReceiptPromise` (tx-hash error, mempool - // RPC failure, fail-fast throw below) would otherwise leave its rejection unhandled. - // `.catch()` returns a new promise, so rejections still propagate to the caller on - // the awaited return below. - txReceiptPromise.catch(() => {}); - - // The node emits the tx hash once it accepts the tx. Wait for that specific tx to be - // in the submitter node's mempool before mining, since `method` may target any - // contract, not just the bridge. - const txHash = await new Promise((resolve, reject) => { - txReceiptPromise.once('transactionHash', resolve); - txReceiptPromise.once('error', reject); +const sendTransaction = async ( + rskTxHelper, + contract, + methodName, + methodArgs, + from, + valueInWeis = 0, + gas = 100000 +) => { + // `getSigner` returns a `JsonRpcSigner` that signs via the node's own unlocked-account + // keystore (`eth_sendTransaction`), the same semantics as the previous `from`-only sends. + const signer = await rskTxHelper.getClient().getSigner(from); + const txResponse = await contract.connect(signer)[methodName](...methodArgs, { + value: valueInWeis, + gasLimit: gas, }); // Fail fast instead of mining if the tx never reaches the mempool, using the same - // attempt budget as the previous generic mempool wait (10 attempts). - const isTxInTheMempool = await waitForRskTxToBeInTheMempool(rskTxHelper, txHash, 10); + // attempt budget as before (10 attempts). + const isTxInTheMempool = await waitForRskTxToBeInTheMempool(rskTxHelper, txResponse.hash, 10); if (!isTxInTheMempool) { throw new Error( - `The tx (${txHash}) was not found in the mempool nor mined in a block. It may have been rejected by the node.` + `The tx (${txResponse.hash}) was not found in the mempool nor mined in a block. It may have been rejected by the node.` ); } await mineWithSubmitterAndSync(rskTxHelper); - return await txReceiptPromise; + // Fetched (rather than `txResponse.wait()`'d) so the receipt has the same normalized shape + // (boolean `status`, `transactionHash`, plain-object `logs`) as `rskTxHelper.getTxReceipt()` + // elsewhere in this codebase. + return await rskTxHelper.getTxReceipt(txResponse.hash); }; /** - * Executes a method 'call' and calls the callback with the result of the call, then calls 'send' and waits for the transaction receipt to be available and returns it + * Executes `contract[methodName](...methodArgs)` as a static (dry-run) call from `from` and calls + * the callback with the result, then sends it as a real transaction and returns the receipt. * @param {RskTransactionHelper} rskTxHelper to make transactions to the rsk network - * @param {web3.eth.Contract.ContractSendMethod} method contract method to be invoked + * @param {import('ethers').Contract} contract the contract to call the method on + * @param {string} methodName name of the contract method to invoke + * @param {Array} methodArgs arguments to invoke the method with * @param {string} from rsk address to send the transaction from - * @param {function} checkCallback callback to check the result of the method 'call' before calling 'send' - * @returns {web3.eth.TransactionReceipt} txReceipt + * @param {function} checkCallback callback to check the result of the static call before sending + * @returns {Promise} txReceipt */ -const sendTxWithCheck = async (rskTxHelper, method, from, checkCallback) => { +const sendTxWithCheck = async ( + rskTxHelper, + contract, + methodName, + methodArgs, + from, + checkCallback +) => { if (!checkCallback) { throw new Error('`checkCallback` is required'); } - const callResult = await method.call({ from }); + const callResult = await contract[methodName].staticCall(...methodArgs, { from }); await checkCallback(callResult); - return await sendTransaction(rskTxHelper, method, from); + return await sendTransaction(rskTxHelper, contract, methodName, methodArgs, from); }; /** @@ -755,8 +786,8 @@ const getPegoutEventsInBlockRange = async ( }); }; -const findBridgeTransactionsInThisBlock = async (web3Client, blockHashOrBlockNumber) => { - const bridgeTxParser = new BridgeTransactionParser(web3Client); +const findBridgeTransactionsInThisBlock = async (rskClient, blockHashOrBlockNumber) => { + const bridgeTxParser = new BridgeTransactionParser(rskClient); return await bridgeTxParser.getBridgeTransactionsInThisBlock(blockHashOrBlockNumber); }; @@ -779,10 +810,10 @@ const getUnlockedAddress = async (rskTxHelper, privateKey, rskAddress) => { * @returns {Promise} */ const getFedsPubKeys = async (bridge) => { - const fedSize = await bridge.methods.getFederationSize().call(); + const fedSize = Number(await bridge.getFederationSize()); const FEDS_PUBKEYS_LIST = []; for (let i = 0; i < fedSize; i++) { - let fedPubKey = await bridge.methods.getFederatorPublicKeyOfType(i, 'btc').call(); + let fedPubKey = await bridge.getFederatorPublicKeyOfType(i, 'btc'); FEDS_PUBKEYS_LIST.push(removePrefix0x(fedPubKey)); } return FEDS_PUBKEYS_LIST; @@ -800,13 +831,15 @@ const voteFeePerKbChange = async ( feePerKbInSatoshis, expectedResponseCode = FEE_PER_KB_RESPONSE_CODES.SUCCESSFUL_VOTE ) => { - await rskTxHelper.getClient().eth.personal.importRawKey(FEE_PER_KB_CHANGER_PRIVATE_KEY, ''); - await rskTxHelper.getClient().eth.personal.unlockAccount(FEE_PER_KB_CHANGER_ADDRESS, ''); + await rskTxHelper.importAccount(FEE_PER_KB_CHANGER_PRIVATE_KEY); + await rskTxHelper.unlockAccount(FEE_PER_KB_CHANGER_ADDRESS); const bridge = await getBridge(rskTxHelper.getClient()); await sendTxWithCheck( rskTxHelper, - bridge.methods.voteFeePerKbChange(feePerKbInSatoshis), + bridge, + 'voteFeePerKbChange', + [feePerKbInSatoshis], FEE_PER_KB_CHANGER_ADDRESS, (result) => { expect(Number(result)).to.equal(expectedResponseCode); @@ -824,7 +857,7 @@ const setFeePerKb = async (rskTxHelper, feePerKbInSatoshis) => { await voteFeePerKbChange(rskTxHelper, feePerKbInSatoshis); const bridge = await getBridge(rskTxHelper.getClient()); - const finalFeePerKb = await bridge.methods.getFeePerKb().call(); + const finalFeePerKb = await bridge.getFeePerKb(); expect(Number(finalFeePerKb)).to.equal(Number(feePerKbInSatoshis)); }; @@ -832,9 +865,10 @@ const getNewFundedRskAddress = async ( rskTxHelper, fundingAmountInRbtc = DEFAULT_RSK_ADDRESS_FUNDING_IN_BTC ) => { - const address = await rskTxHelper.getClient().eth.personal.newAccount(''); + // No `RskTransactionHelper` v6 method creates an unseeded account, so this calls the raw RPC directly. + const address = await rskTxHelper.getClient().send('personal_newAccount', ['']); await sendFromCow(rskTxHelper, address, Number(ethToWeis(fundingAmountInRbtc))); - await rskTxHelper.getClient().eth.personal.unlockAccount(address, ''); + await rskTxHelper.unlockAccount(address); return address; }; @@ -884,7 +918,7 @@ const compressPublicKey = (uncompressedPublicKey) => { }; const keccak256 = (str) => { - return Web3.utils.keccak256(str); + return ethers.keccak256(str); }; const removeCompressionPrefix = (uncompressedPublicKey) => { @@ -924,69 +958,54 @@ const importAccounts = async (rskTxHelper, privateKeys) => { return importedAddresses; }; -const decodeLogs = (rskClient, txReceipt, contractAbi) => { - const eventSignatureMap = buildEventSignatureMap(rskClient, contractAbi); +const decodeLogs = (txReceipt, contractAbi) => { + const contractInterface = new ethers.Interface(contractAbi.flat()); const events = []; for (let log of txReceipt.logs) { if (log.topics.length === 0) { continue; } - const eventSignature = log.topics[0]; - const abiElement = eventSignatureMap[eventSignature]; - if (!abiElement) { + const parsedLog = contractInterface.parseLog(log); + if (!parsedLog) { continue; } - const event = decodeLog(rskClient, log, abiElement); - events.push(event); - } - return events; -}; - -const buildEventSignatureMap = (rskClient, contractAbi) => { - return contractAbi - .flat() - .filter((element) => element.type === 'event') - .reduce((acc, element) => { - const signature = rskClient.eth.abi.encodeEventSignature(element); - acc[signature] = element; - return acc; - }, {}); -}; -const decodeLog = (rskClient, log, abiElement) => { - const decodedLog = rskClient.eth.abi.decodeLog( - abiElement.inputs, - log.data, - log.topics.slice(1) - ); + const args = {}; + for (let input of parsedLog.fragment.inputs) { + args[input.name] = parsedLog.args[input.name]; + } - const args = {}; - for (let input of abiElement.inputs) { - args[input.name] = decodedLog[input.name]; + events.push({ + name: parsedLog.name, + signature: log.topics[0], + args: args, + }); } - - return { - name: abiElement.name, - signature: log.topics[0], - args: args, - }; + return events; }; -const assertContractCallFails = async (methodCall, options) => { - await expect(methodCall.call(options)).to.be.rejected; +/** + * Asserts that calling `contract[methodName](...methodArgs)` as a static (dry-run) call rejects. + * @param {import('ethers').Contract} contract the contract to call the method on + * @param {string} methodName name of the contract method to invoke + * @param {Array} methodArgs arguments to invoke the method with + * @param {object} options optional overrides (e.g. `{ from }`) for the static call + */ +const assertContractCallFails = async (contract, methodName, methodArgs, options) => { + const args = options ? [...methodArgs, options] : methodArgs; + await expect(contract[methodName].staticCall(...args)).to.be.rejected; }; const findEventInTx = async (rskTxHelper, txHash, eventName, contractAbi = []) => { - const rskClient = rskTxHelper.getClient(); // Fetch the transaction receipt to get all the logs (including the ones from internal txs) const txReceipt = await rskTxHelper.getTxReceipt(txHash); - const events = decodeLogs(rskClient, txReceipt, contractAbi); + const events = decodeLogs(txReceipt, contractAbi); return events.find((event) => event.name === eventName); }; const assertNoEventWasEmitted = async (txReceipt) => { - const isEmpty = Object.keys(txReceipt.events).length === 0; + const isEmpty = txReceipt.logs.length === 0; expect(isEmpty, 'No event should have been emitted').to.be.true; }; diff --git a/lib/sol-utils.js b/lib/sol-utils.js index 39a49721..70515974 100644 --- a/lib/sol-utils.js +++ b/lib/sol-utils.js @@ -1,4 +1,5 @@ let solc = require('solc'); +const { ethers } = require('ethers'); const { wait } = require('./utils'); const { mineAndSync } = require('./rsk-utils'); const { getRskTransactionHelpers } = require('../lib/rsk-tx-helper-provider'); @@ -72,19 +73,21 @@ const compileAndDeploy = async ( } const bytecode = '0x' + compiledContract.evm.bytecode.object; - const creationContract = new client.eth.Contract(compiledContract.abi); - const creationTx = creationContract.deploy({ data: bytecode, arguments: constructorArguments }); + const factory = new ethers.ContractFactory(compiledContract.abi, bytecode); + const deployTx = await factory.getDeployTransaction(...constructorArguments); + let estimateGas = Promise.resolve(options.gas); if (options.gas === 'estimate') { - estimateGas = creationTx.estimateGas(); + estimateGas = client.estimateGas({ ...deployTx, from: options.from }); } const gasNeeded = await estimateGas; - const contractPromise = creationTx.send({ - from: options.from, - gas: gasNeeded, + const signer = await client.getSigner(options.from); + const txResponsePromise = signer.sendTransaction({ + ...deployTx, + gasLimit: gasNeeded, gasPrice: options.gasPrice, }); @@ -92,9 +95,10 @@ const compileAndDeploy = async ( await options.mine(); - const contract = await contractPromise; + const txResponse = await txResponsePromise; + const txReceipt = await txResponse.wait(); - return contract; + return new ethers.Contract(txReceipt.contractAddress, compiledContract.abi, client); }; module.exports = { diff --git a/lib/tests/2wp.js b/lib/tests/2wp.js index 28dc248e..d1635762 100644 --- a/lib/tests/2wp.js +++ b/lib/tests/2wp.js @@ -1,5 +1,6 @@ const expect = require('chai').expect; const BN = require('bn.js'); +const { ethers } = require('ethers'); const { createPeginV1TxData } = require('pegin-address-verificator'); const { getBridge } = require('../bridge-provider'); const { getBtcClient } = require('../btc-client-provider'); @@ -49,6 +50,7 @@ const { getBridgeState } = require('@rsksmart/bridge-state-data-parser'); const bitcoinJsLib = require('bitcoinjs-lib'); const { deployCallReleaseBtcContract } = require('../contractDeployer'); const { decodeOutpointValues } = require('../varint'); +const precompiledAbis = require('@rsksmart/rsk-precompiled-abis'); let btcTxHelper; let rskTxHelpers; @@ -66,10 +68,8 @@ const execute = (description, fullExecution = false) => { rskTxHelper = rskTxHelpers[0]; bridge = await getBridge(rskTxHelper.getClient()); - federationAddress = await bridge.methods.getFederationAddress().call(); - minimumPeginValueInSatoshis = Number( - await bridge.methods.getMinimumLockTxValue().call() - ); + federationAddress = await bridge.getFederationAddress(); + minimumPeginValueInSatoshis = Number(await bridge.getMinimumLockTxValue()); btcFeeInSatoshis = Number(btcToSatoshis(await btcTxHelper.getFee())); }); @@ -453,7 +453,7 @@ const execute = (description, fullExecution = false) => { // The rejected_pegin event is emitted with the expected values const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); await assertExpectedRejectedPeginEventIsEmitted( btcPeginTxHash, @@ -912,7 +912,7 @@ const execute = (description, fullExecution = false) => { // The rejected_pegin and released_requested events are emitted with the expected values const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); await assertExpectedRejectedPeginEventIsEmitted( btcPeginTxHash, @@ -1077,7 +1077,7 @@ const execute = (description, fullExecution = false) => { // The rejected_pegin and released_requested events are emitted with the expected values const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); await assertExpectedRejectedPeginEventIsEmitted( btcPeginTxHash, @@ -1155,7 +1155,7 @@ const execute = (description, fullExecution = false) => { // The rejected_pegin and released_requested events are emitted with the expected values const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); await assertExpectedRejectedPeginEventIsEmitted( btcPeginTxHash, @@ -1425,7 +1425,7 @@ const execute = (description, fullExecution = false) => { ); const pegoutValueInSatoshis = MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS; - const initialFeePerKb = Number(await bridge.methods.getFeePerKb().call()); + const initialFeePerKb = Number(await bridge.getFeePerKb()); // We just need a feePerKB that will cause the pegout to be rejected due to the FEE_ABOVE_VALUE reason. // This value is much larger than what we need, but the calculation is complex and based on estimation, so we cannot know for sure. // That's why we use a big enough value. MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS is perfect for this case. @@ -1489,16 +1489,16 @@ const execute = (description, fullExecution = false) => { const initialRskSenderBalanceInWeisBN = await rskTxHelper.getBalance(creatorAddress); const initialContractBalanceInWeisBN = await rskTxHelper.getBalance( - callReleaseBtcContract.options.address + callReleaseBtcContract.target ); // Act - const callBridgeReleaseBtcMethod = - callReleaseBtcContract.methods.callBridgeReleaseBtc(); const contractCallTxReceipt = await sendTransaction( rskTxHelper, - callBridgeReleaseBtcMethod, + callReleaseBtcContract, + 'callBridgeReleaseBtc', + [], creatorAddress, satoshisToWeis(pegoutValueInSatoshis) ); @@ -1507,9 +1507,9 @@ const execute = (description, fullExecution = false) => { const expectedPegoutValue = satoshisToWeis(pegoutValueInSatoshis); - const contractAddressChecksummed = rskTxHelper - .getClient() - .utils.toChecksumAddress(ensure0x(callReleaseBtcContract.options.address)); + const contractAddressChecksummed = ethers.getAddress( + ensure0x(callReleaseBtcContract.target) + ); const expectedEvent = createExpectedReleaseRequestRejectedEvent( contractAddressChecksummed, expectedPegoutValue, @@ -1534,7 +1534,7 @@ const execute = (description, fullExecution = false) => { // The contract balance should be the same as the initial balance since the contract is not paying for the pegout const finalContractBalanceInWeisBN = await rskTxHelper.getBalance( - callReleaseBtcContract.options.address + callReleaseBtcContract.target ); expect(finalContractBalanceInWeisBN.eq(initialContractBalanceInWeisBN)).to.be.true; }); @@ -1777,11 +1777,9 @@ const execute = (description, fullExecution = false) => { ); // The release_request_received event of the first pegout request - const rskSender1Address = rskTxHelper - .getClient() - .utils.toChecksumAddress( - ensure0x(senderRecipientInfo1.rskRecipientRskAddressInfo.address) - ); + const rskSender1Address = ethers.getAddress( + ensure0x(senderRecipientInfo1.rskRecipientRskAddressInfo.address) + ); const releaseRequestReceivedEvent1 = pegoutsEvents.find( (event) => event.arguments.sender === rskSender1Address ); @@ -1794,11 +1792,9 @@ const execute = (description, fullExecution = false) => { ); // The release_request_received event of the second pegout request - const rskSender2Address = rskTxHelper - .getClient() - .utils.toChecksumAddress( - ensure0x(senderRecipientInfo2.rskRecipientRskAddressInfo.address) - ); + const rskSender2Address = ethers.getAddress( + ensure0x(senderRecipientInfo2.rskRecipientRskAddressInfo.address) + ); const releaseRequestReceivedEvent2 = pegoutsEvents.find( (event) => event.arguments.sender === rskSender2Address ); @@ -1811,11 +1807,9 @@ const execute = (description, fullExecution = false) => { ); // The release_request_received event of the third pegout request - const rskSender3Address = rskTxHelper - .getClient() - .utils.toChecksumAddress( - ensure0x(senderRecipientInfo3.rskRecipientRskAddressInfo.address) - ); + const rskSender3Address = ethers.getAddress( + ensure0x(senderRecipientInfo3.rskRecipientRskAddressInfo.address) + ); const releaseRequestReceivedEvent3 = pegoutsEvents.find( (event) => event.arguments.sender === rskSender3Address ); @@ -1936,9 +1930,7 @@ const assertExpectedPeginBtcEventIsEmitted = async ( peginValueInSatoshis, expectedPeginProtocolVersion = '0' ) => { - const recipient1RskAddressChecksumed = rskTxHelper - .getClient() - .utils.toChecksumAddress(ensure0x(rskRecipientAddress)); + const recipient1RskAddressChecksumed = ethers.getAddress(ensure0x(rskRecipientAddress)); const expectedEvent = createExpectedPeginBtcEvent( recipient1RskAddressChecksumed, btcPeginTxHash, @@ -1946,7 +1938,7 @@ const assertExpectedPeginBtcEventIsEmitted = async ( expectedPeginProtocolVersion ); const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); const peginBtcEvent = await findEventInBlock( rskTxHelper, @@ -2027,12 +2019,10 @@ const assert2wpBalancesPeginRejectedNoRefund = async (initial2wpBalances, peginV }; const assertPeginTxHashNotProcessed = async (btcPeginTxHash) => { - const isBtcTxHashAlreadyProcessed = await bridge.methods - .isBtcTxHashAlreadyProcessed(btcPeginTxHash) - .call(); + const isBtcTxHashAlreadyProcessed = await bridge.isBtcTxHashAlreadyProcessed(btcPeginTxHash); expect(isBtcTxHashAlreadyProcessed).to.be.false; const btcTxHashProcessedHeight = Number( - await bridge.methods.getBtcTxHashProcessedHeight(btcPeginTxHash).call() + await bridge.getBtcTxHashProcessedHeight(btcPeginTxHash) ); expect(btcTxHashProcessedHeight).to.be.equal(-1); }; @@ -2065,9 +2055,7 @@ const assert2wpBalancesAfterPegoutFromContract = async ( }; const assertBtcPeginTxHashProcessed = async (btcPeginTxHash) => { - const isBtcTxHashAlreadyProcessed = await bridge.methods - .isBtcTxHashAlreadyProcessed(btcPeginTxHash) - .call(); + const isBtcTxHashAlreadyProcessed = await bridge.isBtcTxHashAlreadyProcessed(btcPeginTxHash); expect(isBtcTxHashAlreadyProcessed).to.be.true; }; @@ -2149,9 +2137,9 @@ const assertSuccessfulPegoutEventsAreEmitted = async ( const btcTransaction = bitcoinJsLib.Transaction.fromHex( pegoutWaitingForConfirmationWhenPegoutWasCreated.btcRawTx ); - const rskSenderAddress = rskTxHelper - .getClient() - .utils.toChecksumAddress(ensure0x(senderRecipientInfo.rskRecipientRskAddressInfo.address)); + const rskSenderAddress = ethers.getAddress( + ensure0x(senderRecipientInfo.rskRecipientRskAddressInfo.address) + ); // release_request_received event const releaseRequestReceivedEvent = pegoutsEvents[0]; @@ -2265,9 +2253,7 @@ const assertExpectedReleaseRequestRejectedEventIsEmitted = async ( expectedPegoutValue, rejectionReason ) => { - const rskSenderAddressChecksummed = rskTxHelper - .getClient() - .utils.toChecksumAddress(ensure0x(rskSenderAddress)); + const rskSenderAddressChecksummed = ethers.getAddress(ensure0x(rskSenderAddress)); const expectedEvent = createExpectedReleaseRequestRejectedEvent( rskSenderAddressChecksummed, expectedPegoutValue, @@ -2282,9 +2268,10 @@ const assertExpectedReleaseRequestRejectedEventIsEmitted = async ( const getReleaseRequestRejectedEventFromContractCallTxReceipt = (contractCallTxReceipt) => { const bridgeTxParser = new BridgeTransactionParser(rskTxHelper.getClient()); - const logData = contractCallTxReceipt.events['0'].raw; - const releaseRequestRejectedAbiElement = - bridgeTxParser.jsonInterfaceMap[PEGOUT_EVENTS.RELEASE_REQUEST_REJECTED.signature]; + const logData = contractCallTxReceipt.logs[0]; + const releaseRequestRejectedAbiElement = precompiledAbis.bridge.abi.find( + (item) => item.type === 'event' && item.name === PEGOUT_EVENTS.RELEASE_REQUEST_REJECTED.name + ); const releaseRequestRejectedEvent = bridgeTxParser.decodeLog( logData, releaseRequestRejectedAbiElement diff --git a/lib/tests/bridge-calls.js b/lib/tests/bridge-calls.js index 1bdc770e..310062e2 100644 --- a/lib/tests/bridge-calls.js +++ b/lib/tests/bridge-calls.js @@ -25,13 +25,14 @@ const execute = (description, getRskHost, bridgeCallsAllowed) => { before(async () => { rskTransactionHelper = getRskTransactionHelper(getRskHost()); rskClient = rskTransactionHelper.getClient(); - address = await rskClient.eth.personal.newAccount(''); + // No `RskTransactionHelper` v6 method creates an unseeded account, so this calls the raw RPC directly. + address = await rskClient.send('personal_newAccount', ['']); await rskUtils.sendFromCow( rskTransactionHelper, address, Number(btcEthUnitConverter.btcToWeis(INITIAL_RSK_BALANCE_IN_BTC)) ); - await rskClient.eth.personal.unlockAccount(address, ''); + await rskTransactionHelper.unlockAccount(address); }); it('should create the testing contract', async () => { @@ -49,7 +50,7 @@ const execute = (description, getRskHost, bridgeCallsAllowed) => { } ); - const areYouAliveResult = await contractCallsTester.methods.areYouAlive().call(); + const areYouAliveResult = await contractCallsTester.areYouAlive(); expect(areYouAliveResult).to.equal('yes i am'); } catch (err) { throw new CustomError('Contract creation failure', err); @@ -81,23 +82,24 @@ const testMethod = (bridgeCallsAllowed) => (methodSignature, args, expectedWhenF const methodName = methodSignature.substr(0, pos); describe(methodName, () => { - let bridgeMethod; + let bridge; let abi; before(async () => { - const bridge = await getBridge(rskClient); - bridgeMethod = bridge.methods[methodName].apply(null, args); - abi = bridgeMethod.encodeABI(); + bridge = await getBridge(rskClient); + abi = bridge.interface.encodeFunctionData(methodName, args); }); it('normal call works', async () => { try { - const result = await bridgeMethod.call(); + const result = await bridge[methodName](...args); if (expectedWhenFail === null) { expect(result).to.not.be.null; } else { - expect(result).to.not.equal(expectedWhenFail); + // `result` may be a bigint/other non-string type; stringify to compare + // against the string sentinel values above (e.g. '0'). + expect(String(result)).to.not.equal(expectedWhenFail); } } catch (err) { throw new CustomError('Normal call failure', err); @@ -105,7 +107,7 @@ const testMethod = (bridgeCallsAllowed) => (methodSignature, args, expectedWhenF }); it(`contract calls allowed`, async () => { - const success = await contractCallsTester.methods.doCall(abi).call(); + const success = await contractCallsTester.doCall(abi); expect(success).to.be.true; }); }); diff --git a/lib/tests/call_receive_header.js b/lib/tests/call_receive_header.js index 13826e8f..a2a34400 100644 --- a/lib/tests/call_receive_header.js +++ b/lib/tests/call_receive_header.js @@ -28,27 +28,29 @@ const execute = (description) => { const blockHashes = await btcTxHelper.mine(); const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); - const blockchainInitialHeigth = await bridge.methods - .getBtcBlockchainBestChainHeight() - .call(); + const blockchainInitialHeigth = await bridge.getBtcBlockchainBestChainHeight(); - const receiveHeaderMethodCall = bridge.methods.receiveHeader(ensure0x(blockHeader)); const checkCallback = (result) => { expect(Number(result)).to.be.equal(HEADER_RECEIVED_OK); }; - await sendTxWithCheck(rskTxHelper, receiveHeaderMethodCall, cowAddress, checkCallback); + await sendTxWithCheck( + rskTxHelper, + bridge, + 'receiveHeader', + [ensure0x(blockHeader)], + cowAddress, + checkCallback + ); - const blockchainFinalHeight = await bridge.methods - .getBtcBlockchainBestChainHeight() - .call(); + const blockchainFinalHeight = await bridge.getBtcBlockchainBestChainHeight(); expect(Number(blockchainFinalHeight)).to.be.equal(Number(blockchainInitialHeigth) + 1); }); it('should return -1 when calling receiveHeader method consecutively within 5 minutes', async () => { const blockHashes = await btcTxHelper.mine(); const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); - const result = await bridge.methods.receiveHeader(ensure0x(blockHeader)).call(); + const result = await bridge.receiveHeader.staticCall(ensure0x(blockHeader)); expect(Number(result)).to.be.equal(RECEIVE_HEADER_CALLED_TOO_SOON); }); }); diff --git a/lib/tests/call_receive_headers.js b/lib/tests/call_receive_headers.js index 9bfa1f31..93184877 100644 --- a/lib/tests/call_receive_headers.js +++ b/lib/tests/call_receive_headers.js @@ -19,20 +19,24 @@ const execute = (description, getRskHost) => { const bridge = await getBridge(rskTxHelper.getClient()); await waitAndUpdateBridge(rskTxHelper); - const blockNumberInitial = await bridge.methods - .getBtcBlockchainBestChainHeight() - .call(); + const blockNumberInitial = await bridge.getBtcBlockchainBestChainHeight(); const cowAddress = await rskTxHelper.newAccountWithSeed('cow'); const blockHashes = await btcTxHelper.mine(); const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); - const receiveHeadersMethodCall = bridge.methods.receiveHeaders([ensure0x(blockHeader)]); const checkCallback = (result) => { expect(result).to.be.empty; }; - await sendTxWithCheck(rskTxHelper, receiveHeadersMethodCall, cowAddress, checkCallback); + await sendTxWithCheck( + rskTxHelper, + bridge, + 'receiveHeaders', + [[ensure0x(blockHeader)]], + cowAddress, + checkCallback + ); - const blockNumberFinal = await bridge.methods.getBtcBlockchainBestChainHeight().call(); + const blockNumberFinal = await bridge.getBtcBlockchainBestChainHeight(); expect(blockNumberInitial).to.be.equal(blockNumberFinal); }); }); diff --git a/lib/tests/change-federation.js b/lib/tests/change-federation.js index 8954b35a..50c1cdfd 100644 --- a/lib/tests/change-federation.js +++ b/lib/tests/change-federation.js @@ -76,6 +76,23 @@ const { HSM_DIFFICULTY_TARGET, isRunningHsms, } = require('../federators-utils'); +const { getStorageBytesAt } = require('../rsk-rpc-utils'); + +/** + * Calls `contract[methodName](...args)` as a static (read) call, treating an ethers `BAD_DATA` + * decode failure (the node returning empty `0x` for an unset `bytes` value) as `null`, matching + * the previous web3 behavior for these same calls. + */ +const callOrNullIfEmpty = async (contract, methodName, ...args) => { + try { + return await contract[methodName](...args); + } catch (error) { + if (error.code === 'BAD_DATA' && error.value === '0x') { + return null; + } + throw error; + } +}; const parseBtcPublicKeys = (btcPublicKeysInString) => { const publicKeyLengthWithoutOxPrefix = 66; @@ -214,9 +231,7 @@ const execute = (description, newFederationConfig, fullExecution = false) => { initialActiveFederationInfo = await getActiveFederationInfo(bridge); - minimumPeginValueInSatoshis = Number( - await bridge.methods.getMinimumLockTxValue().call() - ); + minimumPeginValueInSatoshis = Number(await bridge.getMinimumLockTxValue()); const bridgeState = await getBridgeState(rskUtils.getRskHost(rskTxHelper)); @@ -253,53 +268,62 @@ const execute = (description, newFederationConfig, fullExecution = false) => { if (fullExecution) { it('should not be able to call `createFederation` without authorization', async () => { // Ensuring no pending federation exists yet. - const pendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const pendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedPendingFederationSize = -1; expect(pendingFederationSize).to.be.equal( expectedPendingFederationSize, 'No pending federation should exist yet.' ); - const createFederationMethod = await bridge.methods.createFederation(); - const message = 'The `createFederation` method should not be callable by an unauthorized address.'; // First unauthorized create federation call await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], notAuthorized1Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Second unauthorized create federation call await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], notAuthorized2Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Third unauthorized create federation call await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], notAuthorized3Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); - const actualPendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const actualPendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedFederationSize = -1; @@ -341,24 +365,23 @@ const execute = (description, newFederationConfig, fullExecution = false) => { 'The block number of the commit federation event should be the same as the latest block number.' ); - const pendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const pendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedPendingFederationSize = -1; expect(pendingFederationSize).to.be.equal( expectedPendingFederationSize, 'The pending federation should be reverted after the validation period.' ); - const pendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const pendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(pendingFederationHash).to.be.equal( null, 'The pending federation hash should be null after the validation period.' ); - const activeFederationAddress = await bridge.methods.getFederationAddress().call(); + const activeFederationAddress = await bridge.getFederationAddress(); expect(activeFederationAddress).to.be.equal( initialActiveFederationInfo.address, @@ -381,21 +404,22 @@ const execute = (description, newFederationConfig, fullExecution = false) => { if (fullExecution) { it('should not create a new pending federation when there is one already created', async () => { - const initialPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); - - const createFederationMethod = await bridge.methods.createFederation(); + const initialPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); const message = 'The `createFederation` method should not be callable when there is a pending federation.'; await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer1Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PENDING_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); @@ -403,10 +427,12 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer2Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PENDING_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); @@ -414,19 +440,22 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer3Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PENDING_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(initialPendingFederationHash).to.be.equal( finalPendingFederationHash, 'The pending federation hash should not change when calling `createFederation` if there is a pending federation already.' @@ -434,19 +463,19 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }); it('should not be able to call `addFederatorPublicKeyMultikey` without authorization', async () => { - const initialPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const initialPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); const randomFedPublicKey = '0x03445e8ead0cd796cec8204f1ce43c353062280dacd77b2a703b4ff5df17729767'; - const addFederatorPublicKeyMultikeyMethod = - bridge.methods.addFederatorPublicKeyMultikey( - randomFedPublicKey, - randomFedPublicKey, - randomFedPublicKey - ); + const addFederatorPublicKeyMultikeyArgs = [ + randomFedPublicKey, + randomFedPublicKey, + randomFedPublicKey, + ]; const message = 'The `addFederatorPublicKeyMultikey` method should not be callable by an unauthorized address.'; @@ -454,36 +483,52 @@ const execute = (description, newFederationConfig, fullExecution = false) => { // First unauthorized add federator public key call await rskUtils.sendTxWithCheck( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, notAuthorized1Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Second unauthorized add federator public key call await rskUtils.sendTxWithCheck( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, notAuthorized2Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Third unauthorized add federator public key call await rskUtils.sendTxWithCheck( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, notAuthorized3Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(initialPendingFederationHash).to.be.equal( finalPendingFederationHash, 'The pending federation hash should not change if the method is called by unauthorized addresses.' @@ -491,12 +536,10 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }); it('should not be able to call `commitFederation` without authorization', async () => { - const pendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); - - const commitFederationMethod = - await bridge.methods.commitFederation(pendingFederationHash); + const pendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); const message = 'The `commitFederation` method should not be callable by an unauthorized address.'; @@ -504,30 +547,45 @@ const execute = (description, newFederationConfig, fullExecution = false) => { // First unauthorized commit federation call await rskUtils.sendTxWithCheck( rskTxHelper, - commitFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], notAuthorized1Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Second unauthorized commit federation call await rskUtils.sendTxWithCheck( rskTxHelper, - commitFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], notAuthorized2Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Third unauthorized commit federation call const commitFederationTransactionReceipt = await rskUtils.sendTxWithCheck( rskTxHelper, - commitFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], notAuthorized3Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); @@ -544,9 +602,10 @@ const execute = (description, newFederationConfig, fullExecution = false) => { 'The commit federation event should not be emitted.' ).to.be.false; - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(pendingFederationHash).to.be.equal( finalPendingFederationHash, 'The pending federation hash should not change if the method is called by unauthorized addresses.' @@ -554,11 +613,10 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }); it('should not be able to call `rollbackFederation` without authorization', async () => { - const pendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); - - const rollbackFederationMethod = await bridge.methods.rollbackFederation(); + const pendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); const message = 'The `rollbackFederation` method should not be callable by an unauthorized address.'; @@ -566,36 +624,52 @@ const execute = (description, newFederationConfig, fullExecution = false) => { // First unauthorized rollback federation call await rskUtils.sendTxWithCheck( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], notAuthorized1Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Second unauthorized rollback federation call await rskUtils.sendTxWithCheck( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], notAuthorized2Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); // Third unauthorized rollback federation call await rskUtils.sendTxWithCheck( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], notAuthorized3Address, (result) => { - expect(result).to.be.equal(EXPECTED_UNSUCCESSFUL_RESULT, message); + expect(result.toString()).to.be.equal( + EXPECTED_UNSUCCESSFUL_RESULT, + message + ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(pendingFederationHash).to.be.equal( finalPendingFederationHash, 'The pending federation hash should not change if the method is called by unauthorized addresses.' @@ -609,23 +683,24 @@ const execute = (description, newFederationConfig, fullExecution = false) => { if (fullExecution) { it('should not create a new pending federation when there is a proposed federation', async () => { - const initialPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const initialPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(initialPendingFederationHash, 'The pending federation hash should be null.') .to.be.null; - const createFederationMethod = await bridge.methods.createFederation(); - const message = 'The `createFederation` method should not be callable when there is a proposed federation.'; await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer1Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PROPOSED_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); @@ -633,10 +708,12 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer2Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PROPOSED_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); @@ -644,19 +721,22 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer3Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( PROPOSED_FEDERATION_ALREADY_EXISTS_ERROR_CODE, message ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(finalPendingFederationHash, 'The pending federation hash should be null.').to .be.null; }); @@ -724,9 +804,7 @@ const execute = (description, newFederationConfig, fullExecution = false) => { 'The SVP fund transaction should have 3 outputs.' ); - const proposedFederationAddress = await bridge.methods - .getProposedFederationAddress() - .call(); + const proposedFederationAddress = await bridge.getProposedFederationAddress(); // The output addresses should be in the expected order. const proposedFederationOutput = svpFundTransaction.outs[0]; @@ -864,9 +942,8 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); const transactionId = releaseBtcTransaction.getId(); - const isBtcTxHashAlreadyProcessed = await bridge.methods - .isBtcTxHashAlreadyProcessed(transactionId) - .call(); + const isBtcTxHashAlreadyProcessed = + await bridge.isBtcTxHashAlreadyProcessed(transactionId); expect( isBtcTxHashAlreadyProcessed, @@ -945,9 +1022,9 @@ const execute = (description, newFederationConfig, fullExecution = false) => { let svpSpendTxRegistered = false; for (let cycle = 0; cycle < maxRegistrationCycles && !svpSpendTxRegistered; cycle++) { await rskUtils.waitAndUpdateBridge(rskTxHelper); - svpSpendTxRegistered = await bridge.methods - .isBtcTxHashAlreadyProcessed(svpSpendBtcTransaction.getId()) - .call(); + svpSpendTxRegistered = await bridge.isBtcTxHashAlreadyProcessed( + svpSpendBtcTransaction.getId() + ); } const destinationAddress = bitcoinJsLib.address.fromOutputScript( @@ -973,23 +1050,24 @@ const execute = (description, newFederationConfig, fullExecution = false) => { if (fullExecution) { it('should not create a new pending federation when there is a federation waiting for activation', async () => { - const initialPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const initialPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(initialPendingFederationHash, 'The pending federation hash should be null.') .to.be.null; - const createFederationMethod = await bridge.methods.createFederation(); - const message = 'The `createFederation` method should not be callable when there is a federation waiting for activation.'; await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer1Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( EXISTING_FEDERATION_AWAITING_ACTIVATION_ERROR_CODE, message ); @@ -997,10 +1075,12 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer2Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( EXISTING_FEDERATION_AWAITING_ACTIVATION_ERROR_CODE, message ); @@ -1008,19 +1088,22 @@ const execute = (description, newFederationConfig, fullExecution = false) => { ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer3Address, (result) => { - expect(result).to.be.equal( + expect(result.toString()).to.be.equal( EXISTING_FEDERATION_AWAITING_ACTIVATION_ERROR_CODE, message ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(finalPendingFederationHash, 'The pending federation hash should be null.').to .be.null; }); @@ -1030,15 +1113,13 @@ const execute = (description, newFederationConfig, fullExecution = false) => { const federationActivationBlockNumber = commitFederationCreationBlockNumber + FEDERATION_ACTIVATION_AGE; - const currentBlockNumber = await rskTxHelper.getClient().eth.getBlockNumber(); + const currentBlockNumber = await rskTxHelper.getClient().getBlockNumber(); const blockDifference = federationActivationBlockNumber - currentBlockNumber; // Mining enough blocks to activate the federation. await rskUtils.mineAndSync(rskTxHelpers, blockDifference + 1); // Assert the pending federation does not exist anymore. - const actualPendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const actualPendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedFederationSize = -1; expect(actualPendingFederationSize).to.be.equal( expectedFederationSize, @@ -1047,7 +1128,7 @@ const execute = (description, newFederationConfig, fullExecution = false) => { // Assert the active federation redeem script is the expected ones. const newActiveFederationErpRedeemScript = removePrefix0x( - await bridge.methods.getActivePowpegRedeemScript().call() + await bridge.getActivePowpegRedeemScript() ); expect(newActiveFederationErpRedeemScript).to.be.equal( expectedNewFederationErpRedeemScript, @@ -1074,17 +1155,13 @@ const execute = (description, newFederationConfig, fullExecution = false) => { 'The new active federation creation time should be the same as the proposed federation creation time.' ); - const retiringFederationSize = Number( - await bridge.methods.getRetiringFederationSize().call() - ); + const retiringFederationSize = Number(await bridge.getRetiringFederationSize()); expect(retiringFederationSize).to.be.equal( initialFederationPublicKeys.length, 'The retiring federation size should be the same as the initial federation size.' ); - const retiringFederationAddress = await bridge.methods - .getRetiringFederationAddress() - .call(); + const retiringFederationAddress = await bridge.getRetiringFederationAddress(); expect(retiringFederationAddress).to.be.equal( initialActiveFederationInfo.address, 'The retiring federation address should be the initial federation address.' @@ -1232,9 +1309,11 @@ const execute = (description, newFederationConfig, fullExecution = false) => { 'No pegout should be waiting for signatures.' ); - const oldUtxosRlpEncoded = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, oldFederationBtcUTXOSStorageIndex); + const oldUtxosRlpEncoded = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + oldFederationBtcUTXOSStorageIndex + ); const oldFederationUtxos = parseRLPToActiveFederationUtxos(oldUtxosRlpEncoded); // Mining to activate the migration age @@ -1371,45 +1450,60 @@ const execute = (description, newFederationConfig, fullExecution = false) => { if (fullExecution) { it('should not create a new pending federation when there is a retiring federation', async () => { - const initialPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const initialPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(initialPendingFederationHash, 'The pending federation hash should be null.') .to.be.null; - const createFederationMethod = await bridge.methods.createFederation(); - const message = 'The `createFederation` method should not be callable when there is a retiring federation.'; await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer1Address, (result) => { - expect(result).to.be.equal(RETIRING_FEDERATION_ALREADY_EXISTS, message); + expect(result.toString()).to.be.equal( + RETIRING_FEDERATION_ALREADY_EXISTS, + message + ); } ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer2Address, (result) => { - expect(result).to.be.equal(RETIRING_FEDERATION_ALREADY_EXISTS, message); + expect(result.toString()).to.be.equal( + RETIRING_FEDERATION_ALREADY_EXISTS, + message + ); } ); await rskUtils.sendTxWithCheck( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer3Address, (result) => { - expect(result).to.be.equal(RETIRING_FEDERATION_ALREADY_EXISTS, message); + expect(result.toString()).to.be.equal( + RETIRING_FEDERATION_ALREADY_EXISTS, + message + ); } ); - const finalPendingFederationHash = await bridge.methods - .getPendingFederationHash() - .call(); + const finalPendingFederationHash = await callOrNullIfEmpty( + bridge, + 'getPendingFederationHash' + ); expect(finalPendingFederationHash, 'The pending federation hash should be null.').to .be.null; }); @@ -1463,7 +1557,10 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }); it('should allow every new federation member to call updateCollections', async () => { - const updateCollectionsData = bridge.methods.updateCollections().encodeABI(); + const updateCollectionsData = bridge.interface.encodeFunctionData( + 'updateCollections', + [] + ); // Only the new federation members remain running at this point. const federates = Runners.hosts.federates; @@ -1481,20 +1578,18 @@ const execute = (description, newFederationConfig, fullExecution = false) => { // same node. await rskUtils.waitAndUpdateBridge(fedTxHelper); - const latestBlock = await fedTxHelper.getClient().eth.getBlock('latest', true); - const updateCollectionsTx = latestBlock.transactions.find( + const latestBlock = await fedTxHelper.getClient().getBlock('latest', true); + const updateCollectionsTx = latestBlock.prefetchedTransactions.find( (tx) => tx.from.toLowerCase() === fedRskAddress.toLowerCase() && - tx.input === updateCollectionsData + tx.data === updateCollectionsData ); expect( updateCollectionsTx, `The updateCollections tx from the federate at ${federates[i].host} was not mined.` ).to.not.be.undefined; - const receipt = await fedTxHelper - .getClient() - .eth.getTransactionReceipt(updateCollectionsTx.hash); + const receipt = await fedTxHelper.getTxReceipt(updateCollectionsTx.hash); expect( receipt && receipt.status, `Federate at ${federates[i].host} was not able to call updateCollections with its own key.` @@ -1518,41 +1613,41 @@ const execute = (description, newFederationConfig, fullExecution = false) => { const createPendingFederation = async () => { // Ensuring no pending federation exists yet. - const pendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const pendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedPendingFederationSize = -1; expect(pendingFederationSize).to.be.equal( expectedPendingFederationSize, 'No pending federation should exist yet.' ); - const createFederationMethod = await bridge.methods.createFederation(); - // First create federation vote await rskUtils.sendTransaction( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer1Address ); // Second create federation vote await rskUtils.sendTransaction( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer2Address ); // Third and final create federation vote await rskUtils.sendTransaction( rskTxHelper, - createFederationMethod, + bridge, + 'createFederation', + [], fedChangeAuthorizer3Address ); - const actualPendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const actualPendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedFederationSize = 0; @@ -1564,40 +1659,43 @@ const execute = (description, newFederationConfig, fullExecution = false) => { const addFederatorsPublicKeys = async () => { for (const federatorPublicKeysObj of newFederationPublicKeys) { - const addFederatorPublicKeyMultikeyMethod = - bridge.methods.addFederatorPublicKeyMultikey( - federatorPublicKeysObj[KEY_TYPE_BTC], - federatorPublicKeysObj[KEY_TYPE_RSK], - federatorPublicKeysObj[KEY_TYPE_MST] - ); + const addFederatorPublicKeyMultikeyArgs = [ + federatorPublicKeysObj[KEY_TYPE_BTC], + federatorPublicKeysObj[KEY_TYPE_RSK], + federatorPublicKeysObj[KEY_TYPE_MST], + ]; // First add federator public key vote await rskUtils.sendTransaction( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, fedChangeAuthorizer1Address ); // Second add federator public key vote await rskUtils.sendTransaction( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, fedChangeAuthorizer2Address ); // Third and final add federator public key vote await rskUtils.sendTransaction( rskTxHelper, - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + addFederatorPublicKeyMultikeyArgs, fedChangeAuthorizer3Address ); } const expectedPendingFederationSize = newFederationPublicKeys.length; - const actualPendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const actualPendingFederationSize = Number(await bridge.getPendingFederationSize()); expect(actualPendingFederationSize).to.be.equal( expectedPendingFederationSize, @@ -1606,32 +1704,34 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }; const rollbackFederation = async () => { - const rollbackFederationMethod = await bridge.methods.rollbackFederation(); - // First rollback federation vote await rskUtils.sendTransaction( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], fedChangeAuthorizer1Address ); // Second rollback federation vote await rskUtils.sendTransaction( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], fedChangeAuthorizer2Address ); // Third and final rollback federation vote await rskUtils.sendTransaction( rskTxHelper, - rollbackFederationMethod, + bridge, + 'rollbackFederation', + [], fedChangeAuthorizer3Address ); - const actualPendingFederationSize = Number( - await bridge.methods.getPendingFederationSize().call() - ); + const actualPendingFederationSize = Number(await bridge.getPendingFederationSize()); const expectedFederationSize = -1; expect(actualPendingFederationSize).to.be.equal( expectedFederationSize, @@ -1640,29 +1740,32 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }; const commitThePendingFederationAndCheckProposedFederationIsCreated = async () => { - const pendingFederationHash = await bridge.methods.getPendingFederationHash().call(); - - const commitPendingFederationMethod = - bridge.methods.commitFederation(pendingFederationHash); + const pendingFederationHash = await callOrNullIfEmpty(bridge, 'getPendingFederationHash'); // First commit pending federation vote await rskUtils.sendTransaction( rskTxHelper, - commitPendingFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], fedChangeAuthorizer1Address ); // Second commit pending federation vote await rskUtils.sendTransaction( rskTxHelper, - commitPendingFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], fedChangeAuthorizer2Address ); // Third and final commit pending federation vote const commitFederationTransactionReceipt = await rskUtils.sendTransaction( rskTxHelper, - commitPendingFederationMethod, + bridge, + 'commitFederation', + [pendingFederationHash], fedChangeAuthorizer3Address ); @@ -1746,33 +1849,41 @@ const execute = (description, newFederationConfig, fullExecution = false) => { }; const assertSvpValuesNotPresentInStorage = async (rskTxHelper) => { - const svpFundTxHashUnsigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxHashUnsignedStorageIndex); + const svpFundTxHashUnsigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxHashUnsignedStorageIndex + ); expect(svpFundTxHashUnsigned).to.be.equal( '0x0', 'The SVP fund tx hash unsigned storage value should be empty.' ); - const svpFundTxSigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxSignedStorageIndex); + const svpFundTxSigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxSignedStorageIndex + ); expect(svpFundTxSigned).to.be.equal( '0x0', 'The SVP fund tx signed storage value should be empty.' ); - const svpSpendTxHashUnsigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxHashUnsignedStorageIndex); + const svpSpendTxHashUnsigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxHashUnsignedStorageIndex + ); expect(svpSpendTxHashUnsigned).to.be.equal( '0x0', 'The SVP spend tx hash unsigned storage value should be empty.' ); - const svpSpendTxWaitingForSignatures = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxWaitingForSignaturesStorageIndex); + const svpSpendTxWaitingForSignatures = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxWaitingForSignaturesStorageIndex + ); expect(svpSpendTxWaitingForSignatures).to.be.equal( '0x0', 'The SVP spend tx waiting for signatures storage value should be empty.' @@ -1780,9 +1891,11 @@ const assertSvpValuesNotPresentInStorage = async (rskTxHelper) => { }; const assertOnlySvpFundTxHashUnsignedIsInStorage = async (rskTxHelper, pegoutBtcTxHash) => { - const svpFundTxHashUnsignedRlpEncoded = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxHashUnsignedStorageIndex); + const svpFundTxHashUnsignedRlpEncoded = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxHashUnsignedStorageIndex + ); const svpFundTxHashUnsigned = getBridgeStorageValueDecodedHexString( svpFundTxHashUnsignedRlpEncoded, false @@ -1793,25 +1906,31 @@ const assertOnlySvpFundTxHashUnsignedIsInStorage = async (rskTxHelper, pegoutBtc 'The SVP fund tx hash unsigned storage value should be the tx id of the SVP fund tx.' ); - const svpFundTxSigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxSignedStorageIndex); + const svpFundTxSigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxSignedStorageIndex + ); expect(svpFundTxSigned).to.be.equal( '0x0', 'The SVP fund tx signed storage value should be empty.' ); - const svpSpendTxHashUnsigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxHashUnsignedStorageIndex); + const svpSpendTxHashUnsigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxHashUnsignedStorageIndex + ); expect(svpSpendTxHashUnsigned).to.be.equal( '0x0', 'The SVP spend tx hash unsigned storage value should be empty.' ); - const svpSpendTxWaitingForSignatures = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxWaitingForSignaturesStorageIndex); + const svpSpendTxWaitingForSignatures = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxWaitingForSignaturesStorageIndex + ); expect(svpSpendTxWaitingForSignatures).to.be.equal( '0x0', 'The SVP spend tx waiting for signatures storage value should be empty.' @@ -1869,9 +1988,11 @@ const assertPegoutTransactionCreatedOutpointValues = async ( }; const getDecodedSvpSpendTxWaitingForSignaturesFromStorage = async (rskTxHelper) => { - const svpSpendTxWaitingForSignatures = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxWaitingForSignaturesStorageIndex); + const svpSpendTxWaitingForSignatures = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxWaitingForSignaturesStorageIndex + ); expect(svpSpendTxWaitingForSignatures).to.not.be.equal( '0x0', 'The SVP spend tx waiting for signatures storage value should not be empty.' @@ -1888,25 +2009,31 @@ const getDecodedSvpSpendTxWaitingForSignaturesFromStorage = async (rskTxHelper) }; const assertOnlySvpSpendTxValuesAreInStorage = async (rskTxHelper) => { - const svpFundTxHashUnsignedRlpEncoded = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxHashUnsignedStorageIndex); + const svpFundTxHashUnsignedRlpEncoded = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxHashUnsignedStorageIndex + ); expect(svpFundTxHashUnsignedRlpEncoded).to.be.equal( '0x0', 'The SVP fund tx hash unsigned storage value should be empty.' ); - const svpFundTxSigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpFundTxSignedStorageIndex); + const svpFundTxSigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpFundTxSignedStorageIndex + ); expect(svpFundTxSigned).to.be.equal( '0x0', 'The SVP fund tx signed storage value should be empty.' ); - const svpSpendTxHashUnsigned = await rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxHashUnsignedStorageIndex); + const svpSpendTxHashUnsigned = await getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxHashUnsignedStorageIndex + ); expect(svpSpendTxHashUnsigned).to.not.be.equal( '0x0', 'The SVP spend tx hash unsigned storage value should not be empty.' @@ -1925,7 +2052,7 @@ const assertProposedFederationIsStillInStorage = async ( expectedProposedFederationAddress, expectedProposedFederationPublicKeys ) => { - const proposedFederationAddress = await bridge.methods.getProposedFederationAddress().call(); + const proposedFederationAddress = await bridge.getProposedFederationAddress(); expect(proposedFederationAddress).to.be.equal( expectedProposedFederationAddress, 'The proposed federation address should still be in storage.' @@ -1939,10 +2066,10 @@ const assertProposedFederationIsStillInStorage = async ( }; const assertProposedFederationIsNotInStorage = async (bridge) => { - const proposedFederationAddress = await bridge.methods.getProposedFederationAddress().call(); + const proposedFederationAddress = await bridge.getProposedFederationAddress(); expect(proposedFederationAddress).to.be.equal(''); - const proposedFederationSize = Number(await bridge.methods.getProposedFederationSize().call()); + const proposedFederationSize = Number(await bridge.getProposedFederationSize()); expect(proposedFederationSize).to.be.equal(-1); const proposedFederationMembers = await getProposedFederationPublicKeys(bridge); @@ -1986,12 +2113,16 @@ const processSvpSpendTxFromWaitingForSignaturesToRegistration = async ( expectedCountOfSignatures ) => { const [svpSpendTxWaitingForSignatures, svpSpendTxHashUnsigned] = await Promise.all([ - rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxWaitingForSignaturesStorageIndex), - rskTxHelper - .getClient() - .rsk.getStorageBytesAt(BRIDGE_ADDRESS, svpSpendTxHashUnsignedStorageIndex), + getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxWaitingForSignaturesStorageIndex + ), + getStorageBytesAt( + rskTxHelper.getClient(), + BRIDGE_ADDRESS, + svpSpendTxHashUnsignedStorageIndex + ), ]); // `svpSpendTxHashUnsigned` is set at the same time as `svpSpendTxWaitingForSignatures` when the spend diff --git a/lib/tests/get_estimated_fees_methods.js b/lib/tests/get_estimated_fees_methods.js index 4df606b3..5c05c03a 100644 --- a/lib/tests/get_estimated_fees_methods.js +++ b/lib/tests/get_estimated_fees_methods.js @@ -73,17 +73,13 @@ const execute = (description) => { let btcTxHelper; let senderInfo; - const getQueuedPegoutsCount = async () => - Number(await bridge.methods.getQueuedPegoutsCount().call()); + const getQueuedPegoutsCount = async () => Number(await bridge.getQueuedPegoutsCount()); const getEstimatedFeesForNextPegOutEvent = async () => - Number(await bridge.methods.getEstimatedFeesForNextPegOutEvent().call()); - - const getEstimatedFeesForPegOutAmountMethod = (satoshis) => - bridge.methods.getEstimatedFeesForPegOutAmount(satoshisToWeis(satoshis)); + Number(await bridge.getEstimatedFeesForNextPegOutEvent()); const getEstimatedFeesForPegOutAmountCall = async (satoshis) => - Number(await getEstimatedFeesForPegOutAmountMethod(satoshis).call()); + Number(await bridge.getEstimatedFeesForPegOutAmount(satoshisToWeis(satoshis))); const sendPegin = async (peginAmountInBtc) => { const peginBtcTxHash = await sendPeginToActiveFederation( @@ -246,9 +242,9 @@ const execute = (description) => { }); it('should revert when pegout amount is below minimum pegout', async () => { - await assertContractCallFails( - getEstimatedFeesForPegOutAmountMethod(MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS - 1) - ); + await assertContractCallFails(bridge, 'getEstimatedFeesForPegOutAmount', [ + satoshisToWeis(MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS - 1), + ]); }); }); }); diff --git a/lib/tests/union-bridge-methods.js b/lib/tests/union-bridge-methods.js index 4a218468..33cc1e27 100644 --- a/lib/tests/union-bridge-methods.js +++ b/lib/tests/union-bridge-methods.js @@ -7,6 +7,7 @@ const rskUtils = require('../rsk-utils'); const { getBridge } = require('../bridge-provider'); const { getRskTransactionHelpers } = require('../rsk-tx-helper-provider'); +const precompiledAbis = require('@rsksmart/rsk-precompiled-abis'); const { btcToWeis, ethToWeis, weisToEth } = require('@rsksmart/btc-eth-unit-converter'); @@ -77,7 +78,22 @@ let rskTxHelpers; let rskTxHelper; let rskClient; let bridge; -let bridgeMethods; + +/** + * Calls `contract[methodName](...args)` as a static (read) call, treating an ethers `BAD_DATA` + * decode failure (the node returning empty `0x` for an unset `bytes` value) as `null`, matching + * the previous web3 behavior for these same calls. + */ +const callOrNullIfEmpty = async (contract, methodName, ...args) => { + try { + return await contract[methodName](...args); + } catch (error) { + if (error.code === 'BAD_DATA' && error.value === '0x') { + return null; + } + throw error; + } +}; let changeUnionAddressAuthorizerAddress; @@ -104,19 +120,17 @@ const execute = (description) => { rskTxHelper = rskTxHelpers[0]; rskClient = rskTxHelper.getClient(); bridge = await getBridge(rskClient); - bridgeMethods = bridge.methods; await createAndFundAccounts(); await deployAndFundUnionBridgeContract(); await deployAndInitUnionAuthorizerContract(); - bridgeContractAbi = bridge.options.jsonInterface; + bridgeContractAbi = precompiledAbis.bridge.abi; }); it('should setUnionBridgeContractAddressForTestnet change union address', async () => { // Arrange - const unionBridgeAddressBeforeUpdate = - await getUnionBridgeContractAddress(bridgeMethods); + const unionBridgeAddressBeforeUpdate = await getUnionBridgeContractAddress(bridge); expect(unionBridgeAddressBeforeUpdate).to.equal(INITIAL_UNION_BRIDGE_ADDRESS); await assertNoUnionAddressIsStored(rskClient); @@ -128,15 +142,13 @@ const execute = (description) => { ); // Assert - const currentUnionBridgeContractAddress = - await getUnionBridgeContractAddress(bridgeMethods); + const currentUnionBridgeContractAddress = await getUnionBridgeContractAddress(bridge); expect(currentUnionBridgeContractAddress).to.equal(unionBridgeContractAddress); expect(unionBridgeAddressBeforeUpdate).to.not.equal(unionBridgeContractAddress); await rskUtils.assertNoEventWasEmitted(txReceipt); }); describe('Super and base events', () => { - const MAX_EVENT_DATA_LENGTH = 128; const sampleSuperHex = () => @@ -150,24 +162,26 @@ const execute = (description) => { const tooLongPayloadHex = () => `0x${'cd'.repeat(MAX_EVENT_DATA_LENGTH + 1)}`; beforeEach(async () => { - await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.clearSuperEvent(), + unionBridgeContract, + 'clearSuperEvent', + [], unionBridgeContractOwnerAddress ); - + await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.clearBaseEvent(), + unionBridgeContract, + 'clearBaseEvent', + [], unionBridgeContractOwnerAddress ); - }); it('should return empty super and base event bytes after clearing', async () => { - const superEvent = await bridgeMethods.getSuperEvent().call(); - const baseEvent = await bridgeMethods.getBaseEvent().call(); + const superEvent = await callOrNullIfEmpty(bridge, 'getSuperEvent'); + const baseEvent = await callOrNullIfEmpty(bridge, 'getBaseEvent'); expect(superEvent).to.be.null; expect(baseEvent).to.be.null; }); @@ -177,13 +191,15 @@ const execute = (description) => { await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setSuperEvent(payload), + unionBridgeContract, + 'setSuperEvent', + [payload], unionBridgeContractOwnerAddress ); - const stored = await bridgeMethods.getSuperEvent().call(); + const stored = await callOrNullIfEmpty(bridge, 'getSuperEvent'); expect(stored.toLowerCase()).to.equal(payload.toLowerCase()); - const baseUntouched = await bridgeMethods.getBaseEvent().call(); + const baseUntouched = await callOrNullIfEmpty(bridge, 'getBaseEvent'); expect(baseUntouched).to.be.null; }); @@ -191,19 +207,23 @@ const execute = (description) => { const payload = sampleSuperHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setSuperEvent(payload), + unionBridgeContract, + 'setSuperEvent', + [payload], unionBridgeContractOwnerAddress ); - expect((await bridgeMethods.getSuperEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getSuperEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.clearSuperEvent(), + unionBridgeContract, + 'clearSuperEvent', + [], unionBridgeContractOwnerAddress ); - expect(await bridgeMethods.getSuperEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getSuperEvent')).to.be.null; }); it('should persist base event data when set by the union bridge contract', async () => { @@ -211,13 +231,15 @@ const execute = (description) => { await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setBaseEvent(payload), + unionBridgeContract, + 'setBaseEvent', + [payload], unionBridgeContractOwnerAddress ); - const stored = await bridgeMethods.getBaseEvent().call(); + const stored = await callOrNullIfEmpty(bridge, 'getBaseEvent'); expect(stored.toLowerCase()).to.equal(payload.toLowerCase()); - const superUntouched = await bridgeMethods.getSuperEvent().call(); + const superUntouched = await callOrNullIfEmpty(bridge, 'getSuperEvent'); expect(superUntouched).to.be.null; }); @@ -225,60 +247,63 @@ const execute = (description) => { const payload = sampleBaseHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setBaseEvent(payload), + unionBridgeContract, + 'setBaseEvent', + [payload], unionBridgeContractOwnerAddress ); - expect((await bridgeMethods.getBaseEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getBaseEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.clearBaseEvent(), + unionBridgeContract, + 'clearBaseEvent', + [], unionBridgeContractOwnerAddress ); - expect(await bridgeMethods.getBaseEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getBaseEvent')).to.be.null; }); it('should reject setSuperEvent from a direct bridge call when the caller is not the union bridge', async () => { const payload = sampleSuperHex(); - expect(await bridgeMethods.getSuperEvent().call()).to.be.null; - expect(await bridgeMethods.getBaseEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getSuperEvent')).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getBaseEvent')).to.be.null; - const method = bridgeMethods.setSuperEvent(payload); - await method.call({ from: unauthorizedAddress }); + await bridge.setSuperEvent.staticCall(payload, { from: unauthorizedAddress }); - expect(await bridgeMethods.getSuperEvent().call()).to.be.null; - expect(await bridgeMethods.getBaseEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getSuperEvent')).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getBaseEvent')).to.be.null; }); it('should reject setBaseEvent from a direct bridge call when the caller is not the union bridge', async () => { const payload = sampleBaseHex(); - expect(await bridgeMethods.getSuperEvent().call()).to.be.null; - expect(await bridgeMethods.getBaseEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getSuperEvent')).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getBaseEvent')).to.be.null; - const method = bridgeMethods.setBaseEvent(payload); - await method.call({ from: unauthorizedAddress }); + await bridge.setBaseEvent.staticCall(payload, { from: unauthorizedAddress }); - expect(await bridgeMethods.getSuperEvent().call()).to.be.null; - expect(await bridgeMethods.getBaseEvent().call()).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getSuperEvent')).to.be.null; + expect(await callOrNullIfEmpty(bridge, 'getBaseEvent')).to.be.null; }); it('should reject clearSuperEvent from a direct bridge call when the caller is not the union bridge', async () => { const payload = sampleSuperHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setSuperEvent(payload), + unionBridgeContract, + 'setSuperEvent', + [payload], unionBridgeContractOwnerAddress ); - expect((await bridgeMethods.getSuperEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getSuperEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); - const method = bridgeMethods.clearSuperEvent(); - await method.call({ from: unauthorizedAddress }); + await bridge.clearSuperEvent.staticCall({ from: unauthorizedAddress }); - expect((await bridgeMethods.getSuperEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getSuperEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); }); @@ -287,43 +312,50 @@ const execute = (description) => { const payload = sampleBaseHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setBaseEvent(payload), + unionBridgeContract, + 'setBaseEvent', + [payload], unionBridgeContractOwnerAddress ); - expect((await bridgeMethods.getBaseEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getBaseEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); - const method = bridgeMethods.clearBaseEvent(); - await method.call({ from: unauthorizedAddress }); + await bridge.clearBaseEvent.staticCall({ from: unauthorizedAddress }); - expect((await bridgeMethods.getBaseEvent().call()).toLowerCase()).to.equal( + expect((await callOrNullIfEmpty(bridge, 'getBaseEvent')).toLowerCase()).to.equal( payload.toLowerCase() ); }); it('should reject setSuperEvent when payload length is above the maximum', async () => { - const method = unionBridgeContract.methods.setSuperEvent(tooLongPayloadHex()); - await rskUtils.assertContractCallFails(method, { - from: unionBridgeContractOwnerAddress, - }); + await rskUtils.assertContractCallFails( + unionBridgeContract, + 'setSuperEvent', + [tooLongPayloadHex()], + { from: unionBridgeContractOwnerAddress } + ); }); it('should reject setBaseEvent when payload length is above the maximum', async () => { - const method = unionBridgeContract.methods.setBaseEvent(tooLongPayloadHex()); - await rskUtils.assertContractCallFails(method, { - from: unionBridgeContractOwnerAddress, - }); + await rskUtils.assertContractCallFails( + unionBridgeContract, + 'setBaseEvent', + [tooLongPayloadHex()], + { from: unionBridgeContractOwnerAddress } + ); }); it('should accept setSuperEvent at exactly the maximum payload length', async () => { const payload = maxLengthPayloadHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setSuperEvent(payload), + unionBridgeContract, + 'setSuperEvent', + [payload], unionBridgeContractOwnerAddress ); - const stored = await bridgeMethods.getSuperEvent().call(); + const stored = await callOrNullIfEmpty(bridge, 'getSuperEvent'); expect(stored.toLowerCase()).to.equal(payload.toLowerCase()); }); @@ -331,25 +363,29 @@ const execute = (description) => { const payload = maxLengthPayloadHex(); await rskUtils.sendTransaction( rskTxHelper, - unionBridgeContract.methods.setBaseEvent(payload), + unionBridgeContract, + 'setBaseEvent', + [payload], unionBridgeContractOwnerAddress ); - const stored = await bridgeMethods.getBaseEvent().call(); + const stored = await callOrNullIfEmpty(bridge, 'getBaseEvent'); expect(stored.toLowerCase()).to.equal(payload.toLowerCase()); }); }); it('should increaseUnionBridgeLockingCap return UNAUTHORIZED_CALLER when caller is unauthorized', async () => { // Arrange - const unionLockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridgeMethods); - expect(unionLockingCapBeforeUpdate).to.equal(INITIAL_UNION_LOCKING_CAP); + const unionLockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridge); + expect(unionLockingCapBeforeUpdate.toString()).to.equal( + INITIAL_UNION_LOCKING_CAP.toString() + ); // Act & Assert await rskUtils.assertContractCallFails( - bridgeMethods.increaseUnionBridgeLockingCap(NEW_LOCKING_CAP_1), - { - from: unauthorizedAddress, - } + bridge, + 'increaseUnionBridgeLockingCap', + [NEW_LOCKING_CAP_1], + { from: unauthorizedAddress } ); }); @@ -358,8 +394,12 @@ const execute = (description) => { const txReceipt = await increaseUnionBridgeLockingCap(NEW_LOCKING_CAP_1); // Assert - assertIncreaseUnionLockingCapExecutedEventWasEmitted(txReceipt, NEW_LOCKING_CAP_1); - await assertLockingCap(rskClient, bridgeMethods, NEW_LOCKING_CAP_1); + assertIncreaseUnionLockingCapExecutedEventWasEmitted( + unionBridgeAuthorizerContract, + txReceipt, + NEW_LOCKING_CAP_1 + ); + await assertLockingCap(rskClient, bridge, NEW_LOCKING_CAP_1); await assertLogUnionLockingCapIncreased( txReceipt.transactionHash, INITIAL_UNION_LOCKING_CAP, @@ -369,15 +409,19 @@ const execute = (description) => { it('should increaseUnionBridgeLockingCap be successful when vote again for another value', async () => { // Arrange - const lockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridgeMethods); - await assertLockingCap(rskClient, bridgeMethods, lockingCapBeforeUpdate); + const lockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridge); + await assertLockingCap(rskClient, bridge, lockingCapBeforeUpdate); // Act const txReceipt = await increaseUnionBridgeLockingCap(NEW_LOCKING_CAP_2); // Assert - assertIncreaseUnionLockingCapExecutedEventWasEmitted(txReceipt, NEW_LOCKING_CAP_2); - await assertLockingCap(rskClient, bridgeMethods, NEW_LOCKING_CAP_2); + assertIncreaseUnionLockingCapExecutedEventWasEmitted( + unionBridgeAuthorizerContract, + txReceipt, + NEW_LOCKING_CAP_2 + ); + await assertLockingCap(rskClient, bridge, NEW_LOCKING_CAP_2); await assertLogUnionLockingCapIncreased( txReceipt.transactionHash, NEW_LOCKING_CAP_1, @@ -387,24 +431,25 @@ const execute = (description) => { it('should increaseUnionBridgeLockingCap fail when trying to decrease the locking cap', async () => { // Arrange - const lockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridgeMethods); - const smallerLockingCap = new BN(lockingCapBeforeUpdate).sub(new BN(1)); + const lockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridge); + const smallerLockingCap = new BN(lockingCapBeforeUpdate.toString()).sub(new BN(1)); // Act const txReceipt = await increaseUnionBridgeLockingCap(smallerLockingCap.toString()); // Assert - assertBridgeCallFailedEventWasEmitted(txReceipt, UNION_RESPONSE_CODES.INVALID_VALUE); - await assertLockingCap(rskClient, bridgeMethods, lockingCapBeforeUpdate); + assertBridgeCallFailedEventWasEmitted( + unionBridgeAuthorizerContract, + txReceipt, + UNION_RESPONSE_CODES.INVALID_VALUE + ); + await assertLockingCap(rskClient, bridge, lockingCapBeforeUpdate); }); it('should requestUnionBridgeRbtc return UNAUTHORIZED_CALLER when caller is unauthorized', async () => { // Arrange await assertNoWeisTransferredToUnionBridgeIsStored(rskClient); - const unionBridgeBalanceBefore = await getUnionBridgeBalance( - rskTxHelper, - bridgeMethods - ); + const unionBridgeBalanceBefore = await getUnionBridgeBalance(rskTxHelper, bridge); // Act const txReceipt = await requestUnionBridgeRbtcFromUnauthorizedCaller( @@ -414,7 +459,7 @@ const execute = (description) => { // Assert await assertNoWeisTransferredToUnionBridgeIsStored(rskClient); - await assertUnionBridgeBalance(rskTxHelper, bridgeMethods, unionBridgeBalanceBefore); + await assertUnionBridgeBalance(rskTxHelper, bridge, unionBridgeBalanceBefore); await rskUtils.assertNoEventWasEmitted(txReceipt); }); @@ -423,7 +468,7 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -451,7 +496,7 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -473,7 +518,7 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -502,13 +547,10 @@ const execute = (description) => { // Act & Assert await rskUtils.assertContractCallFails( - bridgeMethods.setUnionBridgeTransferPermissions( - REQUEST_PERMISSION_DISABLED, - RELEASE_PERMISSION_DISABLED - ), - { - from: unauthorizedAddress, - } + bridge, + 'setUnionBridgeTransferPermissions', + [REQUEST_PERMISSION_DISABLED, RELEASE_PERMISSION_DISABLED], + { from: unauthorizedAddress } ); }); @@ -538,7 +580,7 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -557,7 +599,7 @@ const execute = (description) => { it('should increaseUnionBridgeLockingCap vote be successful when transfer permissions are disabled', async () => { // Arrange - const unionLockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridgeMethods); + const unionLockingCapBeforeUpdate = await getUnionBridgeLockingCap(bridge); const newLockingCap = new BN(unionLockingCapBeforeUpdate) .mul(new BN(UNION_LOCKING_CAP_INCREMENTS_MULTIPLIER)) .toString(); @@ -566,8 +608,12 @@ const execute = (description) => { const txReceipt = await increaseUnionBridgeLockingCap(newLockingCap); // Assert - assertIncreaseUnionLockingCapExecutedEventWasEmitted(txReceipt, newLockingCap); - await assertLockingCap(rskClient, bridgeMethods, newLockingCap); + assertIncreaseUnionLockingCapExecutedEventWasEmitted( + unionBridgeAuthorizerContract, + txReceipt, + newLockingCap + ); + await assertLockingCap(rskClient, bridge, newLockingCap); await assertLogUnionLockingCapIncreased( txReceipt.transactionHash, unionLockingCapBeforeUpdate, @@ -577,7 +623,7 @@ const execute = (description) => { it('should setUnionBridgeContractAddressForTestnet be successful when transfer permissions are disabled', async () => { // Arrange - const unionAddressBeforeUpdate = await getUnionBridgeContractAddress(bridgeMethods); + const unionAddressBeforeUpdate = await getUnionBridgeContractAddress(bridge); await deployAndFundUnionBridgeContract(); // Act @@ -588,7 +634,7 @@ const execute = (description) => { ); // Assert - const newUnionAddress = await getUnionBridgeContractAddress(bridgeMethods); + const newUnionAddress = await getUnionBridgeContractAddress(bridge); expect(newUnionAddress).to.equal(unionBridgeContractAddress); expect(unionAddressBeforeUpdate).to.not.equal(unionBridgeContractAddress); await rskUtils.assertNoEventWasEmitted(txReceipt); @@ -620,7 +666,7 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -648,7 +694,7 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -691,7 +737,7 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -713,7 +759,7 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -762,9 +808,9 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); - const currentLockingCap = await getUnionBridgeLockingCap(bridgeMethods); + const currentLockingCap = await getUnionBridgeLockingCap(bridge); const amountToRequestSurpassingLockingCap = new BN(currentLockingCap).add(new BN(1)); // Act @@ -786,22 +832,19 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); const amountToReleaseSurpassingBalance = new BN(weisTransferredBeforeRelease).add( new BN(AMOUNT_TO_RELEASE) ); // Add extra funds to simulate the union bridge sending more than the transferred amount - const unionBridgeContractAddress = await getUnionBridgeContractAddress(bridgeMethods); + const unionBridgeContractAddress = await getUnionBridgeContractAddress(bridge); await rskUtils.sendFromCow( rskTxHelper, unionBridgeContractAddress, amountToReleaseSurpassingBalance.toString() ); - const unionBridgeBalanceAfterFunding = await getUnionBridgeBalance( - rskTxHelper, - bridgeMethods - ); + const unionBridgeBalanceAfterFunding = await getUnionBridgeBalance(rskTxHelper, bridge); const expectedUnionBridgeBalanceAfterFunding = new BN( unionBridgeBalanceBeforeRelease ).add(amountToReleaseSurpassingBalance); @@ -857,7 +900,7 @@ const execute = (description) => { const weisTransferredBeforeRequest = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRequest = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -885,7 +928,7 @@ const execute = (description) => { const weisTransferredBeforeRelease = await getWeisTransferredToUnionBridge(rskClient); const unionBridgeBalanceBeforeRelease = await getUnionBridgeBalance( rskTxHelper, - bridgeMethods + bridge ); // Act @@ -947,7 +990,7 @@ const deployAndFundUnionBridgeContract = async () => { rskTxHelper, unionBridgeContractOwnerAddress ); - unionBridgeContractAddress = unionBridgeContract._address; + unionBridgeContractAddress = unionBridgeContract.target; }; const deployAndInitUnionAuthorizerContract = async () => { @@ -961,31 +1004,30 @@ const deployAndInitUnionAuthorizerContract = async () => { rskTxHelper, unionBridgeAuthorizerOwnerAddress ); - unionBridgeAuthorizerContractAddress = unionBridgeAuthorizerContract._address; + unionBridgeAuthorizerContractAddress = unionBridgeAuthorizerContract.target; - const multisigInitMethod = unionBridgeAuthorizerContract.methods.init( - multisigMembers, - UNION_AUTHORIZER_VOTING_PERIOD_IN_BLOCKS - ); const txReceipt = await rskUtils.sendTransaction( rskTxHelper, - multisigInitMethod, + unionBridgeAuthorizerContract, + 'init', + [multisigMembers, UNION_AUTHORIZER_VOTING_PERIOD_IN_BLOCKS], unionBridgeAuthorizerOwnerAddress, 0, 300000 ); assertUnionAuthorizerInitializedEventWasEmitted( + unionBridgeAuthorizerContract, txReceipt, UNION_AUTHORIZER_VOTING_PERIOD_IN_BLOCKS ); }; const voteToIncreaseUnionBridgeLockingCap = async (newLockingCap, authorizedMember) => { - const increaseLockingCapVote = - unionBridgeAuthorizerContract.methods.voteToIncreaseUnionLockingCap(newLockingCap); return await rskUtils.sendTransaction( rskTxHelper, - increaseLockingCapVote, + unionBridgeAuthorizerContract, + 'voteToIncreaseUnionLockingCap', + [newLockingCap], authorizedMember, 0, 300000 @@ -997,11 +1039,11 @@ const setUnionBridgeContractAddressForTestnet = async ( fromAddress, checkCallback ) => { - const updateUnionAddressMethod = - bridgeMethods.setUnionBridgeContractAddressForTestnet(newUnionAddress); return rskUtils.sendTxWithCheck( rskTxHelper, - updateUnionAddressMethod, + bridge, + 'setUnionBridgeContractAddressForTestnet', + [newUnionAddress], fromAddress, checkCallback ); @@ -1013,6 +1055,7 @@ const increaseUnionBridgeLockingCap = async (newLockingCap) => { unionBridgeAuthorizerMember1Address ); assertIncreaseUnionLockingCapVotedEventWasEmitted( + unionBridgeAuthorizerContract, txReceiptFirstVote, newLockingCap, unionBridgeAuthorizerMember1Address @@ -1023,6 +1066,7 @@ const increaseUnionBridgeLockingCap = async (newLockingCap) => { unionBridgeAuthorizerMember2Address ); assertIncreaseUnionLockingCapVotedEventWasEmitted( + unionBridgeAuthorizerContract, txReceiptSecondVote, newLockingCap, unionBridgeAuthorizerMember2Address @@ -1038,6 +1082,7 @@ const setUnionTransferPermissions = async (requestEnabled, releaseEnabled) => { unionBridgeAuthorizerMember1Address ); assertUnionTransferPermissionsVotedEventWasEmitted( + unionBridgeAuthorizerContract, txReceiptFirstVote, requestEnabled, releaseEnabled, @@ -1050,6 +1095,7 @@ const setUnionTransferPermissions = async (requestEnabled, releaseEnabled) => { unionBridgeAuthorizerMember2Address ); assertUnionTransferPermissionsVotedEventWasEmitted( + unionBridgeAuthorizerContract, txReceiptSecondVote, requestEnabled, releaseEnabled, @@ -1057,6 +1103,7 @@ const setUnionTransferPermissions = async (requestEnabled, releaseEnabled) => { ); assertUnionTransferPermissionsExecutedEventWasEmitted( + unionBridgeAuthorizerContract, txReceiptSecondVote, requestEnabled, releaseEnabled @@ -1069,14 +1116,11 @@ const voteToSetUnionTransferPermissions = async ( releaseEnabled, authorizedMember ) => { - const setUnionTransferPermissionsVote = - unionBridgeAuthorizerContract.methods.voteToSetUnionTransferPermissions( - requestEnabled, - releaseEnabled - ); return await rskUtils.sendTransaction( rskTxHelper, - setUnionTransferPermissionsVote, + unionBridgeAuthorizerContract, + 'voteToSetUnionTransferPermissions', + [requestEnabled, releaseEnabled], authorizedMember, 0, 300000 @@ -1085,25 +1129,33 @@ const voteToSetUnionTransferPermissions = async ( const requestUnionBridgeRbtcFromUnauthorizedCaller = async (amountToRequest, checkCallback) => { // Call the method directly on the bridge contract - const method = bridgeMethods.requestUnionBridgeRbtc(amountToRequest); - return rskUtils.sendTxWithCheck(rskTxHelper, method, unauthorizedAddress, checkCallback); + return rskUtils.sendTxWithCheck( + rskTxHelper, + bridge, + 'requestUnionBridgeRbtc', + [amountToRequest], + unauthorizedAddress, + checkCallback + ); }; const requestUnionBridgeRbtc = async (amountToRequest, checkCallback) => { - const method = unionBridgeContract.methods.requestUnionBridgeRbtc(amountToRequest); return rskUtils.sendTxWithCheck( rskTxHelper, - method, + unionBridgeContract, + 'requestUnionBridgeRbtc', + [amountToRequest], unionBridgeContractOwnerAddress, checkCallback ); }; const releaseUnionBridgeRbtc = async (amountToRelease, checkCallback) => { - const method = unionBridgeContract.methods.releaseUnionBridgeRbtc(amountToRelease); return rskUtils.sendTxWithCheck( rskTxHelper, - method, + unionBridgeContract, + 'releaseUnionBridgeRbtc', + [amountToRelease], unionBridgeContractOwnerAddress, checkCallback ); @@ -1111,13 +1163,19 @@ const releaseUnionBridgeRbtc = async (amountToRelease, checkCallback) => { const releaseUnionBridgeRbtcFromUnauthorizedCaller = async (amountToRelease, checkCallback) => { // Call the method directly on the bridge contract - const method = bridgeMethods.releaseUnionBridgeRbtc(); - const unionResponseCode = await method.call({ + const unionResponseCode = await bridge.releaseUnionBridgeRbtc.staticCall({ from: unauthorizedAddress, value: amountToRelease, }); await checkCallback(unionResponseCode); - return rskUtils.sendTransaction(rskTxHelper, method, unauthorizedAddress, amountToRelease); + return rskUtils.sendTransaction( + rskTxHelper, + bridge, + 'releaseUnionBridgeRbtc', + [], + unauthorizedAddress, + amountToRelease + ); }; const assertLogUnionRbtcRequested = async (txHash, amountRequested) => { @@ -1135,7 +1193,7 @@ const assertLogUnionRbtcRequested = async (txHash, amountRequested) => { expect(eventArguments.requester.toLowerCase()).to.equal( unionBridgeContractAddress.toLowerCase() ); - expect(eventArguments.amount).to.equal(amountRequested); + expect(eventArguments.amount.toString()).to.equal(amountRequested.toString()); }; const assertLogUnionLockingCapIncreased = async (txHash, previousLockingCap, newLockingCap) => { @@ -1153,8 +1211,8 @@ const assertLogUnionLockingCapIncreased = async (txHash, previousLockingCap, new expect(eventArguments.caller.toLowerCase()).to.equal( unionBridgeAuthorizerContractAddress.toLowerCase() ); - expect(eventArguments.previousLockingCap).to.equal(previousLockingCap); - expect(eventArguments.newLockingCap).to.equal(newLockingCap); + expect(eventArguments.previousLockingCap.toString()).to.equal(previousLockingCap.toString()); + expect(eventArguments.newLockingCap.toString()).to.equal(newLockingCap.toString()); }; const assertLogUnionTransferPermissionsSet = async ( @@ -1194,7 +1252,7 @@ const assertLogUnionRbtcReleased = async (txHash, amountReleased) => { expect(eventArguments.receiver.toLowerCase()).to.equal( unionBridgeContractAddress.toLowerCase() ); - expect(eventArguments.amount).to.equal(amountReleased); + expect(eventArguments.amount.toString()).to.equal(amountReleased.toString()); }; const assertWeisTransferredAndUnionBridgeContractBalance = async ( @@ -1202,7 +1260,7 @@ const assertWeisTransferredAndUnionBridgeContractBalance = async ( expectedUnionBridgeBalance ) => { await assertWeisTransferredToUnionBridge(rskTxHelper.getClient(), expectedWeisTransferred); - await assertUnionBridgeBalance(rskTxHelper, bridgeMethods, expectedUnionBridgeBalance); + await assertUnionBridgeBalance(rskTxHelper, bridge, expectedUnionBridgeBalance); }; module.exports = { diff --git a/lib/union-bridge-utils.js b/lib/union-bridge-utils.js index 0ad476d3..cfd0bf65 100644 --- a/lib/union-bridge-utils.js +++ b/lib/union-bridge-utils.js @@ -9,6 +9,24 @@ const { } = require('./constants/union-bridge-constants'); const { BRIDGE_ADDRESS } = require('./constants/bridge-constants'); const { getBridgeStorageValueDecodedHexString } = require('./utils'); +const { getStorageBytesAt } = require('./rsk-rpc-utils'); + +/** + * Finds and decodes the first log in `txReceipt` matching `eventName` in `contract`'s ABI. + * @param {import('ethers').Contract} contract the contract whose interface decodes the event + * @param {import('ethers').TransactionReceipt} txReceipt + * @param {string} eventName + * @returns {import('ethers').LogDescription | undefined} + */ +const findEventInReceipt = (contract, txReceipt, eventName) => { + for (const log of txReceipt.logs) { + const parsedLog = contract.interface.parseLog(log); + if (parsedLog?.name === eventName) { + return parsedLog; + } + } + return undefined; +}; const NO_VALUE = '0x0'; @@ -34,79 +52,97 @@ const assertInvalidValueResponseCode = (actualUnionResponseCode) => { expect(actualUnionResponseCode).to.equal(UNION_RESPONSE_CODES.INVALID_VALUE); }; -const assertUnionAuthorizerInitializedEventWasEmitted = (txReceipt, votingPeriodInBlocks) => { +const assertUnionAuthorizerInitializedEventWasEmitted = ( + contract, + txReceipt, + votingPeriodInBlocks +) => { const expectedEventName = 'Initialized'; - const foundEvent = txReceipt.events[expectedEventName]; + const foundEvent = findEventInReceipt(contract, txReceipt, expectedEventName); expect(foundEvent, `Expected to find event with name "${expectedEventName}"`).to.not.be .undefined; - expect(foundEvent.returnValues.votingPeriodInBlocks).to.equal(votingPeriodInBlocks.toString()); + expect(foundEvent.args.votingPeriodInBlocks.toString()).to.equal( + votingPeriodInBlocks.toString() + ); }; const assertIncreaseUnionLockingCapVotedEventWasEmitted = ( + contract, txReceipt, newLockingCap, authorizedMember ) => { const IncreaseUnionLockingCapVotedEvent = 'IncreaseUnionLockingCapVoted'; - const foundIncreaseLockingCapEvent = txReceipt.events[IncreaseUnionLockingCapVotedEvent]; + const foundIncreaseLockingCapEvent = findEventInReceipt( + contract, + txReceipt, + IncreaseUnionLockingCapVotedEvent + ); expect( foundIncreaseLockingCapEvent, `Expected to find event with name "${IncreaseUnionLockingCapVotedEvent}"` ).to.not.be.undefined; - expect(foundIncreaseLockingCapEvent.returnValues.newLockingCap).to.equal(newLockingCap); - expect(foundIncreaseLockingCapEvent.returnValues.voter.toLowerCase()).to.equal( + expect(foundIncreaseLockingCapEvent.args.newLockingCap.toString()).to.equal( + newLockingCap.toString() + ); + expect(foundIncreaseLockingCapEvent.args.voter.toLowerCase()).to.equal( authorizedMember.toLowerCase() ); }; -const assertIncreaseUnionLockingCapExecutedEventWasEmitted = (txReceipt, newLockingCap) => { +const assertIncreaseUnionLockingCapExecutedEventWasEmitted = ( + contract, + txReceipt, + newLockingCap +) => { const executedEventName = 'IncreaseUnionLockingCapExecuted'; - const foundExecutedEvent = txReceipt.events[executedEventName]; + const foundExecutedEvent = findEventInReceipt(contract, txReceipt, executedEventName); expect(foundExecutedEvent, `Expected to find event with name "${executedEventName}"`).to.not.be .undefined; - expect(foundExecutedEvent.returnValues.newLockingCap).to.equal(newLockingCap.toString()); + expect(foundExecutedEvent.args.newLockingCap.toString()).to.equal(newLockingCap.toString()); }; const assertUnionTransferPermissionsVotedEventWasEmitted = ( + contract, txReceipt, requestEnabled, releaseEnabled, authorizedMember ) => { const votedEventName = 'SetUnionBridgeTransferPermissionsVoted'; - const foundVotedEvent = txReceipt.events[votedEventName]; + const foundVotedEvent = findEventInReceipt(contract, txReceipt, votedEventName); expect(foundVotedEvent, `Expected to find event with name "${votedEventName}"`).to.not.be .undefined; - expect(foundVotedEvent.returnValues.requestEnabled).to.equal(requestEnabled); - expect(foundVotedEvent.returnValues.releaseEnabled).to.equal(releaseEnabled); - expect(foundVotedEvent.returnValues.voter.toLowerCase()).to.equal( - authorizedMember.toLowerCase() - ); + expect(foundVotedEvent.args.requestEnabled).to.equal(requestEnabled); + expect(foundVotedEvent.args.releaseEnabled).to.equal(releaseEnabled); + expect(foundVotedEvent.args.voter.toLowerCase()).to.equal(authorizedMember.toLowerCase()); }; const assertUnionTransferPermissionsExecutedEventWasEmitted = ( + contract, txReceipt, requestEnabled, releaseEnabled ) => { const executedEventName = 'SetUnionBridgeTransferPermissionsExecuted'; - const foundExecutedEvent = txReceipt.events[executedEventName]; + const foundExecutedEvent = findEventInReceipt(contract, txReceipt, executedEventName); expect(foundExecutedEvent, `Expected to find event with name "${executedEventName}"`).to.not.be .undefined; - expect(foundExecutedEvent.returnValues.requestEnabled).to.equal(requestEnabled); - expect(foundExecutedEvent.returnValues.releaseEnabled).to.equal(releaseEnabled); + expect(foundExecutedEvent.args.requestEnabled).to.equal(requestEnabled); + expect(foundExecutedEvent.args.releaseEnabled).to.equal(releaseEnabled); }; -const assertBridgeCallFailedEventWasEmitted = (txReceipt, unionResponseCode) => { +const assertBridgeCallFailedEventWasEmitted = (contract, txReceipt, unionResponseCode) => { const executedEventName = 'BridgeCallFailed'; - const foundExecutedEvent = txReceipt.events[executedEventName]; + const foundExecutedEvent = findEventInReceipt(contract, txReceipt, executedEventName); expect(foundExecutedEvent, `Expected to find event with name "${executedEventName}"`).to.not.be .undefined; - expect(foundExecutedEvent.returnValues.unionResponseCode).to.equal(unionResponseCode); + expect(foundExecutedEvent.args.unionResponseCode.toString()).to.equal(unionResponseCode); }; const assertNoUnionAddressIsStored = async (rskClient) => { - const unionBridgeAddressEncoded = await rskClient.rsk.getStorageBytesAt( + const unionBridgeAddressEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_CONTRACT_ADDRESS ); @@ -114,7 +150,8 @@ const assertNoUnionAddressIsStored = async (rskClient) => { }; const assertStoredUnionLockingCap = async (rskClient, expectedLockingCap) => { - const unionLockingCapEncoded = await rskClient.rsk.getStorageBytesAt( + const unionLockingCapEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_LOCKING_CAP ); @@ -128,7 +165,8 @@ const assertStoredUnionLockingCap = async (rskClient, expectedLockingCap) => { }; const assertNoWeisTransferredToUnionBridgeIsStored = async (rskClient) => { - const weisTransferredEncoded = await rskClient.rsk.getStorageBytesAt( + const weisTransferredEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.WEIS_TRANSFERRED_TO_UNION_BRIDGE ); @@ -140,11 +178,13 @@ const assertUnionTransferredPermissions = async ( expectedRequestPermission, expectedReleasePermission ) => { - const actualRequestPermissionEncoded = await rskClient.rsk.getStorageBytesAt( + const actualRequestPermissionEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_REQUEST_ENABLED ); - const actualReleasePermissionEncoded = await rskClient.rsk.getStorageBytesAt( + const actualReleasePermissionEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_RELEASE_ENABLED ); @@ -161,11 +201,13 @@ const assertUnionTransferredPermissions = async ( }; const assertNoUnionTransferredPermissionsIsStored = async (rskClient) => { - const actualRequestPermissionEncoded = await rskClient.rsk.getStorageBytesAt( + const actualRequestPermissionEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_REQUEST_ENABLED ); - const actualReleasePermissionEncoded = await rskClient.rsk.getStorageBytesAt( + const actualReleasePermissionEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.UNION_BRIDGE_RELEASE_ENABLED ); @@ -174,7 +216,8 @@ const assertNoUnionTransferredPermissionsIsStored = async (rskClient) => { }; const getWeisTransferredToUnionBridge = async (rskClient) => { - const weisTransferredEncoded = await rskClient.rsk.getStorageBytesAt( + const weisTransferredEncoded = await getStorageBytesAt( + rskClient, BRIDGE_ADDRESS, UNION_BRIDGE_STORAGE_INDICES.WEIS_TRANSFERRED_TO_UNION_BRIDGE ); @@ -193,27 +236,27 @@ const assertWeisTransferredToUnionBridge = async (rskClient, expectedWeisTransfe expect(actualWeisTransferred).to.equal(expectedWeisTransferred.toString()); }; -const getUnionBridgeContractAddress = async (bridgeMethods) => { - return await bridgeMethods.getUnionBridgeContractAddress().call(); +const getUnionBridgeContractAddress = async (bridge) => { + return await bridge.getUnionBridgeContractAddress(); }; -const getUnionBridgeLockingCap = async (bridgeMethods) => { - return await bridgeMethods.getUnionBridgeLockingCap().call(); +const getUnionBridgeLockingCap = async (bridge) => { + return await bridge.getUnionBridgeLockingCap(); }; -const assertLockingCap = async (rskClient, bridgeMethods, expectedLockingCap) => { - const actualLockingCap = await getUnionBridgeLockingCap(bridgeMethods); - expect(actualLockingCap).to.equal(expectedLockingCap); +const assertLockingCap = async (rskClient, bridge, expectedLockingCap) => { + const actualLockingCap = await getUnionBridgeLockingCap(bridge); + expect(actualLockingCap.toString()).to.equal(expectedLockingCap.toString()); await assertStoredUnionLockingCap(rskClient, expectedLockingCap); }; -const assertUnionBridgeBalance = async (rskTxHelper, bridgeMethods, expectedBalance) => { - const actualBalance = await getUnionBridgeBalance(rskTxHelper, bridgeMethods); +const assertUnionBridgeBalance = async (rskTxHelper, bridge, expectedBalance) => { + const actualBalance = await getUnionBridgeBalance(rskTxHelper, bridge); expect(actualBalance.toString()).to.equal(expectedBalance.toString()); }; -const getUnionBridgeBalance = async (rskTxHelper, bridgeMethods) => { - const unionBridgeContractAddress = await getUnionBridgeContractAddress(bridgeMethods); +const getUnionBridgeBalance = async (rskTxHelper, bridge) => { + const unionBridgeContractAddress = await getUnionBridgeContractAddress(bridge); const unionBridgeContractBalance = await rskTxHelper.getBalance(unionBridgeContractAddress); return unionBridgeContractBalance.toString(); }; diff --git a/lib/utils.js b/lib/utils.js index 5665ccef..325ca050 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,6 +1,6 @@ var fs = require('fs-extra'); const RLP = require('rlp'); -const Web3 = require('web3'); +const { keccak256 } = require('ethers'); var wait = (msec) => new Promise((resolve) => setTimeout(resolve, msec)); @@ -156,7 +156,7 @@ const getBridgeStorageIndexFromKey = (storageKey) => { }; const getBridgeStorageIndexFromLongKey = (storageKey) => { - return Web3.utils.keccak256(Buffer.from(storageKey)); + return keccak256(Buffer.from(storageKey)); }; module.exports = { diff --git a/lib/web3-utils.js b/lib/web3-utils.js deleted file mode 100644 index be349e64..00000000 --- a/lib/web3-utils.js +++ /dev/null @@ -1,21 +0,0 @@ -const extendWeb3WithRskModule = (web3) => { - web3.extend({ - property: 'rsk', - methods: [ - { - name: 'getStorageBytesAt', - call: 'rsk_getStorageBytesAt', - params: 3, - inputFormatter: [ - web3.extend.formatters.inputAddressFormatter, - web3.extend.formatters.inputDefaultBlockNumberFormatter, - web3.extend.formatters.inputDefaultBlockNumberFormatter, - ], - }, - ], - }); -}; - -module.exports = { - extendWeb3WithRskModule, -}; diff --git a/package-lock.json b/package-lock.json index 93d31d14..921d7e1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,12 +11,13 @@ "dependencies": { "@noble/secp256k1": "3.1.0", "@rsksmart/bridge-state-data-parser": "2.3.0", - "@rsksmart/bridge-transaction-parser": "github:rsksmart/bridge-transaction-parser#v1.2.0", + "@rsksmart/bridge-transaction-parser": "2.2.0", "@rsksmart/btc-eth-unit-converter": "1.0.1", "@rsksmart/btc-rsk-derivation": "0.0.2", "@rsksmart/btc-transaction-helper": "git+https://git@github.com/rsksmart/btc-transaction-helper.git#v5.0.0-rc", "@rsksmart/pmt-builder": "3.0.1", "@rsksmart/powpeg-redeemscript-parser": "github:rsksmart/powpeg-redeemscript-parser#fbe3b981b3f768396833f5f832526a9751098089", + "@rsksmart/rootstock-transaction-helper": "github:rsksmart/rootstock-transaction-helper#v6.0.0", "@rsksmart/rsk-precompiled-abis": "9.0.0-VETIVER", "bitcoinjs-lib": "7.0.1", "bn.js": "5.2.5", @@ -26,6 +27,7 @@ "dev-null": "0.1.1", "dotenv": "17.4.2", "ecpair": "3.0.1", + "ethers": "6.17.0", "find": "0.3.0", "fs-extra": "11.3.6", "glob": "13.0.6", @@ -35,7 +37,6 @@ "mocha-junit-reporter": "2.2.1", "mocha-multi-reporters": "1.5.1", "pegin-address-verificator": "git+https://git@github.com/rsksmart/pegin-address-verifier#v0.4.0", - "rsk-transaction-helper": "git+https://github.com/rsksmart/rootstock-transaction-helper#v3.1.0", "solc": "0.8.36", "stream-line-wrapper": "0.1.1", "tiny-secp256k1": "2.2.4", @@ -51,6 +52,12 @@ "shelljs": "0.10.0" } }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", + "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", + "license": "MIT" + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -179,16 +186,6 @@ "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@ethereumjs/common": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", - "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", - "license": "MIT", - "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" - } - }, "node_modules/@ethereumjs/rlp": { "version": "10.1.1", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-10.1.1.tgz", @@ -201,458 +198,6 @@ "node": ">=20" } }, - "node_modules/@ethereumjs/tx": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", - "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", - "license": "MPL-2.0", - "dependencies": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "license": "MPL-2.0", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/util/node_modules/@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "license": "MPL-2.0", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/util/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==", - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "license": "MIT", - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - }, - "node_modules/@ethersproject/abi": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.8.0.tgz", - "integrity": "sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/hash": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/abstract-provider": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz", - "integrity": "sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/networks": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "@ethersproject/web": "^5.8.0" - } - }, - "node_modules/@ethersproject/abstract-signer": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz", - "integrity": "sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-provider": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0" - } - }, - "node_modules/@ethersproject/address": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.8.0.tgz", - "integrity": "sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/rlp": "^5.8.0" - } - }, - "node_modules/@ethersproject/base64": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.8.0.tgz", - "integrity": "sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0" - } - }, - "node_modules/@ethersproject/bignumber": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.8.0.tgz", - "integrity": "sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "bn.js": "^5.2.1" - } - }, - "node_modules/@ethersproject/bytes": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.8.0.tgz", - "integrity": "sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/constants": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.8.0.tgz", - "integrity": "sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0" - } - }, - "node_modules/@ethersproject/hash": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.8.0.tgz", - "integrity": "sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/base64": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/keccak256": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.8.0.tgz", - "integrity": "sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "js-sha3": "0.8.0" - } - }, - "node_modules/@ethersproject/logger": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.8.0.tgz", - "integrity": "sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT" - }, - "node_modules/@ethersproject/networks": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.8.0.tgz", - "integrity": "sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/properties": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.8.0.tgz", - "integrity": "sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/rlp": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", - "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/signing-key": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", - "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "bn.js": "^5.2.1", - "elliptic": "6.6.1", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/strings": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", - "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/transactions": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", - "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/rlp": "^5.8.0", - "@ethersproject/signing-key": "^5.8.0" - } - }, - "node_modules/@ethersproject/web": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", - "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/base64": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, "node_modules/@humanfs/core": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", @@ -929,17 +474,93 @@ "license": "ISC" }, "node_modules/@rsksmart/bridge-transaction-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@rsksmart/bridge-transaction-parser/-/bridge-transaction-parser-2.2.0.tgz", + "integrity": "sha512-a2nP+oY464xQQPsX1BgOCviGddznHCgYLrbVYIRrUMTrCTB0U1Va+FiTe0v7lPHTWYFwkI5qOa3NnB4m9aD5NA==", + "license": "MIT", + "dependencies": { + "@rsksmart/rsk-precompiled-abis": "9.0.0-VETIVER", + "ethers": "6.16.0" + } + }, + "node_modules/@rsksmart/bridge-transaction-parser/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==", + "license": "MIT" + }, + "node_modules/@rsksmart/bridge-transaction-parser/node_modules/@noble/curves": { "version": "1.2.0", - "resolved": "git+ssh://git@github.com/rsksmart/bridge-transaction-parser.git#bb719f8e58a702e5be8a107faf4791a100f417b9", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "license": "MIT", "dependencies": { - "@rsksmart/rsk-precompiled-abis": "git+https://github.com/rsksmart/precompiled-abis#7.0.0-LOVELL" + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@rsksmart/bridge-transaction-parser/node_modules/@rsksmart/rsk-precompiled-abis": { - "version": "7.0.0-LOVELL", - "resolved": "git+ssh://git@github.com/rsksmart/precompiled-abis.git#c99eb6017fde55f72232e63c6d9a47e6eec4c915", - "license": "ISC" + "node_modules/@rsksmart/bridge-transaction-parser/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==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@rsksmart/bridge-transaction-parser/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@rsksmart/bridge-transaction-parser/node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "license": "MIT" + }, + "node_modules/@rsksmart/bridge-transaction-parser/node_modules/ethers": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.16.0.tgz", + "integrity": "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A==", + "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/@rsksmart/bridge-transaction-parser/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" }, "node_modules/@rsksmart/btc-eth-unit-converter": { "version": "1.0.1", @@ -1353,6 +974,15 @@ "bs58check": "<3.0.0" } }, + "node_modules/@rsksmart/rootstock-transaction-helper": { + "version": "6.0.0", + "resolved": "git+ssh://git@github.com/rsksmart/rootstock-transaction-helper.git#cd7143cb44568c331fad2e7e8800a82214600125", + "license": "ISC", + "dependencies": { + "bn.js": "5.2.5", + "ethers": "6.17.0" + } + }, "node_modules/@rsksmart/rsk-precompiled-abis": { "version": "9.0.0-VETIVER", "resolved": "https://registry.npmjs.org/@rsksmart/rsk-precompiled-abis/-/rsk-precompiled-abis-9.0.0-VETIVER.tgz", @@ -1419,30 +1049,6 @@ "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", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "license": "MIT", - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, "node_modules/@types/bn.js": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", @@ -1452,18 +1058,6 @@ "@types/node": "*" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "license": "MIT", - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, "node_modules/@types/esrecurse": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", @@ -1478,12 +1072,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==", - "license": "MIT" - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1491,15 +1079,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { "version": "26.1.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", @@ -1518,15 +1097,6 @@ "@types/node": "*" } }, - "node_modules/@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/secp256k1": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.7.tgz", @@ -1891,25 +1461,6 @@ } } }, - "node_modules/abortcontroller-polyfill": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.8.tgz", - "integrity": "sha512-9f1iZ2uWh92VcrU9Y8x+LdM4DLj75VE0MJB8zuF1iUnroEptStw+DQ8EQPMUdfe5k+PkB1uUfDQfWbhstH8LrQ==", - "license": "MIT" - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/acorn": { "version": "8.17.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", @@ -1943,6 +1494,7 @@ "version": "6.15.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2007,30 +1559,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "license": "MIT", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2045,18 +1573,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==" }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "license": "MIT" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -2072,21 +1588,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "license": "MIT" - }, "node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", @@ -2105,50 +1606,12 @@ "safe-buffer": "^5.0.1" } }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "license": "BSD-3-Clause", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/bech32": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", "license": "MIT" }, - "node_modules/bignumber.js": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", - "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -2299,57 +1762,12 @@ "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", "license": "MIT" }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "license": "MIT" - }, "node_modules/bn.js": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.5.tgz", "integrity": "sha512-Vq886eXykuP5E6HcKSSStP3bJgrE6In5WKxVUvJ8XGpWWYs2xZHWqUwzCtGgEtBcxyd57KBFDPFoUfNzdaHCNg==", "license": "MIT" }, - "node_modules/body-parser": { - "version": "1.20.6", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz", - "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.15.1", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, "node_modules/brace-expansion": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", @@ -2434,115 +1852,12 @@ "base-x": "^5.0.0" } }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-to-arraybuffer": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", - "integrity": "sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ==", - "license": "MIT" - }, "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", "license": "MIT" }, - "node_modules/bufferutil": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz", - "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cacheable-lookup": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", - "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", - "license": "MIT", - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "license": "MIT", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", @@ -2602,12 +1917,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "license": "Apache-2.0" - }, "node_modules/chai": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", @@ -2702,41 +2011,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "license": "ISC" - }, - "node_modules/cids": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", - "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "deprecated": "This module has been superseded by the multiformats module", - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - }, - "engines": { - "node": ">=4.0.0", - "npm": ">=3.0.0" - } - }, - "node_modules/cids/node_modules/multicodec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", - "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", - "deprecated": "This module has been superseded by the multiformats module", - "license": "MIT", - "dependencies": { - "buffer": "^5.6.0", - "varint": "^5.0.0" - } - }, "node_modules/cipher-base": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.7.tgz", @@ -2751,12 +2025,6 @@ "node": ">= 0.10" } }, - "node_modules/class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", - "license": "MIT" - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2771,18 +2039,6 @@ "node": ">=12" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2810,18 +2066,6 @@ "node": ">=0.1.90" } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", @@ -2837,93 +2081,17 @@ "node": ">= 12" } }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-hash": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", - "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", - "license": "ISC", - "dependencies": { - "cids": "^0.7.1", - "multicodec": "^0.5.5", - "multihashes": "^0.4.15" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/convert-hex": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/convert-hex/-/convert-hex-0.1.0.tgz", "integrity": "sha512-w20BOb1PiR/sEJdS6wNrUjF5CSfscZFUp7R9NSlXH8h2wynzXVEPFPJECAnkNylZ+cvf3p7TyRUHggDmrwXT9A==" }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", - "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", - "license": "MIT" - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "license": "MIT" }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "license": "Apache-2.0", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -2951,15 +2119,6 @@ "sha.js": "^2.4.8" } }, - "node_modules/cross-fetch": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.1.0.tgz", - "integrity": "sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==", - "license": "MIT", - "dependencies": { - "node-fetch": "^2.7.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -2983,31 +2142,6 @@ "node": "*" } }, - "node_modules/d": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", - "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", - "license": "ISC", - "dependencies": { - "es5-ext": "^0.10.64", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -3052,42 +2186,6 @@ "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", "license": "MIT" }, - "node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-eql": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", @@ -3107,15 +2205,6 @@ "dev": true, "license": "MIT" }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -3133,34 +2222,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, "node_modules/dev-null": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dev-null/-/dev-null-0.1.1.tgz", @@ -3176,11 +2237,6 @@ "node": ">=0.3.1" } }, - "node_modules/dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" - }, "node_modules/dotenv": { "version": "17.4.2", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", @@ -3210,18 +2266,8 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "license": "MIT" - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "license": "MIT", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" }, "node_modules/ecpair": { "version": "3.0.1", @@ -3246,12 +2292,6 @@ "node": ">=14.0.0" } }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, "node_modules/elliptic": { "version": "6.6.1", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", @@ -3279,24 +2319,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -3327,52 +2349,6 @@ "node": ">= 0.4" } }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "hasInstallScript": true, - "license": "ISC", - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "license": "MIT" - }, - "node_modules/es6-symbol": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", - "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", - "license": "ISC", - "dependencies": { - "d": "^1.0.2", - "ext": "^1.7.0" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3382,12 +2358,6 @@ "node": ">=6" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -3507,21 +2477,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "license": "ISC", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", @@ -3586,66 +2541,6 @@ "node": ">=0.10.0" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eth-ens-namehash": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", - "license": "ISC", - "dependencies": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" - } - }, - "node_modules/eth-ens-namehash/node_modules/js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==", - "license": "MIT" - }, - "node_modules/eth-lib": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", - "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/eth-lib/node_modules/bn.js": { - "version": "4.12.5", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.5.tgz", - "integrity": "sha512-3aRg6/JxfffFD+OlOjOFR3Vo79l39ooBTFucxx+MT3dhCtzn3EmiUPQo+6/OZuI2jbXi3YKgmiTFBgChQMwIRQ==", - "license": "MIT" - }, - "node_modules/ethereum-bloom-filters": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", - "integrity": "sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "^1.4.0" - } - }, - "node_modules/ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha512-EoltVQTRNg2Uy4o84qpa2aXymXDJhxm7eos/ACOg0DG4baAbMjhbdAEsx9GeE8sC3XCxnYvrrzZDH8D8MtA2iQ==", - "license": "MIT" - }, "node_modules/ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -3680,38 +2575,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/ethereumjs-tx": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", - "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", - "deprecated": "New package name format for new versions: @ethereumjs/tx. Please update.", - "license": "MPL-2.0", - "dependencies": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "node_modules/ethereumjs-tx/node_modules/bn.js": { - "version": "4.12.5", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.5.tgz", - "integrity": "sha512-3aRg6/JxfffFD+OlOjOFR3Vo79l39ooBTFucxx+MT3dhCtzn3EmiUPQo+6/OZuI2jbXi3YKgmiTFBgChQMwIRQ==", - "license": "MIT" - }, - "node_modules/ethereumjs-tx/node_modules/ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, "node_modules/ethereumjs-util": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", @@ -3756,54 +2619,77 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/ethjs-unit": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", - "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", + "node_modules/ethers": { + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.17.0.tgz", + "integrity": "sha512-BpyrpIPJ3ydEVow8zGaz1DuPS7YU8DcWxuBnY9a0UA/lvAPwrMr+EPXsfrul628SRaekPNeIM4UFh/91GWZang==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], "license": "MIT", "dependencies": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" + "@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.21.0" }, "engines": { - "node": ">=6.5.0", - "npm": ">=3" + "node": ">=14.0.0" } }, - "node_modules/ethjs-unit/node_modules/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", - "license": "MIT" - }, - "node_modules/ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "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==", "license": "MIT", "dependencies": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" + "@noble/hashes": "1.3.2" }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "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==", + "license": "MIT", "engines": { - "node": ">=6.5.0", - "npm": ">=3" + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "license": "MIT", "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" + "undici-types": "~6.19.2" } }, - "node_modules/eventemitter3": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", - "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", + "node_modules/ethers/node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "license": "MIT" + }, + "node_modules/ethers/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "license": "MIT" }, "node_modules/evp_bytestokey": { @@ -3840,95 +2726,11 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/express": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", - "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "~1.20.5", - "content-disposition": "~0.5.4", - "content-type": "~1.0.4", - "cookie": "~0.7.1", - "cookie-signature": "~1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.3.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "~0.1.12", - "proxy-addr": "~2.0.7", - "qs": "~6.15.1", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "~0.19.0", - "serve-static": "~1.16.2", - "setprototypeof": "1.2.0", - "statuses": "~2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "license": "ISC", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "license": "MIT" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, "license": "MIT" }, "node_modules/fast-glob": { @@ -3965,6 +2767,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -4015,39 +2818,6 @@ "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", - "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "statuses": "~2.0.2", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, "node_modules/find": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", @@ -4165,53 +2935,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/form-data-encoder": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.1.tgz", - "integrity": "sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==", - "license": "MIT" - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/fs-extra": { "version": "11.3.6", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.6.tgz", @@ -4226,25 +2949,6 @@ "node": ">=14.14" } }, - "node_modules/fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "license": "ISC", - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "license": "ISC", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4342,6 +3046,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -4350,15 +3055,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/glob": { "version": "13.0.6", "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", @@ -4389,16 +3085,6 @@ "node": ">=10.13.0" } }, - "node_modules/global": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "license": "MIT", - "dependencies": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, "node_modules/globals": { "version": "17.7.0", "resolved": "https://registry.npmjs.org/globals/-/globals-17.7.0.tgz", @@ -4424,62 +3110,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-12.1.0.tgz", - "integrity": "sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==", - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^4.6.0", - "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "form-data-encoder": "1.7.1", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "license": "ISC", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "license": "MIT", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4613,78 +3249,18 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "license": "MIT", "bin": { - "he": "bin/he" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "license": "MIT", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", - "license": "BSD-2-Clause" - }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", - "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/http-https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", - "integrity": "sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==", - "license": "ISC" - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "he": "bin/he" } }, - "node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "license": "MIT", "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "node_modules/human-signals": { @@ -4697,59 +3273,6 @@ "node": ">=10.17.0" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/idna-uts46-hx": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", - "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", - "license": "MIT", - "dependencies": { - "punycode": "2.1.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/idna-uts46-hx/node_modules/punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -4787,15 +3310,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/is-arguments": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", @@ -4860,12 +3374,6 @@ "node": ">=8" } }, - "node_modules/is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", - "license": "MIT" - }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -4897,16 +3405,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", - "license": "MIT", - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4980,12 +3478,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "license": "MIT" - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -5010,12 +3502,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "license": "MIT" - }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -5065,28 +3551,18 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "license": "MIT" - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, "license": "MIT" }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -5096,12 +3572,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "license": "ISC" - }, "node_modules/jsonfile": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", @@ -5114,21 +3584,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "license": "MIT", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/jssha": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/jssha/-/jssha-3.3.2.tgz", @@ -5157,6 +3612,7 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -5238,18 +3694,6 @@ "get-func-name": "^2.0.1" } }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lru-cache": { "version": "11.5.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", @@ -5290,15 +3734,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -5307,15 +3742,6 @@ "node": ">= 0.10.0" } }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -5339,21 +3765,6 @@ "integrity": "sha512-XrNQvUbn1DL5hKNe46Ccs+Tu3/PYOlrcZILuGUhb95oKBPjc/nmIC8D462PQkipVDGKRvwhn+QFg2cCdIvmDJA==", "license": "MIT" }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micro-ftch": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", - "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==", - "license": "MIT" - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5368,39 +3779,6 @@ "node": ">=8.6" } }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -5411,24 +3789,6 @@ "node": ">=6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/min-document": { - "version": "2.19.2", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.2.tgz", - "integrity": "sha512-8S5I8db/uZN8r9HSLFVWPdJCvYOejMcEC82VIzNUc6Zkklf/d1gg2psfE79/vyhWOj4+J8MtwmoOz3TmvaGu5A==", - "license": "MIT", - "dependencies": { - "dom-walk": "^0.1.0" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -5456,15 +3816,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", @@ -5474,25 +3825,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "license": "MIT", - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/minizlib/node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "license": "ISC", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", @@ -5508,19 +3840,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==", - "deprecated": "This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.", - "license": "ISC", - "dependencies": { - "mkdirp": "*" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/mocha": { "version": "11.7.6", "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.6.tgz", @@ -5662,73 +3981,18 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mock-fs": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", - "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==", - "license": "MIT" - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", - "deprecated": "This module has been superseded by the multiformats module", - "license": "MIT", - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "node_modules/multicodec": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", - "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", - "deprecated": "This module has been superseded by the multiformats module", - "license": "MIT", - "dependencies": { - "varint": "^5.0.0" - } - }, - "node_modules/multihashes": { - "version": "0.4.21", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", - "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "multibase": "^0.7.0", - "varint": "^5.0.0" - } - }, - "node_modules/multihashes/node_modules/multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "deprecated": "This module has been superseded by the multiformats module", - "license": "MIT", - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, "node_modules/nan": { "version": "2.28.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.28.0.tgz", "integrity": "sha512-fTsDz99OTq2sVePhGdp4qQhggZFtKr64ZNVyVajRKtMOkJxYekplBh577PiJB12v/D3s2E5cGtOI45LWp6rnLQ==", "license": "MIT" }, - "node_modules/nano-json-stream-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", - "integrity": "sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==", - "license": "MIT" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5736,47 +4000,12 @@ "dev": true, "license": "MIT" }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "license": "ISC" - }, "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "license": "MIT" }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-gyp-build": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", @@ -5797,100 +4026,17 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/number-to-bn": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", - "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", - "license": "MIT", - "dependencies": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/number-to-bn/node_modules/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", - "license": "MIT" - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/oboe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.5.tgz", - "integrity": "sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==", - "license": "BSD", - "dependencies": { - "http-https": "^1.0.0" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, "license": "MIT", "dependencies": { - "ee-first": "1.1.1" + "path-key": "^3.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, "node_modules/once": { @@ -5945,15 +4091,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "license": "MIT", - "engines": { - "node": ">=12.20" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -5990,21 +4127,6 @@ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "license": "BlueOak-1.0.0" }, - "node_modules/parse-headers": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.6.tgz", - "integrity": "sha512-Tz11t3uKztEW5FEVZnj1ox8GKblWn+PvHY9TmJV5Mll2uHEwRdR/5Li1OlXoECjLYkApdhWy44ocONwXLiKO5A==", - "license": "MIT" - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -6039,12 +4161,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-to-regexp": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", - "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", - "license": "MIT" - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -6080,12 +4196,6 @@ "jssha": "^3.1.0" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "license": "MIT" - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -6139,60 +4249,17 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "license": "MIT" }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/psl": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", - "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "funding": { - "url": "https://github.com/sponsors/lupomontero" - } - }, - "node_modules/pump": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", - "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6207,36 +4274,6 @@ "bitcoin-ops": "^1.3.0" } }, - "node_modules/qs": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", - "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", - "license": "BSD-3-Clause", - "dependencies": { - "es-define-property": "^1.0.1", - "side-channel": "^1.1.1" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/query-string": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "license": "MIT", - "dependencies": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -6258,18 +4295,6 @@ ], "license": "MIT" }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -6279,30 +4304,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -6330,47 +4331,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "license": "Apache-2.0", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.5.tgz", - "integrity": "sha512-mzR4sElr1bfCaPJe7m8ilJ6ZXdDaGoObcYR0ZHSsktM/Lt21MVHj5De30GQH2eiZ1qGRTO7LCAzQsUeXTNexWQ==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.6" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6380,33 +4340,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "license": "MIT" - }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "license": "MIT", - "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/responselike/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -6449,15 +4382,6 @@ "rlp": "bin/rlp" } }, - "node_modules/rsk-transaction-helper": { - "version": "3.1.0", - "resolved": "git+ssh://git@github.com/rsksmart/rootstock-transaction-helper.git#6c368e265dd606a1b892b8a6ae7efe17bb05d4a0", - "license": "ISC", - "dependencies": { - "ethereumjs-tx": "^1.3.7", - "web3": "^1.8.1" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6519,12 +4443,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -6561,45 +4479,6 @@ "semver": "bin/semver" } }, - "node_modules/send": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", - "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.4.1", - "range-parser": "~1.2.1", - "statuses": "~2.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -6609,37 +4488,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/serve-static": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", - "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "~0.19.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/servify": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", - "license": "MIT", - "dependencies": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -6663,12 +4511,6 @@ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "license": "MIT" }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, "node_modules/sha.js": { "version": "2.4.12", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", @@ -6724,78 +4566,6 @@ "node": ">=18" } }, - "node_modules/side-channel": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", - "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4", - "side-channel-list": "^1.0.1", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -6803,49 +4573,6 @@ "dev": true, "license": "ISC" }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/simple-get": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.2.tgz", - "integrity": "sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==", - "license": "MIT", - "dependencies": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/simple-get/node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/solc": { "version": "0.8.36", "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.36.tgz", @@ -6870,47 +4597,13 @@ "node_modules/solc/node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "license": "MIT", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, "engines": { - "node": ">= 0.8" + "node": ">=0.6.0" } }, "node_modules/stream-line-wrapper": { @@ -6968,15 +4661,6 @@ "node": ">= 4.0.0" } }, - "node_modules/strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -7050,19 +4734,6 @@ "node": ">=6" } }, - "node_modules/strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", - "license": "MIT", - "dependencies": { - "is-hex-prefixed": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -7090,181 +4761,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/swarm-js": { - "version": "0.1.42", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.42.tgz", - "integrity": "sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==", - "license": "MIT", - "dependencies": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "eth-lib": "^0.1.26", - "fs-extra": "^4.0.2", - "got": "^11.8.5", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar": "^4.0.2", - "xhr-request": "^1.0.1" - } - }, - "node_modules/swarm-js/node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "license": "MIT", - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/swarm-js/node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "license": "MIT", - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/swarm-js/node_modules/fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/swarm-js/node_modules/got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/swarm-js/node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "license": "MIT", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/swarm-js/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/swarm-js/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/swarm-js/node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/swarm-js/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tar": { - "version": "4.4.19", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", - "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", - "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", - "license": "ISC", - "dependencies": { - "chownr": "^1.1.4", - "fs-minipass": "^1.2.7", - "minipass": "^2.9.0", - "minizlib": "^1.3.3", - "mkdirp": "^0.5.5", - "safe-buffer": "^5.2.1", - "yallist": "^3.1.1" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/tar/node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "license": "ISC", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/tar/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tiny-secp256k1": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-2.2.4.tgz", @@ -7321,63 +4817,17 @@ "node": ">=8.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "license": "BSD-3-Clause", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, "node_modules/traverse-chain": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", "integrity": "sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==", "license": "MIT" }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "license": "Unlicense" - }, - "node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "license": "ISC" + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", @@ -7401,19 +4851,6 @@ "node": ">=4" } }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -7428,15 +4865,6 @@ "node": ">= 0.4" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "license": "MIT", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typeforce": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", @@ -7487,12 +4915,6 @@ "node": ">=14.0.0" } }, - "node_modules/ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "license": "MIT" - }, "node_modules/undici-types": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", @@ -7508,43 +4930,16 @@ "node": ">= 10.0.0" } }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, - "node_modules/url-set-query": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", - "integrity": "sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==", - "license": "MIT" - }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", @@ -7570,15 +4965,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -7593,206 +4979,43 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.4.2.tgz", "integrity": "sha512-gjdCvJ6d3RyHAneqxMYMW9QMCwYMb3jpOO0IyHZV1bnRHFBHrX3VkIILt5XYR0WhwHiH7Mty8ovuPZ/O3gamrg==", - "license": "MIT", - "peerDependencies": { - "typescript": ">=5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", - "license": "MIT" - }, - "node_modules/varuint-bitcoin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-2.0.0.tgz", - "integrity": "sha512-6QZbU/rHO2ZQYpWFDALCDSRsXbAs1VOEmXAxtbtjLtKuMJ/FQ8YbhfxlaiKv5nklci0M6lZtlZyxo9Q+qNnyog==", - "license": "MIT", - "dependencies": { - "uint8array-tools": "^0.0.8" - } - }, - "node_modules/varuint-bitcoin/node_modules/uint8array-tools": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/uint8array-tools/-/uint8array-tools-0.0.8.tgz", - "integrity": "sha512-xS6+s8e0Xbx++5/0L+yyexukU7pz//Yg6IHg3BKhXotg1JcYtgxVcUctQ0HxLByiJzpAkNFawz1Nz5Xadzo82g==", - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/wait-for-port": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wait-for-port/-/wait-for-port-0.0.2.tgz", - "integrity": "sha512-W7KL4cRNcBlztqNPa4oD00wmgVvSpghJVmBNypj1QDQrXfZ1fYzcR2CzSORR5KJoIACnBQ2Ihz7LuGqUyk/PRg==", - "license": "MIT", - "bin": { - "wait-for-port": "bin/wait-for-port" - } - }, - "node_modules/web3": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.4.tgz", - "integrity": "sha512-kgJvQZjkmjOEKimx/tJQsqWfRDPTTcBfYPa9XletxuHLpHcXdx67w8EFn5AW3eVxCutE9dTVHgGa9VYe8vgsEA==", - "hasInstallScript": true, - "license": "LGPL-3.0", - "dependencies": { - "web3-bzz": "1.10.4", - "web3-core": "1.10.4", - "web3-eth": "1.10.4", - "web3-eth-personal": "1.10.4", - "web3-net": "1.10.4", - "web3-shh": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-bzz": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.4.tgz", - "integrity": "sha512-ZZ/X4sJ0Uh2teU9lAGNS8EjveEppoHNQiKlOXAjedsrdWuaMErBPdLQjXfcrYvN6WM6Su9PMsAxf3FXXZ+HwQw==", - "hasInstallScript": true, - "license": "LGPL-3.0", - "dependencies": { - "@types/node": "^12.12.6", - "got": "12.1.0", - "swarm-js": "^0.1.40" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-bzz/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "license": "MIT" - }, - "node_modules/web3-core": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.4.tgz", - "integrity": "sha512-B6elffYm81MYZDTrat7aEhnhdtVE3lDBUZft16Z8awYMZYJDbnykEbJVS+l3mnA7AQTnSDr/1MjWofGDLBJPww==", - "license": "LGPL-3.0", - "dependencies": { - "@types/bn.js": "^5.1.1", - "@types/node": "^12.12.6", - "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.4", - "web3-core-method": "1.10.4", - "web3-core-requestmanager": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-helpers": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.4.tgz", - "integrity": "sha512-r+L5ylA17JlD1vwS8rjhWr0qg7zVoVMDvWhajWA5r5+USdh91jRUYosp19Kd1m2vE034v7Dfqe1xYRoH2zvG0g==", - "license": "LGPL-3.0", - "dependencies": { - "web3-eth-iban": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-method": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.4.tgz", - "integrity": "sha512-uZTb7flr+Xl6LaDsyTeE2L1TylokCJwTDrIVfIfnrGmnwLc6bmTWCCrm71sSrQ0hqs6vp/MKbQYIYqUN0J8WyA==", - "license": "LGPL-3.0", - "dependencies": { - "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.4", - "web3-core-promievent": "1.10.4", - "web3-core-subscriptions": "1.10.4", - "web3-utils": "1.10.4" + "license": "MIT", + "peerDependencies": { + "typescript": ">=5" }, - "engines": { - "node": ">=8.0.0" + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/web3-core-promievent": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.4.tgz", - "integrity": "sha512-2de5WnJQ72YcIhYwV/jHLc4/cWJnznuoGTJGD29ncFQHAfwW/MItHFSVKPPA5v8AhJe+r6y4Y12EKvZKjQVBvQ==", - "license": "LGPL-3.0", + "node_modules/varuint-bitcoin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-2.0.0.tgz", + "integrity": "sha512-6QZbU/rHO2ZQYpWFDALCDSRsXbAs1VOEmXAxtbtjLtKuMJ/FQ8YbhfxlaiKv5nklci0M6lZtlZyxo9Q+qNnyog==", + "license": "MIT", "dependencies": { - "eventemitter3": "4.0.4" - }, - "engines": { - "node": ">=8.0.0" + "uint8array-tools": "^0.0.8" } }, - "node_modules/web3-core-requestmanager": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.4.tgz", - "integrity": "sha512-vqP6pKH8RrhT/2MoaU+DY/OsYK9h7HmEBNCdoMj+4ZwujQtw/Mq2JifjwsJ7gits7Q+HWJwx8q6WmQoVZAWugg==", - "license": "LGPL-3.0", - "dependencies": { - "util": "^0.12.5", - "web3-core-helpers": "1.10.4", - "web3-providers-http": "1.10.4", - "web3-providers-ipc": "1.10.4", - "web3-providers-ws": "1.10.4" - }, + "node_modules/varuint-bitcoin/node_modules/uint8array-tools": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/uint8array-tools/-/uint8array-tools-0.0.8.tgz", + "integrity": "sha512-xS6+s8e0Xbx++5/0L+yyexukU7pz//Yg6IHg3BKhXotg1JcYtgxVcUctQ0HxLByiJzpAkNFawz1Nz5Xadzo82g==", + "license": "MIT", "engines": { - "node": ">=8.0.0" + "node": ">=14.0.0" } }, - "node_modules/web3-core-subscriptions": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.4.tgz", - "integrity": "sha512-o0lSQo/N/f7/L76C0HV63+S54loXiE9fUPfHFcTtpJRQNDBVsSDdWRdePbWwR206XlsBqD5VHApck1//jEafTw==", - "license": "LGPL-3.0", - "dependencies": { - "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" + "node_modules/wait-for-port": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wait-for-port/-/wait-for-port-0.0.2.tgz", + "integrity": "sha512-W7KL4cRNcBlztqNPa4oD00wmgVvSpghJVmBNypj1QDQrXfZ1fYzcR2CzSORR5KJoIACnBQ2Ihz7LuGqUyk/PRg==", + "license": "MIT", + "bin": { + "wait-for-port": "bin/wait-for-port" } }, - "node_modules/web3-core/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "license": "MIT" - }, "node_modules/web3-errors": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/web3-errors/-/web3-errors-1.3.1.tgz", @@ -7806,29 +5029,6 @@ "npm": ">=6.12.0" } }, - "node_modules/web3-eth": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.4.tgz", - "integrity": "sha512-Sql2kYKmgt+T/cgvg7b9ce24uLS7xbFrxE4kuuor1zSCGrjhTJ5rRNG8gTJUkAJGKJc7KgnWmgW+cOfMBPUDSA==", - "license": "LGPL-3.0", - "dependencies": { - "web3-core": "1.10.4", - "web3-core-helpers": "1.10.4", - "web3-core-method": "1.10.4", - "web3-core-subscriptions": "1.10.4", - "web3-eth-abi": "1.10.4", - "web3-eth-accounts": "1.10.4", - "web3-eth-contract": "1.10.4", - "web3-eth-ens": "1.10.4", - "web3-eth-iban": "1.10.4", - "web3-eth-personal": "1.10.4", - "web3-net": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/web3-eth-abi": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-4.4.1.tgz", @@ -7893,243 +5093,6 @@ "npm": ">=6.12.0" } }, - "node_modules/web3-eth-accounts": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.10.4.tgz", - "integrity": "sha512-ysy5sVTg9snYS7tJjxVoQAH6DTOTkRGR8emEVCWNGLGiB9txj+qDvSeT0izjurS/g7D5xlMAgrEHLK1Vi6I3yg==", - "license": "LGPL-3.0", - "dependencies": { - "@ethereumjs/common": "2.6.5", - "@ethereumjs/tx": "3.5.2", - "@ethereumjs/util": "^8.1.0", - "eth-lib": "0.2.8", - "scrypt-js": "^3.0.1", - "uuid": "^9.0.0", - "web3-core": "1.10.4", - "web3-core-helpers": "1.10.4", - "web3-core-method": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-accounts/node_modules/bn.js": { - "version": "4.12.5", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.5.tgz", - "integrity": "sha512-3aRg6/JxfffFD+OlOjOFR3Vo79l39ooBTFucxx+MT3dhCtzn3EmiUPQo+6/OZuI2jbXi3YKgmiTFBgChQMwIRQ==", - "license": "MIT" - }, - "node_modules/web3-eth-accounts/node_modules/eth-lib": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", - "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/web3-eth-contract": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.10.4.tgz", - "integrity": "sha512-Q8PfolOJ4eV9TvnTj1TGdZ4RarpSLmHnUnzVxZ/6/NiTfe4maJz99R0ISgwZkntLhLRtw0C7LRJuklzGYCNN3A==", - "license": "LGPL-3.0", - "dependencies": { - "@types/bn.js": "^5.1.1", - "web3-core": "1.10.4", - "web3-core-helpers": "1.10.4", - "web3-core-method": "1.10.4", - "web3-core-promievent": "1.10.4", - "web3-core-subscriptions": "1.10.4", - "web3-eth-abi": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-contract/node_modules/web3-eth-abi": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.4.tgz", - "integrity": "sha512-cZ0q65eJIkd/jyOlQPDjr8X4fU6CRL1eWgdLwbWEpo++MPU/2P4PFk5ZLAdye9T5Sdp+MomePPJ/gHjLMj2VfQ==", - "license": "LGPL-3.0", - "dependencies": { - "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-ens": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.10.4.tgz", - "integrity": "sha512-LLrvxuFeVooRVZ9e5T6OWKVflHPFgrVjJ/jtisRWcmI7KN/b64+D/wJzXqgmp6CNsMQcE7rpmf4CQmJCrTdsgg==", - "license": "LGPL-3.0", - "dependencies": { - "content-hash": "^2.5.2", - "eth-ens-namehash": "2.0.8", - "web3-core": "1.10.4", - "web3-core-helpers": "1.10.4", - "web3-core-promievent": "1.10.4", - "web3-eth-abi": "1.10.4", - "web3-eth-contract": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-ens/node_modules/web3-eth-abi": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.4.tgz", - "integrity": "sha512-cZ0q65eJIkd/jyOlQPDjr8X4fU6CRL1eWgdLwbWEpo++MPU/2P4PFk5ZLAdye9T5Sdp+MomePPJ/gHjLMj2VfQ==", - "license": "LGPL-3.0", - "dependencies": { - "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-iban": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.4.tgz", - "integrity": "sha512-0gE5iNmOkmtBmbKH2aTodeompnNE8jEyvwFJ6s/AF6jkw9ky9Op9cqfzS56AYAbrqEFuClsqB/AoRves7LDELw==", - "license": "LGPL-3.0", - "dependencies": { - "bn.js": "^5.2.1", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-personal": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.4.tgz", - "integrity": "sha512-BRa/hs6jU1hKHz+AC/YkM71RP3f0Yci1dPk4paOic53R4ZZG4MgwKRkJhgt3/GPuPliwS46f/i5A7fEGBT4F9w==", - "license": "LGPL-3.0", - "dependencies": { - "@types/node": "^12.12.6", - "web3-core": "1.10.4", - "web3-core-helpers": "1.10.4", - "web3-core-method": "1.10.4", - "web3-net": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "license": "MIT" - }, - "node_modules/web3-eth/node_modules/web3-eth-abi": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.4.tgz", - "integrity": "sha512-cZ0q65eJIkd/jyOlQPDjr8X4fU6CRL1eWgdLwbWEpo++MPU/2P4PFk5ZLAdye9T5Sdp+MomePPJ/gHjLMj2VfQ==", - "license": "LGPL-3.0", - "dependencies": { - "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-net": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.4.tgz", - "integrity": "sha512-mKINnhOOnZ4koA+yV2OT5s5ztVjIx7IY9a03w6s+yao/BUn+Luuty0/keNemZxTr1E8Ehvtn28vbOtW7Ids+Ow==", - "license": "LGPL-3.0", - "dependencies": { - "web3-core": "1.10.4", - "web3-core-method": "1.10.4", - "web3-utils": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-http": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.4.tgz", - "integrity": "sha512-m2P5Idc8hdiO0l60O6DSCPw0kw64Zgi0pMjbEFRmxKIck2Py57RQMu4bxvkxJwkF06SlGaEQF8rFZBmuX7aagQ==", - "license": "LGPL-3.0", - "dependencies": { - "abortcontroller-polyfill": "^1.7.5", - "cross-fetch": "^4.0.0", - "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-ipc": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.4.tgz", - "integrity": "sha512-YRF/bpQk9z3WwjT+A6FI/GmWRCASgd+gC0si7f9zbBWLXjwzYAKG73bQBaFRAHex1hl4CVcM5WUMaQXf3Opeuw==", - "license": "LGPL-3.0", - "dependencies": { - "oboe": "2.1.5", - "web3-core-helpers": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-ws": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.4.tgz", - "integrity": "sha512-j3FBMifyuFFmUIPVQR4pj+t5ILhAexAui0opgcpu9R5LxQrLRUZxHSnU+YO25UycSOa/NAX8A+qkqZNpcFAlxA==", - "license": "LGPL-3.0", - "dependencies": { - "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.4", - "websocket": "^1.0.32" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-shh": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.4.tgz", - "integrity": "sha512-cOH6iFFM71lCNwSQrC3niqDXagMqrdfFW85hC9PFUrAr3PUrIem8TNstTc3xna2bwZeWG6OBy99xSIhBvyIACw==", - "hasInstallScript": true, - "license": "LGPL-3.0", - "dependencies": { - "web3-core": "1.10.4", - "web3-core-method": "1.10.4", - "web3-core-subscriptions": "1.10.4", - "web3-net": "1.10.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/web3-types": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.10.0.tgz", @@ -8140,49 +5103,6 @@ "npm": ">=6.12.0" } }, - "node_modules/web3-utils": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", - "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", - "license": "LGPL-3.0", - "dependencies": { - "@ethereumjs/util": "^8.1.0", - "bn.js": "^5.2.1", - "ethereum-bloom-filters": "^1.0.6", - "ethereum-cryptography": "^2.1.2", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "utf8": "3.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-utils/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==", - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/web3-utils/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "license": "MIT", - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - }, "node_modules/web3-validator": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/web3-validator/-/web3-validator-2.0.6.tgz", @@ -8224,54 +5144,6 @@ "@scure/bip39": "1.3.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/websocket": { - "version": "1.0.35", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.35.tgz", - "integrity": "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==", - "license": "Apache-2.0", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.63", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8375,56 +5247,24 @@ "license": "ISC" }, "node_modules/ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "license": "MIT", - "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, - "node_modules/ws/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "license": "MIT", - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/xhr-request": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", - "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", - "license": "MIT", - "dependencies": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" - } - }, - "node_modules/xhr-request-promise": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", - "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "version": "8.21.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz", + "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==", "license": "MIT", - "dependencies": { - "xhr-request": "^1.1.0" + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/xml": { @@ -8433,15 +5273,6 @@ "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", "license": "MIT" }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -8451,22 +5282,6 @@ "node": ">=10" } }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "license": "MIT", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "license": "ISC" - }, "node_modules/yargs": { "version": "17.7.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", diff --git a/package.json b/package.json index bb535747..1809345a 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,13 @@ "dependencies": { "@noble/secp256k1": "3.1.0", "@rsksmart/bridge-state-data-parser": "2.3.0", - "@rsksmart/bridge-transaction-parser": "github:rsksmart/bridge-transaction-parser#v1.2.0", + "@rsksmart/bridge-transaction-parser": "2.2.0", "@rsksmart/btc-eth-unit-converter": "1.0.1", "@rsksmart/btc-rsk-derivation": "0.0.2", "@rsksmart/btc-transaction-helper": "git+https://git@github.com/rsksmart/btc-transaction-helper.git#v5.0.0-rc", "@rsksmart/pmt-builder": "3.0.1", "@rsksmart/powpeg-redeemscript-parser": "github:rsksmart/powpeg-redeemscript-parser#fbe3b981b3f768396833f5f832526a9751098089", + "@rsksmart/rootstock-transaction-helper": "github:rsksmart/rootstock-transaction-helper#v6.0.0", "@rsksmart/rsk-precompiled-abis": "9.0.0-VETIVER", "bitcoinjs-lib": "7.0.1", "bn.js": "5.2.5", @@ -42,6 +43,7 @@ "dev-null": "0.1.1", "dotenv": "17.4.2", "ecpair": "3.0.1", + "ethers": "6.17.0", "find": "0.3.0", "fs-extra": "11.3.6", "glob": "13.0.6", @@ -51,7 +53,6 @@ "mocha-junit-reporter": "2.2.1", "mocha-multi-reporters": "1.5.1", "pegin-address-verificator": "git+https://git@github.com/rsksmart/pegin-address-verifier#v0.4.0", - "rsk-transaction-helper": "git+https://github.com/rsksmart/rootstock-transaction-helper#v3.1.0", "solc": "0.8.36", "stream-line-wrapper": "0.1.1", "tiny-secp256k1": "2.2.4", @@ -67,6 +68,7 @@ "shelljs": "0.10.0" }, "overrides": { - "diff": "8.0.3" + "diff": "8.0.3", + "ws": "8.21.1" } } diff --git a/tests/01_powpeg/extra/01-vote_for_locking_cap_to_21m.js b/tests/01_powpeg/extra/01-vote_for_locking_cap_to_21m.js index 8ea32873..53bcf49e 100644 --- a/tests/01_powpeg/extra/01-vote_for_locking_cap_to_21m.js +++ b/tests/01_powpeg/extra/01-vote_for_locking_cap_to_21m.js @@ -17,9 +17,7 @@ describe('@regression @bridge-methods Vote for locking cap to the max 21 million it('should increase locking cap to the max 21 million btc', async () => { const rskTxHelper = rskTxHelpers[0]; - const authAddress = await rskTxHelper - .getClient() - .eth.personal.importRawKey(lockingCapAuthorizerPrivateKey, ''); + const authAddress = await rskTxHelper.importAccount(lockingCapAuthorizerPrivateKey); await rskUtils.sendFromCow(rskTxHelper, authAddress, btcToWeis(1)); const bridge = await getBridge(rskTxHelper.getClient()); @@ -28,7 +26,7 @@ describe('@regression @bridge-methods Vote for locking cap to the max 21 million const targetLockingCapInSatoshis = Number(btcToSatoshis(MAX_BTC)); - let currentLockingCapValueInSatoshis = Number(await bridge.methods.getLockingCap().call()); + let currentLockingCapValueInSatoshis = Number(await bridge.getLockingCap()); let nextIncrement = 0; @@ -38,11 +36,15 @@ describe('@regression @bridge-methods Vote for locking cap to the max 21 million // Ensuring that the next increment is not greater than the target locking cap. nextIncrement = Math.min(nextIncrement, targetLockingCapInSatoshis); - const increaseLockingCapMethod = bridge.methods.increaseLockingCap(nextIncrement); - - await rskUtils.sendTransaction(rskTxHelper, increaseLockingCapMethod, authAddress); + await rskUtils.sendTransaction( + rskTxHelper, + bridge, + 'increaseLockingCap', + [nextIncrement], + authAddress + ); - currentLockingCapValueInSatoshis = Number(await bridge.methods.getLockingCap().call()); + currentLockingCapValueInSatoshis = Number(await bridge.getLockingCap()); // Ensuring that the locking cap is being increased on every iteration. expect(currentLockingCapValueInSatoshis).to.be.equal( @@ -51,7 +53,7 @@ describe('@regression @bridge-methods Vote for locking cap to the max 21 million ); } - const finalLockingCapValueInSatoshis = Number(await bridge.methods.getLockingCap().call()); + const finalLockingCapValueInSatoshis = Number(await bridge.getLockingCap()); expect(finalLockingCapValueInSatoshis).to.be.equal(targetLockingCapInSatoshis); }); diff --git a/tests/01_powpeg/extra/02-fee_per_kb.js b/tests/01_powpeg/extra/02-fee_per_kb.js index 88a7c530..affedf94 100644 --- a/tests/01_powpeg/extra/02-fee_per_kb.js +++ b/tests/01_powpeg/extra/02-fee_per_kb.js @@ -21,7 +21,7 @@ describe('@regression @bridge-methods Fee per kb change voting', function () { }); it('should have a default fee per kb of millicoin', async () => { - const feePerKb = await bridge.methods.getFeePerKb().call(); + const feePerKb = await bridge.getFeePerKb(); expect(Number(feePerKb)).to.equal(GENESIS_FEE_PER_KB); }); @@ -29,12 +29,12 @@ describe('@regression @bridge-methods Fee per kb change voting', function () { const newFeePerKb = Number(btcToSatoshis(0.005)); // A read-only call needs no account in the node wallet; `from` is just the simulated sender. - const result = await bridge.methods - .voteFeePerKbChange(newFeePerKb) - .call({ from: RANDOM_ADDR }); + const result = await bridge.voteFeePerKbChange.staticCall(newFeePerKb, { + from: RANDOM_ADDR, + }); expect(Number(result)).to.equal(FEE_PER_KB_RESPONSE_CODES.UNAUTHORIZED_CALLER); - const feePerKb = await bridge.methods.getFeePerKb().call(); + const feePerKb = await bridge.getFeePerKb(); expect(Number(feePerKb)).to.equal(GENESIS_FEE_PER_KB); }); @@ -47,7 +47,7 @@ describe('@regression @bridge-methods Fee per kb change voting', function () { FEE_PER_KB_RESPONSE_CODES.EXCESSIVE_FEE_VOTED ); - const feePerKb = await bridge.methods.getFeePerKb().call(); + const feePerKb = await bridge.getFeePerKb(); expect(Number(feePerKb)).to.equal(GENESIS_FEE_PER_KB); }); diff --git a/tests/01_powpeg/extra/03-powpeg_redeem_script.js b/tests/01_powpeg/extra/03-powpeg_redeem_script.js index 74699bdc..6cf546c6 100644 --- a/tests/01_powpeg/extra/03-powpeg_redeem_script.js +++ b/tests/01_powpeg/extra/03-powpeg_redeem_script.js @@ -21,12 +21,8 @@ describe('@regression @bridge-methods Calling getActivePowpegRedeemScript method it('should return the active powpeg redeem script', async () => { try { - const activePowpegRedeemScript = await bridge.methods - .getActivePowpegRedeemScript() - .call(); - const activeFederationAddressFromBridge = await bridge.methods - .getFederationAddress() - .call(); + const activePowpegRedeemScript = await bridge.getActivePowpegRedeemScript(); + const activeFederationAddressFromBridge = await bridge.getFederationAddress(); // Build the expected redeem script from the active federation public keys const activeFederationBtcPublicKeys = await getFedsPubKeys(bridge); diff --git a/tests/01_powpeg/extra/07-lock_whitelist_fork.js b/tests/01_powpeg/extra/07-lock_whitelist_fork.js index 61815901..1de9e250 100644 --- a/tests/01_powpeg/extra/07-lock_whitelist_fork.js +++ b/tests/01_powpeg/extra/07-lock_whitelist_fork.js @@ -43,10 +43,10 @@ describe('@regression @bridge-methods Whitelist methods tests', () => { const secondAddressEntry = WHITELIST_ADDRESSES_ENTRIES[1]; const address = secondAddressEntry[0]; const maxTransferValue = secondAddressEntry[1]; - const getLockWhitelistEntryByAddressMethod = - bridge.methods.getLockWhitelistEntryByAddress(address); return contractMethodAssertions.assertContractCallReturns( - getLockWhitelistEntryByAddressMethod, + bridge, + 'getLockWhitelistEntryByAddress', + [address], maxTransferValue.toString() ); }); @@ -62,10 +62,9 @@ describe('@regression @bridge-methods Whitelist methods tests', () => { const firstWhitelistAddressEntry = WHITELIST_ADDRESSES_ENTRIES[0]; const address = firstWhitelistAddressEntry[0]; const maxTransferValue = firstWhitelistAddressEntry[1]; - const addLockWhitelistAddressMethod = bridge.methods.addLockWhitelistAddress( + return contractMethodAssertions.assertContractCallFails(bridge, 'addLockWhitelistAddress', [ address, - maxTransferValue - ); - return contractMethodAssertions.assertContractCallFails(addLockWhitelistAddressMethod); + maxTransferValue, + ]); }); }); diff --git a/tests/01_powpeg/extra/08-fed_pubkeys_fork.js b/tests/01_powpeg/extra/08-fed_pubkeys_fork.js index 279a4ce1..3cef7272 100644 --- a/tests/01_powpeg/extra/08-fed_pubkeys_fork.js +++ b/tests/01_powpeg/extra/08-fed_pubkeys_fork.js @@ -23,29 +23,25 @@ describe('@regression @bridge-methods Bridge federator methods tests', () => { }); it('method getFederatorPublicKey should NOT work', () => { - return assertContractCallFails(bridge.methods.getFederatorPublicKey(0)); + return assertContractCallFails(bridge, 'getFederatorPublicKey', [0]); }); it('method getFederatorPublicKeyOfType should work', () => { return assertContractCallReturnsWithCallback( - bridge.methods.getFederatorPublicKeyOfType(0, KEY_TYPE_BTC), + bridge, + 'getFederatorPublicKeyOfType', + [0, KEY_TYPE_BTC], assertIsPublicKey ); }); it('method addFederatorPublicKey should NOT work', () => { - return assertContractCallFails(bridge.methods.addFederatorPublicKey(RANDOM_PUBLIC_KEY), { + return assertContractCallFails(bridge, 'addFederatorPublicKey', [RANDOM_PUBLIC_KEY], { from: fedChangeAddress, }); }); it('method addFederatorPublicKeyMultikey should work', () => { - const addFederatorPublicKeyMultikeyMethod = bridge.methods.addFederatorPublicKeyMultikey( - RANDOM_PUBLIC_KEY, - RANDOM_PUBLIC_KEY, - RANDOM_PUBLIC_KEY - ); - const checkCallback = (result) => expect(Number(result)).to.equal(-1); const callParams = { @@ -53,7 +49,9 @@ describe('@regression @bridge-methods Bridge federator methods tests', () => { }; return assertContractCallReturnsWithCallback( - addFederatorPublicKeyMultikeyMethod, + bridge, + 'addFederatorPublicKeyMultikey', + [RANDOM_PUBLIC_KEY, RANDOM_PUBLIC_KEY, RANDOM_PUBLIC_KEY], checkCallback, callParams ); diff --git a/tests/01_powpeg/extra/09-coinbase_information.js b/tests/01_powpeg/extra/09-coinbase_information.js index 57e89e55..b1ea9119 100644 --- a/tests/01_powpeg/extra/09-coinbase_information.js +++ b/tests/01_powpeg/extra/09-coinbase_information.js @@ -57,18 +57,17 @@ describe('@regression @bridge-methods Calling coinbase information methods', () const bridge = await getBridge(rskTxHelper.getClient()); - const registerBtcCoinbaseTransactionMethod = - bridge.methods.registerBtcCoinbaseTransaction( + const txReceipt = await rskUtils.sendTransaction( + rskTxHelper, + bridge, + 'registerBtcCoinbaseTransaction', + [ ensure0x(coinbaseTxWithoutWitness.toHex()), ensure0x(blockHash[0]), ensure0x(pmt), ensure0x(witnessReservedValue), - ensure0x(witnessReservedValue) - ); - - const txReceipt = await rskUtils.sendTransaction( - rskTxHelper, - registerBtcCoinbaseTransactionMethod, + ensure0x(witnessReservedValue), + ], rskTxSenderAddress ); @@ -76,8 +75,8 @@ describe('@regression @bridge-methods Calling coinbase information methods', () const hash = ensure0x(blockHash[0]); - const hasBtcBlockCoinbaseTransactionInformationMethod = - bridge.methods.hasBtcBlockCoinbaseTransactionInformation(hash).call; + const hasBtcBlockCoinbaseTransactionInformationMethod = () => + bridge.hasBtcBlockCoinbaseTransactionInformation(hash); const check = (resultSoFar, currentAttempts) => { console.log( diff --git a/tests/01_powpeg/extra/12-block-header-precompile.js b/tests/01_powpeg/extra/12-block-header-precompile.js index f352e1df..987a8055 100644 --- a/tests/01_powpeg/extra/12-block-header-precompile.js +++ b/tests/01_powpeg/extra/12-block-header-precompile.js @@ -2,6 +2,7 @@ const chai = require('chai'); const expect = chai.expect; chai.use(require('chai-as-promised')); const BN = require('bn.js'); +const { ethers } = require('ethers'); const { getRskTransactionHelper } = require('../../../lib/rsk-tx-helper-provider'); const { @@ -80,14 +81,15 @@ describe('@regression @bridge-methods @precompiled BlockHeader native precompile before(async () => { rskTxHelper = getRskTransactionHelper(); - blockHeader = new (rskTxHelper.getClient().eth.Contract)( + blockHeader = new ethers.Contract( + BLOCK_HEADER_ADDRESS, blockHeaderAbi, - BLOCK_HEADER_ADDRESS + rskTxHelper.getClient() ); }); it('should use the BlockHeader native address from @rsksmart/rsk-precompiled-abis', () => { - expect(blockHeader.options.address.toLowerCase()).to.equal( + expect(blockHeader.target.toLowerCase()).to.equal( BLOCK_HEADER_PRECOMPILE_ADDRESS.toLowerCase() ); expect(BLOCK_HEADER_ADDRESS.toLowerCase()).to.equal( @@ -98,39 +100,40 @@ describe('@regression @bridge-methods @precompiled BlockHeader native precompile describe('alignment with eth_getBlockByNumber', () => { [0, 1, 2].forEach((blockDepth) => { it(`should decode header fields consistently at blockDepth ${blockDepth}`, async () => { - const latestBlockNumber = await rskTxHelper.getClient().eth.getBlockNumber(); + const latestBlockNumber = await rskTxHelper.getClient().getBlockNumber(); const targetBlockNumber = rpcBlockNumberForDepth(latestBlockNumber, blockDepth); expect(targetBlockNumber).to.be.at.least( 0, 'chain must be long enough for this depth at the tip' ); - const block = await rskTxHelper.getClient().eth.getBlock(targetBlockNumber); + // Fetched as the raw JSON-RPC response (not ethers' parsed `Block`, which only + // exposes standard Ethereum fields and silently drops RSK-specific ones like + // `minimumGasPrice`/`totalDifficulty`) so every field below stays comparable. + const block = await rskTxHelper + .getClient() + .send('eth_getBlockByNumber', [ethers.toQuantity(targetBlockNumber), false]); - const coinbaseBytes = await blockHeader.methods - .getCoinbaseAddress(blockDepth) - .call(); + const coinbaseBytes = await blockHeader.getCoinbaseAddress(blockDepth); expect(bytesHexToAddressHex(coinbaseBytes)).to.equal(block.miner.toLowerCase()); - const hashBytes = await blockHeader.methods.getBlockHash(blockDepth).call(); + const hashBytes = await blockHeader.getBlockHash(blockDepth); expect(bytesHexToBlockHashHex(hashBytes)).to.equal(block.hash.toLowerCase()); - const gasLimitBytes = await blockHeader.methods.getGasLimit(blockDepth).call(); + const gasLimitBytes = await blockHeader.getGasLimit(blockDepth); expect(bnFromUnsignedBytesHex(gasLimitBytes).eq(bnFromRpcQuantity(block.gasLimit))) .to.be.true; - const gasUsedBytes = await blockHeader.methods.getGasUsed(blockDepth).call(); + const gasUsedBytes = await blockHeader.getGasUsed(blockDepth); expect(bnFromUnsignedBytesHex(gasUsedBytes).eq(bnFromRpcQuantity(block.gasUsed))).to .be.true; - const difficultyBytes = await blockHeader.methods.getDifficulty(blockDepth).call(); + const difficultyBytes = await blockHeader.getDifficulty(blockDepth); expect( bnFromUnsignedBytesHex(difficultyBytes).eq(bnFromRpcQuantity(block.difficulty)) ).to.be.true; - const minGasPriceBytes = await blockHeader.methods - .getMinGasPrice(blockDepth) - .call(); + const minGasPriceBytes = await blockHeader.getMinGasPrice(blockDepth); const rpcMinGas = block.minimumGasPrice == null ? null : bnFromRpcQuantity(block.minimumGasPrice); const mgpBn = bnFromUnsignedBytesHex(minGasPriceBytes); @@ -140,25 +143,18 @@ describe('@regression @bridge-methods @precompiled BlockHeader native precompile expect(mgpBn != null || isEmptyBytes(minGasPriceBytes)).to.be.true; } - const btcHeaderBytes = await blockHeader.methods - .getBitcoinHeader(blockDepth) - .call(); + const btcHeaderBytes = await blockHeader.getBitcoinHeader(blockDepth); expect(removePrefix0x(btcHeaderBytes).length).to.be.at.least( 80, 'merged-mining Bitcoin header is expected to be at least 80 bytes on RSK' ); - const mergedTagsBytes = await blockHeader.methods - .getMergedMiningTags(blockDepth) - .call(); + const mergedTagsBytes = await blockHeader.getMergedMiningTags(blockDepth); expect(mergedTagsBytes).to.be.a('string'); - const cumulativeWorkBytes = await blockHeader.methods - .getCumulativeWork(blockDepth) - .call(); - const difficultyWithUnclesBytes = await blockHeader.methods - .getDifficultyWithUncles(blockDepth) - .call(); + const cumulativeWorkBytes = await blockHeader.getCumulativeWork(blockDepth); + const difficultyWithUnclesBytes = + await blockHeader.getDifficultyWithUncles(blockDepth); const rpcTotalDiffBn = bnFromRpcQuantity(block.totalDifficulty); expect( @@ -177,24 +173,24 @@ describe('@regression @bridge-methods @precompiled BlockHeader native precompile describe('getUncleCoinbaseAddress', () => { it('should accept two int256 arguments and return empty bytes when no uncle exists at index 0', async () => { - const uncleCoinbase = await blockHeader.methods.getUncleCoinbaseAddress(0, 0).call(); + const uncleCoinbase = await blockHeader.getUncleCoinbaseAddress(0, 0); expect(isEmptyBytes(uncleCoinbase)).to.be.true; }); it('should return empty bytes when uncle index is out of range', async () => { - const uncleCoinbase = await blockHeader.methods.getUncleCoinbaseAddress(0, 99).call(); + const uncleCoinbase = await blockHeader.getUncleCoinbaseAddress(0, 99); expect(isEmptyBytes(uncleCoinbase)).to.be.true; }); }); describe('edge cases for blockDepth', () => { it(`should return empty bytes when blockDepth is >= ${MAX_BLOCK_HEADER_DEPTH} (max depth)`, async () => { - const blockHash = await blockHeader.methods.getBlockHash(MAX_BLOCK_HEADER_DEPTH).call(); + const blockHash = await blockHeader.getBlockHash(MAX_BLOCK_HEADER_DEPTH); expect(isEmptyBytes(blockHash)).to.be.true; }); it('should reject eth_call when blockDepth is negative (int256)', async () => { - await expect(blockHeader.methods.getGasUsed(-1).call()).to.be.rejected; + await expect(blockHeader.getGasUsed(-1)).to.be.rejected; }); }); }); diff --git a/tests/01_powpeg/extra/13-registerFastBridgeBtcTransaction_user_call.js b/tests/01_powpeg/extra/13-registerFastBridgeBtcTransaction_user_call.js index 115797a8..3699cdd8 100644 --- a/tests/01_powpeg/extra/13-registerFastBridgeBtcTransaction_user_call.js +++ b/tests/01_powpeg/extra/13-registerFastBridgeBtcTransaction_user_call.js @@ -1,4 +1,5 @@ const expect = require('chai').expect; +const { ethers } = require('ethers'); const { getRskTransactionHelpers } = require('../../../lib/rsk-tx-helper-provider'); const { getBridge } = require('../../../lib/bridge-provider'); const { getBtcClient } = require('../../../lib/btc-client-provider'); @@ -19,24 +20,22 @@ describe('@regression @flyover Calling registerFastBridgeBtcTransaction', functi }); it('should return error when user calling registerFastBridgeBtcTransaction method', async () => { - const randomHex = rskTxHelper.getClient().utils.randomHex; + const randomHex = (size) => ethers.hexlify(ethers.randomBytes(size)); const stringHex = randomHex(32); const randomAddress = randomHex(20); const btcAddress = (await btcTxHelper.generateBtcAddress('legacy')).address; const btcAddressBytes = ensure0x(btcTxHelper.decodeBase58Address(btcAddress)); - const callResult = await bridge.methods - .registerFastBridgeBtcTransaction( - '0x', - 1, - stringHex, - stringHex, - btcAddressBytes, - randomAddress, - btcAddressBytes, - false - ) - .call(); + const callResult = await bridge.registerFastBridgeBtcTransaction.staticCall( + '0x', + 1, + stringHex, + stringHex, + btcAddressBytes, + randomAddress, + btcAddressBytes, + false + ); expect(Number(callResult)).to.equal(UNPROCESSABLE_TX_NOT_CONTRACT_ERROR); }); }); diff --git a/tests/01_powpeg/extra/99-flyover_sending_same_tx_with_witness_twice.js b/tests/01_powpeg/extra/99-flyover_sending_same_tx_with_witness_twice.js index 76b7ecea..dd523f82 100644 --- a/tests/01_powpeg/extra/99-flyover_sending_same_tx_with_witness_twice.js +++ b/tests/01_powpeg/extra/99-flyover_sending_same_tx_with_witness_twice.js @@ -1,4 +1,5 @@ const expect = require('chai').expect; +const { ethers } = require('ethers'); const redeemScriptParser = require('@rsksmart/powpeg-redeemscript-parser'); const btcEthUnitConverter = require('@rsksmart/btc-eth-unit-converter'); const { @@ -34,7 +35,7 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p Runners.hosts.federate.host ); const initialLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); const FEDS_PUBKEYS_LIST = await getFedsPubKeys(bridge); const userBtcRefundAddress = (await btcTxHelper.generateBtcAddress('legacy')).address; @@ -46,17 +47,15 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p const liquidityProviderBtcAddressBytes = ensure0x( btcTxHelper.decodeBase58Address(liquidityProviderBtcAddress) ); - const preHash = rskTxHelper.getClient().utils.randomHex(32); + const preHash = ethers.hexlify(ethers.randomBytes(32)); const EXPECTED_AMOUNT_IN_BTC = 0.04; - const derivationHash = await liquidityBridgeContract.methods - .getDerivationHash( - preHash, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes - ) - .call(); + const derivationHash = await liquidityBridgeContract.getDerivationHash( + preHash, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes + ); const fundingAmountInBtc = EXPECTED_AMOUNT_IN_BTC + 1; const powpegRedeemScript = redeemScriptParser.getPowpegRedeemScript(FEDS_PUBKEYS_LIST); @@ -82,26 +81,19 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p const coinbaseParams = data.coinbaseParams; - const registerBtcCoinbaseTransactionMethod = - bridge.methods.registerBtcCoinbaseTransaction( + await sendTransaction( + rskTxHelper, + bridge, + 'registerBtcCoinbaseTransaction', + [ ensure0x(coinbaseParams.coinbaseTxWithoutWitness.toHex()), ensure0x(coinbaseParams.blockHash), ensure0x(coinbaseParams.pmt.hex), ensure0x(coinbaseParams.witnessMerkleRoot.toString('hex')), - ensure0x(coinbaseParams.witnessReservedValue) - ); - - await sendTransaction(rskTxHelper, registerBtcCoinbaseTransactionMethod, cowAddress); - - const registerFastBridgeBtcTransactionMethod = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); + ensure0x(coinbaseParams.witnessReservedValue), + ], + cowAddress + ); let resultValueFromFirstTx; @@ -118,28 +110,27 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction ); let currentLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); const finalBalance = initialLbcBalance + resultValueFromFirstTx; expect(currentLbcBalance).to.equal(finalBalance); - const registerFastBridgeBtcTransactionMethod2 = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); - const checkFunction2 = (result) => { const resultValueFromSecondTx = Number(result); expect(UNPROCESSABLE_TX_ALREADY_PROCESSED_ERROR).to.be.equals( @@ -149,13 +140,22 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod2, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction2 ); const finalLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); expect(finalLbcBalance).to.equal(finalBalance); diff --git a/tests/01_powpeg/extra/99-flyover_sending_same_tx_without_witness_twice.js b/tests/01_powpeg/extra/99-flyover_sending_same_tx_without_witness_twice.js index 4577fe71..fc974599 100644 --- a/tests/01_powpeg/extra/99-flyover_sending_same_tx_without_witness_twice.js +++ b/tests/01_powpeg/extra/99-flyover_sending_same_tx_without_witness_twice.js @@ -1,4 +1,5 @@ const expect = require('chai').expect; +const { ethers } = require('ethers'); const redeemScriptParser = require('@rsksmart/powpeg-redeemscript-parser'); const { UNPROCESSABLE_TX_ALREADY_PROCESSED_ERROR, @@ -34,7 +35,7 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p Runners.hosts.federate.host ); const initialLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); const FEDS_PUBKEYS_LIST = await getFedsPubKeys(bridge); const userBtcRefundAddress = (await btcTxHelper.generateBtcAddress('legacy')).address; @@ -46,17 +47,15 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p const liquidityProviderBtcAddressBytes = ensure0x( btcTxHelper.decodeBase58Address(liquidityProviderBtcAddress) ); - const preHash = rskTxHelper.getClient().utils.randomHex(32); + const preHash = ethers.hexlify(ethers.randomBytes(32)); const EXPECTED_AMOUNT_IN_BTC = 0.04; - const derivationHash = await liquidityBridgeContract.methods - .getDerivationHash( - preHash, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes - ) - .call(); + const derivationHash = await liquidityBridgeContract.getDerivationHash( + preHash, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes + ); const fundingAmountInBtc = EXPECTED_AMOUNT_IN_BTC + 1; const powpegRedeemScript = redeemScriptParser.getPowpegRedeemScript(FEDS_PUBKEYS_LIST); @@ -80,16 +79,6 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p await mineForPeginRegistration(rskTxHelper, btcTxHelper); - const registerFastBridgeBtcTransactionMethod = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); - let resultValueFromFirstTx; const checkFunction = (result) => { @@ -105,28 +94,27 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction ); const currentLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); const finalBalance = initialLbcBalance + resultValueFromFirstTx; expect(currentLbcBalance).to.equal(finalBalance); - const registerFastBridgeBtcTransactionMethod2 = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); - const checkFunction2 = (result) => { const resultValueFromSecondTx = Number(result); expect(UNPROCESSABLE_TX_ALREADY_PROCESSED_ERROR).to.be.equals( @@ -136,13 +124,22 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction p await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod2, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction2 ); const finalLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); expect(finalLbcBalance).to.equal(finalBalance); diff --git a/tests/01_powpeg/extra/99-register_fast_bridge_btc_below_minimum.js b/tests/01_powpeg/extra/99-register_fast_bridge_btc_below_minimum.js index 1902aa26..a699eba8 100644 --- a/tests/01_powpeg/extra/99-register_fast_bridge_btc_below_minimum.js +++ b/tests/01_powpeg/extra/99-register_fast_bridge_btc_below_minimum.js @@ -1,4 +1,5 @@ const expect = require('chai').expect; +const { ethers } = require('ethers'); const redeemScriptParser = require('@rsksmart/powpeg-redeemscript-parser'); const { UNPROCESSABLE_TX_AMOUNT_SENT_BELOW_MINIMUM_ERROR, @@ -35,7 +36,7 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction a Runners.hosts.federate.host ); const initialLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); const FEDS_PUBKEYS_LIST = await getFedsPubKeys(bridge); const userBtcRefundAddress = (await btcTxHelper.generateBtcAddress('legacy')).address; @@ -47,17 +48,15 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction a const liquidityProviderBtcAddressBytes = ensure0x( btcTxHelper.decodeBase58Address(liquidityProviderBtcAddress) ); - const preHash = rskTxHelper.getClient().utils.randomHex(32); + const preHash = ethers.hexlify(ethers.randomBytes(32)); const AMOUNT_TO_SEND_IN_BTC = 0.02; - const derivationHash = await liquidityBridgeContract.methods - .getDerivationHash( - preHash, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes - ) - .call(); + const derivationHash = await liquidityBridgeContract.getDerivationHash( + preHash, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes + ); const fundingAmountInBtc = AMOUNT_TO_SEND_IN_BTC + 1; @@ -82,16 +81,6 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction a await mineForPeginRegistration(rskTxHelper, btcTxHelper); - const registerFastBridgeBtcTransactionMethod = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); - const checkFunction = (result) => { const resultValue = Number(result); expect(UNPROCESSABLE_TX_AMOUNT_SENT_BELOW_MINIMUM_ERROR).to.be.equals(resultValue); @@ -99,13 +88,22 @@ describe.skip('@regression @flyover Executing registerFastBridgeBtcTransaction a await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction ); const currentLbcBalance = Number( - await rskTxHelper.getBalance(liquidityBridgeContract._address) + await rskTxHelper.getBalance(liquidityBridgeContract.target) ); expect(currentLbcBalance).to.equal(initialLbcBalance); } catch (e) { diff --git a/tests/01_powpeg/extra/99-register_flyover_btc_transaction.js b/tests/01_powpeg/extra/99-register_flyover_btc_transaction.js index 6414c888..1c900d29 100644 --- a/tests/01_powpeg/extra/99-register_flyover_btc_transaction.js +++ b/tests/01_powpeg/extra/99-register_flyover_btc_transaction.js @@ -1,4 +1,5 @@ const expect = require('chai').expect; +const { ethers } = require('ethers'); const redeemScriptParser = require('@rsksmart/powpeg-redeemscript-parser'); const { ensure0x, additionalFederationAddresses } = require('../../../lib/utils'); const { fundAddressAndGetData } = require('../../../lib/btc-utils'); @@ -28,7 +29,7 @@ describe.skip('@regression @flyover Calling registerFastBridgeBtcTransaction aft it('should return value transferred when calling registerFastBridgeBtcTransaction method', async () => { try { const liquidityBridgeContract = await lbc.getLiquidityBridgeContract(); - expect(Number(await rskTxHelper.getBalance(liquidityBridgeContract._address))).to.equal( + expect(Number(await rskTxHelper.getBalance(liquidityBridgeContract.target))).to.equal( 0 ); @@ -43,15 +44,13 @@ describe.skip('@regression @flyover Calling registerFastBridgeBtcTransaction aft const liquidityProviderBtcAddressBytes = ensure0x( btcTxHelper.decodeBase58Address(liquidityProviderBtcAddress) ); - const preHash = rskTxHelper.getClient().utils.randomHex(32); + const preHash = ethers.hexlify(ethers.randomBytes(32)); - const derivationHash = await liquidityBridgeContract.methods - .getDerivationHash( - preHash, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes - ) - .call(); + const derivationHash = await liquidityBridgeContract.getDerivationHash( + preHash, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes + ); const BTC_BALANCE_TO_TRANSFER_IN_BTC = 20; const AMOUNT_FOR_FUNDER_IN_BTC = 30; @@ -80,30 +79,27 @@ describe.skip('@regression @flyover Calling registerFastBridgeBtcTransaction aft const cowAddress = await rskTxHelper.newAccountWithSeed('cow'); - const registerFastBridgeBtcTransactionMethod = - liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - ensure0x(data.rawTx), - ensure0x(data.pmt), - data.height, - userBtcRefundAddressBytes, - liquidityProviderBtcAddressBytes, - preHash - ); - const checkFunction = (result) => { expect(Number(result)).to.be.equals(weisToTransfer); }; await sendTxWithCheck( rskTxHelper, - registerFastBridgeBtcTransactionMethod, + liquidityBridgeContract, + 'registerFastBridgeBtcTransaction', + [ + ensure0x(data.rawTx), + ensure0x(data.pmt), + data.height, + userBtcRefundAddressBytes, + liquidityProviderBtcAddressBytes, + preHash, + ], cowAddress, checkFunction ); - const currentRskBalance = await rskTxHelper.getBalance( - liquidityBridgeContract._address - ); + const currentRskBalance = await rskTxHelper.getBalance(liquidityBridgeContract.target); expect(Number(currentRskBalance)).to.equal(weisToTransfer); } catch (err) { throw new CustomError('registerFastBridgeBtcTransaction call failure', err);