diff --git a/package.json b/package.json index 918d20f..8989a8f 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,11 @@ "@inquirer/prompts": "^5.5.0", "@uniswap/v2-core": "^1.0.1", "@uniswap/v2-periphery": "^1.1.0-beta.0", - "@zetachain/protocol-contracts": "10.0.0-rc11", + "@zetachain/protocol-contracts": "11.0.0-rc3", "ansis": "^3.3.2", "concurrently": "^8.2.2", "ethers": "^6.13.2", "hardhat": "^2.22.8", "wait-on": "^7.2.0" } -} +} \ No newline at end of file diff --git a/packages/localnet/src/createToken.ts b/packages/localnet/src/createToken.ts index 14bbea1..39c24c5 100644 --- a/packages/localnet/src/createToken.ts +++ b/packages/localnet/src/createToken.ts @@ -3,35 +3,27 @@ import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json"; import { deployOpts } from "./deployOpts"; import * as TestERC20 from "@zetachain/protocol-contracts/abi/TestERC20.sol/TestERC20.json"; -export const createToken = async ({ - fungibleModuleSigner, - deployer, - systemContract, - gatewayZEVM, - foreignCoins, - custody, - tss, - uniswapFactoryInstance, - wzeta, - uniswapRouterInstance, - symbol, - isGasToken = false, -}: { - fungibleModuleSigner: any; - deployer: ethers.Signer; - systemContract: any; - gatewayZEVM: any; - foreignCoins: any[]; - custody: ethers.BaseContract; - tss: ethers.Signer; - uniswapFactoryInstance: ethers.BaseContract; - wzeta: ethers.BaseContract; - uniswapRouterInstance: ethers.BaseContract; - symbol: string; - isGasToken: boolean; -}) => { +export const createToken = async ( + addresses: any, + custody: any, + symbol: string, + isGasToken: boolean, + chainID: string +) => { let erc20; + const { + fungibleModuleSigner, + deployer, + foreignCoins, + tss, + systemContract, + gatewayZEVM, + uniswapFactoryInstance, + uniswapRouterInstance, + wzeta, + } = addresses; + const zrc20Factory = new ethers.ContractFactory( ZRC20.abi, ZRC20.bytecode, @@ -40,10 +32,10 @@ export const createToken = async ({ const zrc20 = await zrc20Factory .connect(fungibleModuleSigner) .deploy( - `ZRC-20 ${symbol}`, + `ZRC-20 ${symbol} on ${chainID}`, `ZRC20${symbol}`, 18, - 1, + chainID, isGasToken ? 1 : 2, 1, systemContract.target, @@ -56,8 +48,10 @@ export const createToken = async ({ if (isGasToken) { (systemContract as any) .connect(fungibleModuleSigner) - .setGasCoinZRC20(1, zrc20.target); - (systemContract as any).connect(fungibleModuleSigner).setGasPrice(1, 1); + .setGasCoinZRC20(chainID, zrc20.target); + (systemContract as any) + .connect(fungibleModuleSigner) + .setGasPrice(chainID, 1); } else { const erc20Factory = new ethers.ContractFactory( TestERC20.abi, @@ -99,10 +93,10 @@ export const createToken = async ({ foreignCoins.push({ zrc20_contract_address: zrc20.target, asset: isGasToken ? "" : (erc20 as any).target, - foreign_chain_id: "1", + foreign_chain_id: chainID, decimals: 18, - name: `ZetaChain ZRC-20 ${symbol}`, - symbol: `${symbol}.ETH`, + name: `ZRC-20 ${symbol} on ${chainID}`, + symbol: `${symbol}`, coin_type: isGasToken ? "Gas" : "ERC20", gas_limit: null, paused: null, @@ -115,6 +109,14 @@ export const createToken = async ({ deployOpts ); + await (zrc20 as any) + .connect(deployer) + .transfer( + fungibleModuleSigner.getAddress(), + ethers.parseUnits("100", await (zrc20 as any).decimals()), + deployOpts + ); + await (wzeta as any) .connect(deployer) .deposit({ value: ethers.parseEther("1000"), ...deployOpts }); diff --git a/packages/localnet/src/handleOnEVMCalled.ts b/packages/localnet/src/handleOnEVMCalled.ts index 9a8e541..1060dd5 100644 --- a/packages/localnet/src/handleOnEVMCalled.ts +++ b/packages/localnet/src/handleOnEVMCalled.ts @@ -3,7 +3,6 @@ import { handleOnRevertEVM } from "./handleOnRevertEVM"; import { log, logErr } from "./log"; import { deployOpts } from "./deployOpts"; -// event Called(address indexed sender, address indexed receiver, bytes payload, RevertOptions revertOptions); export const handleOnEVMCalled = async ({ tss, provider, @@ -13,6 +12,10 @@ export const handleOnEVMCalled = async ({ fungibleModuleSigner, foreignCoins, exitOnError = false, + chainID, + chain, + gatewayEVM, + custody, }: { tss: any; provider: ethers.JsonRpcProvider; @@ -22,20 +25,24 @@ export const handleOnEVMCalled = async ({ fungibleModuleSigner: any; foreignCoins: any[]; exitOnError: boolean; + chainID: string; + chain: string; + gatewayEVM: any; + custody: any; }) => { - log("EVM", "Gateway: 'Called' event emitted"); + log(chain, "Gateway: 'Called' event emitted"); + const sender = args[0]; + const receiver = args[1]; + const message = args[2]; try { - const receiver = args[1]; - const message = args[2]; - (deployer as NonceManager).reset(); const context = { - origin: protocolContracts.gatewayZEVM.target, - sender: await fungibleModuleSigner.getAddress(), - chainID: 1, + origin: ethers.ZeroAddress, + sender, + chainID, }; const zrc20 = foreignCoins.find( - (coin) => coin.foreign_chain_id === "1" && coin.coin_type === "Gas" + (coin) => coin.foreign_chain_id === chainID && coin.coin_type === "Gas" )?.zrc20_contract_address; log( @@ -68,8 +75,11 @@ export const handleOnEVMCalled = async ({ isGas: true, token: "", provider, - protocolContracts, exitOnError, + chain, + gatewayEVM, + custody, + sender, }); } }; diff --git a/packages/localnet/src/handleOnEVMDeposited.ts b/packages/localnet/src/handleOnEVMDeposited.ts index ad36c72..eadca9f 100644 --- a/packages/localnet/src/handleOnEVMDeposited.ts +++ b/packages/localnet/src/handleOnEVMDeposited.ts @@ -5,7 +5,6 @@ import { deployOpts } from "./deployOpts"; import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json"; import * as UniswapV2Router02 from "@uniswap/v2-periphery/build/UniswapV2Router02.json"; -// event Deposited(address indexed sender, address indexed receiver, uint256 amount, address asset, bytes payload, RevertOptions revertOptions); export const handleOnEVMDeposited = async ({ tss, provider, @@ -15,6 +14,10 @@ export const handleOnEVMDeposited = async ({ fungibleModuleSigner, foreignCoins, exitOnError = false, + chainID, + chain, + gatewayEVM, + custody, }: { tss: any; provider: ethers.JsonRpcProvider; @@ -24,8 +27,13 @@ export const handleOnEVMDeposited = async ({ fungibleModuleSigner: any; foreignCoins: any[]; exitOnError: boolean; + chainID: string; + chain: string; + gatewayEVM: any; + custody: any; }) => { - log("EVM", "Gateway: 'Deposited' event emitted"); + log(chain, "Gateway: 'Deposited' event emitted"); + const sender = args[0]; const receiver = args[1]; const amount = args[2]; const asset = args[3]; @@ -44,41 +52,11 @@ export const handleOnEVMDeposited = async ({ const zrc20 = foreignCoin.zrc20_contract_address; try { - const context = { - origin: protocolContracts.gatewayZEVM.target, - sender: await fungibleModuleSigner.getAddress(), - chainID: 1, - }; - - // If message is not empty, execute depositAndCall - if (message !== "0x") { - log( - "ZetaChain", - `Universal contract ${receiver} executing onCall (context: ${JSON.stringify( - context - )}), zrc20: ${zrc20}, amount: ${amount}, message: ${message})` - ); - - const tx = await protocolContracts.gatewayZEVM - .connect(fungibleModuleSigner) - .depositAndCall(context, zrc20, amount, receiver, message, deployOpts); - - await tx.wait(); - const logs = await provider.getLogs({ - address: receiver, - fromBlock: "latest", - }); - - logs.forEach((data) => { - log("ZetaChain", `Event from onCall: ${JSON.stringify(data)}`); - }); - } else { - const tx = await protocolContracts.gatewayZEVM - .connect(fungibleModuleSigner) - .deposit(zrc20, amount, receiver, deployOpts); - await tx.wait(); - log("ZetaChain", `Deposited ${amount} of ${zrc20} tokens to ${receiver}`); - } + const tx = await protocolContracts.gatewayZEVM + .connect(fungibleModuleSigner) + .deposit(zrc20, amount, receiver, deployOpts); + await tx.wait(); + log("ZetaChain", `Deposited ${amount} of ${zrc20} tokens to ${receiver}`); } catch (err) { logErr("ZetaChain", `Error depositing: ${err}`); const revertOptions = args[5]; @@ -118,8 +96,11 @@ export const handleOnEVMDeposited = async ({ isGas, token, provider, - protocolContracts, exitOnError, + chain, + gatewayEVM, + custody, + sender, }); } }; diff --git a/packages/localnet/src/handleOnEVMDepositedAndCalled.ts b/packages/localnet/src/handleOnEVMDepositedAndCalled.ts new file mode 100644 index 0000000..272ab03 --- /dev/null +++ b/packages/localnet/src/handleOnEVMDepositedAndCalled.ts @@ -0,0 +1,229 @@ +import { ethers, NonceManager } from "ethers"; +import { handleOnRevertEVM } from "./handleOnRevertEVM"; +import { log, logErr } from "./log"; +import { deployOpts } from "./deployOpts"; +import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json"; +import * as UniswapV2Router02 from "@uniswap/v2-periphery/build/UniswapV2Router02.json"; + +export const handleOnEVMDepositedAndCalled = async ({ + tss, + provider, + protocolContracts, + args, + deployer, + fungibleModuleSigner, + foreignCoins, + exitOnError = false, + chainID, + chain, + gatewayEVM, + custody, +}: { + tss: any; + provider: ethers.JsonRpcProvider; + protocolContracts: any; + args: any; + deployer: any; + fungibleModuleSigner: any; + foreignCoins: any[]; + exitOnError: boolean; + chainID: string; + chain: string; + gatewayEVM: any; + custody: any; +}) => { + log(chain, "Gateway: 'DepositedAndCalled' event emitted"); + const sender = args[0]; + const receiver = args[1]; + const amount = args[2]; + const asset = args[3]; + const message = args[4]; + let foreignCoin; + if (asset === ethers.ZeroAddress) { + foreignCoin = foreignCoins.find( + (coin) => coin.coin_type === "Gas" && coin.foreign_chain_id === chainID + ); + } else { + foreignCoin = foreignCoins.find((coin) => coin.asset === asset); + } + + if (!foreignCoin) { + logErr("ZetaChain", `Foreign coin not found for asset: ${asset}`); + return; + } + + const zrc20 = foreignCoin.zrc20_contract_address; + try { + const context = { + origin: ethers.ZeroAddress, + sender, + chainID, + }; + + log( + "ZetaChain", + `Universal contract ${receiver} executing onCall (context: ${JSON.stringify( + context + )}), zrc20: ${zrc20}, amount: ${amount}, message: ${message})` + ); + const tx = await protocolContracts.gatewayZEVM + .connect(fungibleModuleSigner) + .depositAndCall(context, zrc20, amount, receiver, message, deployOpts); + + await tx.wait(); + const logs = await provider.getLogs({ + address: receiver, + fromBlock: "latest", + }); + + logs.forEach((data) => { + log("ZetaChain", `Event from onCall: ${JSON.stringify(data)}`); + }); + } catch (err) { + logErr("ZetaChain", `Error depositing: ${err}`); + const revertOptions = args[5]; + const zrc20Contract = new ethers.Contract(zrc20, ZRC20.abi, deployer); + const [gasZRC20, gasFee] = await zrc20Contract.withdrawGasFeeWithGasLimit( + revertOptions[4] + ); + let revertAmount; + let revertGasFee = gasFee; + let isGas = true; + let token = null; + if (zrc20 !== gasZRC20) { + token = foreignCoins.find( + (coin) => coin.zrc20_contract_address === zrc20 + )?.asset; + isGas = false; + revertGasFee = await swapToCoverGas( + deployer, + zrc20, + gasZRC20, + gasFee, + amount, + await fungibleModuleSigner.getAddress(), + zrc20Contract, + provider, + protocolContracts.wzeta.target, + protocolContracts.uniswapRouterInstance.target + ); + } + revertAmount = amount - revertGasFee; + return await handleOnRevertEVM({ + revertOptions, + asset, + amount: revertAmount, + err, + tss, + isGas, + token, + provider, + exitOnError, + chain, + gatewayEVM, + custody, + sender, + }); + } +}; + +const swapToCoverGas = async ( + deployer: any, + zrc20: string, + gasZRC20: string, + gasFee: any, + amount: any, + fungibleModule: any, + zrc20Contract: any, + provider: any, + wzeta: string, + router: string +) => { + /** + * Retrieves the amounts for swapping tokens using UniswapV2. + * @param {"in" | "out"} direction - The direction of the swap ("in" or "out"). + * @param {any} provider - The ethers provider. + * @param {any} amount - The amount to swap. + * @param {string} tokenA - The address of token A. + * @param {string} tokenB - The address of token B. + * @returns {Promise} - The amounts for the swap. + * @throws Will throw an error if the UniswapV2 router address cannot be retrieved. + */ + const getAmounts = async ( + direction: "in" | "out", + provider: any, + amount: any, + tokenA: string, + tokenB: string, + routerAddress: any, + routerABI: any + ) => { + if (!routerAddress) { + throw new Error("Cannot get uniswapV2Router02 address"); + } + + const uniswapRouter = new ethers.Contract( + routerAddress, + routerABI.abi, + provider + ); + + const path = [tokenA, tokenB]; + + const amounts = + direction === "in" + ? await uniswapRouter.getAmountsIn(amount, path) + : await uniswapRouter.getAmountsOut(amount, path); + return amounts; + }; + + const uniswapV2Router = new ethers.Contract( + router, + UniswapV2Router02.abi, + deployer + ); + deployer.reset(); + const approvalTx = await zrc20Contract.approve(router, amount); + await approvalTx.wait(); + + const path = [zrc20, wzeta, gasZRC20]; + + const deadline = Math.floor(Date.now() / 1000) + 60 * 20; + const maxZRC20ToSpend = amount; + + try { + const swapTx = await uniswapV2Router.swapTokensForExactTokens( + gasFee, + maxZRC20ToSpend, + path, + fungibleModule, + deadline + ); + + await swapTx.wait(); + } catch (swapError) { + logErr("ZetaChain", `Error performing swap on Uniswap: ${swapError}`); + } + + const amountInZeta = await getAmounts( + "in", + provider, + gasFee, + wzeta, + gasZRC20, + router, + UniswapV2Router02 + ); + + const amountInZRC20 = await getAmounts( + "in", + provider, + amountInZeta[0], + zrc20, + wzeta, + router, + UniswapV2Router02 + ); + + return amountInZRC20[0]; +}; diff --git a/packages/localnet/src/handleOnRevertEVM.ts b/packages/localnet/src/handleOnRevertEVM.ts index 21ac0bf..09c57c8 100644 --- a/packages/localnet/src/handleOnRevertEVM.ts +++ b/packages/localnet/src/handleOnRevertEVM.ts @@ -9,10 +9,13 @@ export const handleOnRevertEVM = async ({ err, provider, tss, - protocolContracts, isGas, token, exitOnError = false, + chain, + gatewayEVM, + custody, + sender, }: { revertOptions: any; err: any; @@ -20,23 +23,22 @@ export const handleOnRevertEVM = async ({ amount: any; provider: any; tss: any; - protocolContracts: any; isGas: boolean; token: string; exitOnError: boolean; + chain: string; + gatewayEVM: any; + custody: any; + sender: string; }) => { const callOnRevert = revertOptions[1]; const revertAddress = revertOptions[0]; const revertMessage = revertOptions[3]; - const revertContext = { - asset, - amount, - revertMessage, - }; + const revertContext = { asset, amount, revertMessage, sender }; if (callOnRevert) { try { log( - "EVM", + chain, `Contract ${revertAddress} executing onRevert (context: ${JSON.stringify( revertContext )})` @@ -44,14 +46,14 @@ export const handleOnRevertEVM = async ({ (tss as NonceManager).reset(); let tx; if (isGas) { - tx = await protocolContracts.gatewayEVM + tx = await gatewayEVM .connect(tss) .executeRevert(revertAddress, "0x", revertContext, { value: amount, deployOpts, }); } else { - tx = await protocolContracts.custody + tx = await custody .connect(tss) .withdrawAndRevert( revertAddress, @@ -63,22 +65,22 @@ export const handleOnRevertEVM = async ({ ); } await tx.wait(); - log("EVM", "Gateway: successfully called onRevert"); + log(chain, "Gateway: successfully called onRevert"); const logs = await provider.getLogs({ address: revertAddress, fromBlock: "latest", }); logs.forEach((data: any) => { - log("EVM", `Event from onRevert: ${JSON.stringify(data)}`); + log(chain, `Event from onRevert: ${JSON.stringify(data)}`); }); } catch (err: any) { - logErr("EVM", `Gateway: Call onRevert failed`, err); + logErr(chain, `Gateway: Call onRevert failed`, err); if (exitOnError) throw new Error(err); } } else { const error = `Tx reverted without callOnRevert: ${err}`; - logErr("EVM", error); + logErr(chain, error); if (exitOnError) throw new Error(error); } }; diff --git a/packages/localnet/src/handleOnRevertZEVM.ts b/packages/localnet/src/handleOnRevertZEVM.ts index f722719..efa4301 100644 --- a/packages/localnet/src/handleOnRevertZEVM.ts +++ b/packages/localnet/src/handleOnRevertZEVM.ts @@ -10,9 +10,10 @@ export const handleOnRevertZEVM = async ({ tss, log, fungibleModuleSigner, - protocolContracts, + gatewayZEVM, deployOpts, exitOnError = false, + sender, }: { revertOptions: any; err: any; @@ -21,10 +22,11 @@ export const handleOnRevertZEVM = async ({ provider: any; fungibleModuleSigner: any; tss: NonceManager; - log: (chain: "EVM" | "ZetaChain", ...messages: string[]) => void; - protocolContracts: any; + log: (chain: string, ...messages: string[]) => void; + gatewayZEVM: any; deployOpts: any; exitOnError: boolean; + sender: string; }) => { const callOnRevert = revertOptions[1]; const revertAddress = revertOptions[0]; @@ -33,13 +35,21 @@ export const handleOnRevertZEVM = async ({ asset, amount, revertMessage, + sender, }; if (callOnRevert) { log("ZetaChain", "Gateway: calling executeRevert"); try { + const assetContract = new ethers.Contract( + asset, + ["function transfer(address to, uint256 amount) public returns (bool)"], + fungibleModuleSigner + ); + const transferTx = await assetContract.transfer(revertAddress, amount); + await transferTx.wait(); tss.reset(); - const tx = await protocolContracts.gatewayZEVM + const tx = await gatewayZEVM .connect(fungibleModuleSigner) .executeRevert(revertAddress, revertContext, deployOpts); await tx.wait(); diff --git a/packages/localnet/src/handleOnZEVMCalled.ts b/packages/localnet/src/handleOnZEVMCalled.ts index bcf2aa3..d4ae7af 100644 --- a/packages/localnet/src/handleOnZEVMCalled.ts +++ b/packages/localnet/src/handleOnZEVMCalled.ts @@ -3,32 +3,59 @@ import { handleOnRevertZEVM } from "./handleOnRevertZEVM"; import { log, logErr } from "./log"; import { deployOpts } from "./deployOpts"; -// event Called(address indexed sender, address indexed zrc20, bytes receiver, bytes message, uint256 gasLimit, RevertOptions revertOptions); export const handleOnZEVMCalled = async ({ + evmContracts, + foreignCoins, tss, provider, - protocolContracts, + gatewayZEVM, args, fungibleModuleSigner, exitOnError = false, }: { + evmContracts: any; + foreignCoins: any[]; tss: any; provider: ethers.JsonRpcProvider; - protocolContracts: any; + gatewayZEVM: any; args: any; fungibleModuleSigner: any; exitOnError: boolean; }) => { log("ZetaChain", "Gateway: 'Called' event emitted"); + const sender = args[0]; + + const zrc20 = args[1]; + const chainID = foreignCoins.find( + (coin: any) => coin.zrc20_contract_address === zrc20 + )?.foreign_chain_id; + + const receiver = args[2]; + const message = args[3]; + const callOptions = args[4]; + const isArbitraryCall = callOptions[1]; + try { tss.reset(); - const receiver = args[2]; - const message = args[3]; - log("EVM", `Calling ${receiver} with message ${message}`); - const executeTx = await protocolContracts.gatewayEVM + const messageContext = { + sender: isArbitraryCall ? ethers.ZeroAddress : sender, + }; + log(chainID, `Calling ${receiver} with message ${message}`); + + if (isArbitraryCall) { + const selector = message.slice(0, 10); + const code = await provider.getCode(receiver); + if (!code.includes(selector.slice(2))) { + throw new Error( + `Receiver contract does not contain function with selector ${selector}` + ); + } + } + + const executeTx = await evmContracts[chainID].gatewayEVM .connect(tss) - .execute(receiver, message, deployOpts); + .execute(messageContext, receiver, message, deployOpts); const logs = await provider.getLogs({ address: receiver, @@ -36,11 +63,11 @@ export const handleOnZEVMCalled = async ({ }); logs.forEach((data) => { - log("EVM", `Event from contract: ${JSON.stringify(data)}`); + log(chainID, `Event from contract: ${JSON.stringify(data)}`); }); await executeTx.wait(); } catch (err) { - logErr("EVM", `Error executing a contract: ${err}`); + logErr(chainID, `Error executing a contract: ${err}`); const revertOptions = args[5]; return await handleOnRevertZEVM({ revertOptions, @@ -51,9 +78,10 @@ export const handleOnZEVMCalled = async ({ fungibleModuleSigner, tss, log, - protocolContracts, + gatewayZEVM, deployOpts, exitOnError, + sender, }); } }; diff --git a/packages/localnet/src/handleOnZEVMWithdrawn.ts b/packages/localnet/src/handleOnZEVMWithdrawn.ts index ded8934..226ee05 100644 --- a/packages/localnet/src/handleOnZEVMWithdrawn.ts +++ b/packages/localnet/src/handleOnZEVMWithdrawn.ts @@ -4,20 +4,21 @@ import { log, logErr } from "./log"; import { deployOpts } from "./deployOpts"; import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json"; -// event Withdrawn(address indexed sender, uint256 indexed chainId, bytes receiver, address zrc20, uint256 value, uint256 gasfee, uint256 protocolFlatFee, bytes message, uint256 gasLimit, RevertOptions revertOptions); export const handleOnZEVMWithdrawn = async ({ + evmContracts, tss, provider, - protocolContracts, + gatewayZEVM, args, fungibleModuleSigner, deployer, foreignCoins, exitOnError = false, }: { + evmContracts: any; tss: any; provider: ethers.JsonRpcProvider; - protocolContracts: any; + gatewayZEVM: any; args: any; fungibleModuleSigner: any; deployer: any; @@ -25,74 +26,54 @@ export const handleOnZEVMWithdrawn = async ({ exitOnError: boolean; }) => { log("ZetaChain", "Gateway: 'Withdrawn' event emitted"); + const sender = args[0]; + const zrc20 = args[3]; + const chainID = foreignCoins.find( + (coin: any) => coin.zrc20_contract_address === zrc20 + )?.foreign_chain_id; + const getERC20ByZRC20 = (zrc20: string) => { const foreignCoin = foreignCoins.find( (coin: any) => coin.zrc20_contract_address === zrc20 ); if (!foreignCoin) { - logErr("EVM", `Foreign coin not found for ZRC20 address: ${zrc20}`); + logErr(chainID, `Foreign coin not found for ZRC20 address: ${zrc20}`); return; } return foreignCoin.asset; }; - const zrc20 = args[3]; + const amount = args[4]; try { const receiver = args[2]; - const message = args[7]; (tss as NonceManager).reset(); const zrc20Contract = new ethers.Contract(zrc20, ZRC20.abi, deployer); const coinType = await zrc20Contract.COIN_TYPE(); const isGasToken = coinType === 1n; const isERC20orZETA = coinType === 2n; - if (message !== "0x") { - // The message is not empty, so this is a withdrawAndCall operation - log("EVM", `Calling ${receiver} with message ${message}`); - if (isGasToken) { - const executeTx = await protocolContracts.gatewayEVM - .connect(tss) - .execute(receiver, message, { value: amount, ...deployOpts }); - await executeTx.wait(); - } else { - const erc20 = getERC20ByZRC20(zrc20); - const executeTx = await protocolContracts.custody - .connect(tss) - .withdrawAndCall(receiver, erc20, amount, message, deployOpts); - await executeTx.wait(); - } - const logs = await provider.getLogs({ - address: receiver, - fromBlock: "latest", - }); - logs.forEach((data) => { - log("EVM", `Event from contract: ${JSON.stringify(data)}`); + if (isGasToken) { + const tx = await tss.sendTransaction({ + to: receiver, + value: amount, + ...deployOpts, }); - } else { - // The message is empty, so this is a withdraw operation - if (isGasToken) { - const tx = await tss.sendTransaction({ - to: receiver, - value: amount, - ...deployOpts, - }); - await tx.wait(); - log( - "EVM", - `Transferred ${ethers.formatEther( - amount - )} native gas tokens from TSS to ${receiver}` - ); - } else if (isERC20orZETA) { - const erc20 = getERC20ByZRC20(zrc20); - const tx = await protocolContracts.custody - .connect(tss) - .withdraw(receiver, erc20, amount, deployOpts); - await tx.wait(); - log( - "EVM", - `Transferred ${amount} ERC-20 tokens from Custody to ${receiver}` - ); - } + await tx.wait(); + log( + chainID, + `Transferred ${ethers.formatEther( + amount + )} native gas tokens from TSS to ${receiver}` + ); + } else if (isERC20orZETA) { + const erc20 = getERC20ByZRC20(zrc20); + const tx = await evmContracts[chainID].custody + .connect(tss) + .withdraw(receiver, erc20, amount, deployOpts); + await tx.wait(); + log( + chainID, + `Transferred ${amount} ERC-20 tokens from Custody to ${receiver}` + ); } } catch (err) { const revertOptions = args[9]; @@ -101,13 +82,14 @@ export const handleOnZEVMWithdrawn = async ({ err, provider, tss, - asset: getERC20ByZRC20(zrc20), + asset: zrc20, amount, log, fungibleModuleSigner, - protocolContracts, + gatewayZEVM, deployOpts, exitOnError, + sender, }); } }; diff --git a/packages/localnet/src/handleOnZEVMWithdrawnAndCalled.ts b/packages/localnet/src/handleOnZEVMWithdrawnAndCalled.ts new file mode 100644 index 0000000..e567a2c --- /dev/null +++ b/packages/localnet/src/handleOnZEVMWithdrawnAndCalled.ts @@ -0,0 +1,117 @@ +import { ethers, NonceManager } from "ethers"; +import { handleOnRevertZEVM } from "./handleOnRevertZEVM"; +import { log, logErr } from "./log"; +import { deployOpts } from "./deployOpts"; +import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json"; + +export const handleOnZEVMWithdrawnAndCalled = async ({ + evmContracts, + tss, + provider, + gatewayZEVM, + args, + fungibleModuleSigner, + deployer, + foreignCoins, + exitOnError = false, +}: { + evmContracts: any; + tss: any; + provider: ethers.JsonRpcProvider; + gatewayZEVM: any; + args: any; + fungibleModuleSigner: any; + deployer: any; + foreignCoins: any[]; + exitOnError: boolean; +}) => { + log("ZetaChain", "Gateway: 'WithdrawnAndCalled' event emitted"); + const getERC20ByZRC20 = (zrc20: string) => { + const foreignCoin = foreignCoins.find( + (coin: any) => coin.zrc20_contract_address === zrc20 + ); + if (!foreignCoin) { + logErr(chainID, `Foreign coin not found for ZRC20 address: ${zrc20}`); + return; + } + return foreignCoin.asset; + }; + const sender = args[0]; + + const zrc20 = args[3]; + const chainID = foreignCoins.find( + (coin: any) => coin.zrc20_contract_address === zrc20 + )?.foreign_chain_id; + + const amount = args[4]; + const callOptions = args[8]; + const isArbitraryCall = callOptions[1]; + const messageContext = { + sender: isArbitraryCall ? ethers.ZeroAddress : sender, + }; + try { + const receiver = args[2]; + const message = args[7]; + (tss as NonceManager).reset(); + const zrc20Contract = new ethers.Contract(zrc20, ZRC20.abi, deployer); + const coinType = await zrc20Contract.COIN_TYPE(); + const isGasToken = coinType === 1n; + + if (isArbitraryCall) { + const selector = message.slice(0, 10); + const code = await provider.getCode(receiver); + if (!code.includes(selector.slice(2))) { + throw new Error( + `Receiver contract does not contain function with selector ${selector}` + ); + } + } + + log(chainID, `Calling ${receiver} with message ${message}`); + if (isGasToken) { + const executeTx = await evmContracts[chainID].gatewayEVM + .connect(tss) + .execute(messageContext, receiver, message, { + value: amount, + ...deployOpts, + }); + await executeTx.wait(); + } else { + const erc20 = getERC20ByZRC20(zrc20); + const executeTx = await evmContracts[chainID].custody + .connect(tss) + .withdrawAndCall( + messageContext, + receiver, + erc20, + amount, + message, + deployOpts + ); + await executeTx.wait(); + } + const logs = await provider.getLogs({ + address: receiver, + fromBlock: "latest", + }); + logs.forEach((data) => { + log(chainID, `Event from contract: ${JSON.stringify(data)}`); + }); + } catch (err) { + const revertOptions = args[9]; + return await handleOnRevertZEVM({ + revertOptions, + err, + provider, + tss, + asset: zrc20, + amount, + log, + fungibleModuleSigner, + gatewayZEVM, + deployOpts, + exitOnError, + sender, + }); + } +}; diff --git a/packages/localnet/src/index.ts b/packages/localnet/src/index.ts index 6d11dc6..d73f2cc 100755 --- a/packages/localnet/src/index.ts +++ b/packages/localnet/src/index.ts @@ -15,6 +15,8 @@ import { deployOpts } from "./deployOpts"; import { handleOnEVMDeposited } from "./handleOnEVMDeposited"; import { handleOnZEVMWithdrawn } from "./handleOnZEVMWithdrawn"; import { createToken } from "./createToken"; +import { handleOnZEVMWithdrawnAndCalled } from "./handleOnZEVMWithdrawnAndCalled"; +import { handleOnEVMDepositedAndCalled } from "./handleOnEVMDepositedAndCalled"; const FUNGIBLE_MODULE_ADDRESS = "0x735b14BB79463307AAcBED86DAf3322B1e6226aB"; @@ -25,10 +27,6 @@ const foreignCoins: any[] = []; return this.toString(); }; -let protocolContracts: any; -let deployer: Signer; -let tss: Signer; - const prepareUniswap = async (deployer: Signer, TSS: Signer, wzeta: any) => { const uniswapFactory = new ethers.ContractFactory( UniswapV2Factory.abi, @@ -107,7 +105,7 @@ const prepareZetaChain = async ( return { systemContract, gatewayZEVM }; }; -const prepareEVM = async (deployer: Signer, TSS: Signer) => { +const prepareEVM = async (deployer: Signer, tss: Signer) => { const testERC20Factory = new ethers.ContractFactory( TestERC20.abi, TestERC20.bytecode, @@ -173,13 +171,15 @@ const prepareEVM = async (deployer: Signer, TSS: Signer) => { deployer ); - await zetaConnectorProxy.initialize( - gatewayEVM.target, - testEVMZeta.target, - await tss.getAddress(), - await deployer.getAddress(), - deployOpts - ); + // Temporarily disable + // + // await zetaConnectorProxy.initialize( + // gatewayEVM.target, + // testEVMZeta.target, + // await tss.getAddress(), + // await deployer.getAddress(), + // deployOpts + // ); await custodyProxy.initialize( gatewayEVM.target, @@ -208,11 +208,6 @@ const deployProtocolContracts = async ( tss: Signer, fungibleModuleSigner: Signer ) => { - const { zetaConnector, gatewayEVM, custody, testEVMZeta } = await prepareEVM( - deployer, - tss - ); - const weth9Factory = new ethers.ContractFactory( WETH9.abi, WETH9.bytecode, @@ -229,36 +224,6 @@ const deployProtocolContracts = async ( await uniswapRouterInstance.getAddress() ); - await createToken({ - fungibleModuleSigner, - deployer, - systemContract, - gatewayZEVM, - foreignCoins, - custody, - tss, - uniswapFactoryInstance, - wzeta, - uniswapRouterInstance, - symbol: "USDC", - isGasToken: false, - }); - - await createToken({ - fungibleModuleSigner, - deployer, - systemContract, - gatewayZEVM, - foreignCoins, - custody, - tss, - uniswapFactoryInstance, - wzeta, - uniswapRouterInstance, - symbol: "ETH", - isGasToken: true, - }); - await (wzeta as any) .connect(fungibleModuleSigner) .deposit({ ...deployOpts, value: ethers.parseEther("10") }); @@ -273,19 +238,12 @@ const deployProtocolContracts = async ( .approve(gatewayZEVM.target, ethers.parseEther("10"), deployOpts); return { - custody, - zetaConnector, - gatewayEVM, gatewayZEVM, systemContract, - testEVMZeta, wzeta, tss, uniswapFactoryInstance, uniswapRouterInstance, - uniswapFactoryAddressZetaChain: await uniswapFactoryInstance.getAddress(), - uniswapRouterAddressZetaChain: await uniswapRouterInstance.getAddress(), - custodyEVM: custody, }; }; @@ -312,29 +270,53 @@ export const initLocalnet = async ({ ); // use 1st anvil account for deployer and admin - deployer = new NonceManager(ethers.Wallet.fromPhrase(phrase, provider)); + let deployer = new NonceManager(ethers.Wallet.fromPhrase(phrase, provider)); deployer = deployer.connect(provider); // use 2nd anvil account for tss const mnemonic = ethers.Mnemonic.fromPhrase(phrase); - tss = new NonceManager( + let tss = new NonceManager( ethers.HDNodeWallet.fromMnemonic(mnemonic, `m/44'/60'/0'/0/${1}`) ); tss = tss.connect(provider); - protocolContracts = await deployProtocolContracts( + const protocolContracts = await deployProtocolContracts( deployer, tss, fungibleModuleSigner ); - // Listen to contracts events + const contractsEthereum = await prepareEVM(deployer, tss); + + const contractsBNB = await prepareEVM(deployer, tss); + + const addresses = { + ...protocolContracts, + fungibleModuleSigner, + deployer, + protocolContracts, + foreignCoins, + tss, + }; + + await createToken(addresses, contractsEthereum.custody, "ETH", true, "5"); + await createToken(addresses, contractsEthereum.custody, "USDC", false, "5"); + await createToken(addresses, contractsBNB.custody, "BNB", true, "97"); + await createToken(addresses, contractsBNB.custody, "USDC", false, "97"); + + const evmContracts = { + 5: contractsEthereum, + 97: contractsBNB, + }; + protocolContracts.gatewayZEVM.on("Called", async (...args: Array) => { handleOnZEVMCalled({ + evmContracts, + foreignCoins, tss, provider, fungibleModuleSigner, - protocolContracts, + gatewayZEVM: protocolContracts.gatewayZEVM, args, exitOnError, }); @@ -342,6 +324,37 @@ export const initLocalnet = async ({ protocolContracts.gatewayZEVM.on("Withdrawn", async (...args: Array) => { handleOnZEVMWithdrawn({ + evmContracts, + foreignCoins, + tss, + provider, + gatewayZEVM: protocolContracts.gatewayZEVM, + args, + deployer, + fungibleModuleSigner, + exitOnError, + }); + }); + + protocolContracts.gatewayZEVM.on( + "WithdrawnAndCalled", + async (...args: Array) => { + handleOnZEVMWithdrawnAndCalled({ + evmContracts, + foreignCoins, + tss, + provider, + gatewayZEVM: protocolContracts.gatewayZEVM, + args, + deployer, + fungibleModuleSigner, + exitOnError, + }); + } + ); + + contractsEthereum.gatewayEVM.on("Called", async (...args: Array) => { + return await handleOnEVMCalled({ tss, provider, protocolContracts, @@ -350,10 +363,51 @@ export const initLocalnet = async ({ fungibleModuleSigner, foreignCoins, exitOnError, + chainID: "5", + chain: "ethereum", + gatewayEVM: contractsEthereum.gatewayEVM, + custody: contractsEthereum.custody, }); }); - protocolContracts.gatewayEVM.on("Called", async (...args: Array) => { + contractsEthereum.gatewayEVM.on("Deposited", async (...args: Array) => { + handleOnEVMDeposited({ + tss, + provider, + protocolContracts, + args, + deployer, + fungibleModuleSigner, + foreignCoins, + exitOnError, + chainID: "5", + chain: "ethereum", + gatewayEVM: contractsEthereum.gatewayEVM, + custody: contractsEthereum.custody, + }); + }); + + contractsEthereum.gatewayEVM.on( + "DepositedAndCalled", + async (...args: Array) => { + handleOnEVMDepositedAndCalled({ + tss, + provider, + protocolContracts, + args, + deployer, + fungibleModuleSigner, + foreignCoins, + exitOnError, + chainID: "5", + chain: "ethereum", + gatewayEVM: contractsEthereum.gatewayEVM, + custody: contractsEthereum.custody, + }); + } + ); + + contractsBNB.gatewayEVM.on("Called", async (...args: Array) => { return await handleOnEVMCalled({ tss, provider, @@ -363,10 +417,14 @@ export const initLocalnet = async ({ fungibleModuleSigner, foreignCoins, exitOnError, + chainID: "97", + chain: "bnb", + gatewayEVM: contractsBNB.gatewayEVM, + custody: contractsBNB.custody, }); }); - protocolContracts.gatewayEVM.on("Deposited", async (...args: Array) => { + contractsBNB.gatewayEVM.on("Deposited", async (...args: Array) => { handleOnEVMDeposited({ tss, provider, @@ -376,22 +434,79 @@ export const initLocalnet = async ({ fungibleModuleSigner, foreignCoins, exitOnError, + chainID: "97", + chain: "bnb", + gatewayEVM: contractsBNB.gatewayEVM, + custody: contractsBNB.custody, }); }); - process.stdin.resume(); + contractsBNB.gatewayEVM.on( + "DepositedAndCalled", + async (...args: Array) => { + handleOnEVMDepositedAndCalled({ + tss, + provider, + protocolContracts, + args, + deployer, + fungibleModuleSigner, + foreignCoins, + exitOnError, + chainID: "97", + chain: "bnb", + gatewayEVM: contractsBNB.gatewayEVM, + custody: contractsBNB.custody, + }); + } + ); - return { - gatewayEVM: protocolContracts.gatewayEVM.target, - gatewayZetaChain: protocolContracts.gatewayZEVM.target, - zetaEVM: protocolContracts.testEVMZeta.target, - zetaZetaChain: protocolContracts.wzeta.target, - uniswapFactory: protocolContracts.uniswapFactoryInstance.target, - uniswapRouter: protocolContracts.uniswapRouterInstance.target, - fungibleModuleZetaChain: FUNGIBLE_MODULE_ADDRESS, - foreignCoins, - sytemContractZetaChain: protocolContracts.systemContract.target, - custodyEVM: protocolContracts.custodyEVM.target, - tssEVM: await tss.getAddress(), - }; + return [ + ...Object.entries(protocolContracts) + .filter(([_, value]) => value.target !== undefined) + .map(([key, value]) => { + return { + chain: "zetachain", + type: key, + address: value.target, + }; + }), + ...Object.entries(foreignCoins).map(([key, value]) => { + return { + chain: "zetachain", + type: value.name, + address: value.zrc20_contract_address, + }; + }), + ...Object.entries(foreignCoins) + .map(([key, value]) => { + if (value.asset) { + return { + chain: value.foreign_chain_id === "5" ? "ethereum" : "bnb", + type: `ERC-20 ${value.symbol}`, + address: value.asset, + }; + } + }) + .filter(Boolean), + { + chain: "zetachain", + type: "tss", + address: await protocolContracts.tss.getAddress(), + }, + ...Object.entries(contractsEthereum).map(([key, value]) => { + return { + chain: "ethereum", + type: key, + address: value.target, + }; + }), + ...Object.entries(contractsBNB).map(([key, value]) => { + return { + chain: "bnb", + type: key, + address: value.target, + }; + }), + ]; }; diff --git a/packages/localnet/src/log.ts b/packages/localnet/src/log.ts index 0da53c6..774ad5a 100644 --- a/packages/localnet/src/log.ts +++ b/packages/localnet/src/log.ts @@ -1,12 +1,12 @@ import ansis from "ansis"; -export const log = (chain: "EVM" | "ZetaChain", ...messages: string[]) => { +export const log = (chain: string, ...messages: string[]) => { const color = chain === "ZetaChain" ? ansis.green : ansis.cyan; const combinedMessage = messages.join(" "); console.log(color(`[${ansis.bold(chain)}]: ${combinedMessage}`)); }; -export const logErr = (chain: "EVM" | "ZetaChain", ...messages: string[]) => { +export const logErr = (chain: string, ...messages: string[]) => { const combinedMessage = messages.join(" "); log(chain, ansis.red(combinedMessage)); }; diff --git a/packages/tasks/src/localnet.ts b/packages/tasks/src/localnet.ts index de893eb..8b43055 100644 --- a/packages/tasks/src/localnet.ts +++ b/packages/tasks/src/localnet.ts @@ -89,50 +89,31 @@ const localnet = async (args: any) => { }; try { - const addr = await initLocalnet({ + const addresses = await initLocalnet({ port: args.port, exitOnError: args.exitOnError, }); - // EVM Contract Addresses - const evmHeader = "\nEVM Contract Addresses"; - console.log(ansis.cyan(`${evmHeader}\n${"=".repeat(evmHeader.length)}`)); - - const evmAddresses = { - "Gateway EVM": addr.gatewayEVM, - "ERC-20 Custody": addr.custodyEVM, - TSS: addr.tssEVM, - ZETA: addr.zetaEVM, - ...addr.foreignCoins - .filter((coin: any) => coin.asset !== "") - .reduce((acc: any, coin: any) => { - acc[`ERC-20 ${coin.symbol}`] = coin.asset; - return acc; - }, {}), - }; - - console.table(evmAddresses); - - const zetaHeader = "\nZetaChain Contract Addresses"; - console.log(ansis.green(`${zetaHeader}\n${"=".repeat(zetaHeader.length)}`)); + // Get unique chains + const chains = [...new Set(addresses.map((item: any) => item.chain))]; - const zetaAddresses = { - "Gateway ZetaChain": addr.gatewayZetaChain, - ZETA: addr.zetaZetaChain, - "Fungible Module": addr.fungibleModuleZetaChain, - "System Contract": addr.sytemContractZetaChain, - "Uniswap Router": addr.uniswapRouter, - ...addr.foreignCoins.reduce((acc: any, coin: any) => { - acc[`ZRC-20 ${coin.symbol}`] = coin.zrc20_contract_address; - return acc; - }, {}), - }; + // Create tables for each chain + chains.forEach((chain) => { + const chainContracts = addresses + .filter((contract: any) => contract.chain === chain) + .reduce((acc: any, { type, address }: any) => { + acc[type] = address; + return acc; + }, {}); - console.table(zetaAddresses); + console.log(`\n${chain.toUpperCase()}`); + console.table(chainContracts); + }); + // Write PID to localnet.json in JSON format fs.writeFileSync( LOCALNET_JSON_FILE, - JSON.stringify({ pid: process.pid, addresses: addr }, null, 2), + JSON.stringify({ pid: process.pid, addresses }, null, 2), "utf-8" ); } catch (error: any) { diff --git a/yarn.lock b/yarn.lock index d5ce533..65b4d79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -90,7 +90,22 @@ resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== -"@ethersproject/abi@^5.1.2": +"@ethersproject/abi@5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.3.tgz#2d643544abadf6e6b63150508af43475985c23db" + integrity sha512-CxKTdoZY4zDJLWXG6HzNH6znWK0M79WzzxHegDoecE3+K32pzfHOzuXg2/oGSTecZynFgpkjYXNPOqXVJlqClw== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -105,7 +120,20 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/abstract-provider@^5.7.0": +"@ethersproject/abstract-provider@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" + integrity sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.3" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/web" "^5.6.1" + +"@ethersproject/abstract-provider@^5.6.1", "@ethersproject/abstract-provider@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== @@ -118,7 +146,18 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/web" "^5.7.0" -"@ethersproject/abstract-signer@^5.7.0": +"@ethersproject/abstract-signer@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz#491f07fc2cbd5da258f46ec539664713950b0b33" + integrity sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ== + dependencies: + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + +"@ethersproject/abstract-signer@^5.6.2", "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== @@ -129,7 +168,18 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/address@^5.7.0": +"@ethersproject/address@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" + integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/rlp" "^5.6.1" + +"@ethersproject/address@^5.6.1", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -140,14 +190,46 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/rlp" "^5.7.0" -"@ethersproject/base64@^5.7.0": +"@ethersproject/base64@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" + integrity sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + +"@ethersproject/base64@^5.6.1", "@ethersproject/base64@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== dependencies: "@ethersproject/bytes" "^5.7.0" -"@ethersproject/bignumber@^5.7.0": +"@ethersproject/basex@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.1.tgz#badbb2f1d4a6f52ce41c9064f01eab19cc4c5305" + integrity sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/properties" "^5.6.0" + +"@ethersproject/basex@^5.6.1", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" + integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + bn.js "^5.2.1" + +"@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== @@ -156,21 +238,65 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" + integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== + dependencies: + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/bytes@^5.6.1", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/constants@^5.7.0": +"@ethersproject/constants@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" + integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + +"@ethersproject/constants@^5.6.1", "@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/hash@^5.7.0": +"@ethersproject/contracts@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.2.tgz#20b52e69ebc1b74274ff8e3d4e508de971c287bc" + integrity sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g== + dependencies: + "@ethersproject/abi" "^5.6.3" + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.2" + +"@ethersproject/hash@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" + integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== + dependencies: + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/hash@^5.6.1", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -185,7 +311,89 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/keccak256@^5.7.0": +"@ethersproject/hdnode@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.2.tgz#26f3c83a3e8f1b7985c15d1db50dc2903418b2d2" + integrity sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q== + dependencies: + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/basex" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.1" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/sha2" "^5.6.1" + "@ethersproject/signing-key" "^5.6.2" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/wordlists" "^5.6.1" + +"@ethersproject/hdnode@^5.6.2", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz#3f06ba555c9c0d7da46756a12ac53483fe18dd91" + integrity sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ== + dependencies: + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/hdnode" "^5.6.2" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.1" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.1" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/transactions" "^5.6.2" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/json-wallets@^5.6.1": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" + integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== + dependencies: + "@ethersproject/bytes" "^5.6.1" + js-sha3 "0.8.0" + +"@ethersproject/keccak256@^5.6.1", "@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -193,26 +401,111 @@ "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.0" -"@ethersproject/logger@^5.7.0": +"@ethersproject/logger@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" + integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== + +"@ethersproject/logger@^5.6.0", "@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@^5.7.0": +"@ethersproject/networks@5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.3.tgz#3ee3ab08f315b433b50c99702eb32e0cf31f899f" + integrity sha512-QZxRH7cA5Ut9TbXwZFiCyuPchdWi87ZtVNHWZd0R6YFgYtes2jQ3+bsslJ0WdyDe0i6QumqtoYqvY3rrQFRZOQ== + dependencies: + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/networks@^5.6.3", "@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/properties@^5.7.0": +"@ethersproject/pbkdf2@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz#f462fe320b22c0d6b1d72a9920a3963b09eb82d1" + integrity sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/sha2" "^5.6.1" + +"@ethersproject/pbkdf2@^5.6.1", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" + integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== + dependencies: + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/properties@^5.6.0", "@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@^5.7.0": +"@ethersproject/providers@5.6.8": + version "5.6.8" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.8.tgz#22e6c57be215ba5545d3a46cf759d265bb4e879d" + integrity sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w== + dependencies: + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/base64" "^5.6.1" + "@ethersproject/basex" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.3" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.1" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/sha2" "^5.6.1" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/web" "^5.6.1" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.1.tgz#66915943981bcd3e11bbd43733f5c3ba5a790255" + integrity sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/random@^5.6.1", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" + integrity sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/rlp@^5.6.1", "@ethersproject/rlp@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== @@ -220,7 +513,37 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/signing-key@^5.7.0": +"@ethersproject/sha2@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" + integrity sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + hash.js "1.1.7" + +"@ethersproject/sha2@^5.6.1", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" + integrity sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/signing-key@^5.6.2", "@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== @@ -232,7 +555,28 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/strings@^5.7.0": +"@ethersproject/solidity@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.1.tgz#5845e71182c66d32e6ec5eefd041fca091a473e2" + integrity sha512-KWqVLkUUoLBfL1iwdzUVlkNqAUIFMpbbeH0rgCfKmJp0vFtY4AsaN91gHKo9ZZLkC4UOm3cI3BmMV4N53BOq4g== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/sha2" "^5.6.1" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/strings@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" + integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/strings@^5.6.1", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -241,7 +585,22 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" + integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/signing-key" "^5.6.2" + +"@ethersproject/transactions@^5.6.2", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -256,7 +615,48 @@ "@ethersproject/rlp" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" -"@ethersproject/web@^5.7.0": +"@ethersproject/units@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.1.tgz#ecc590d16d37c8f9ef4e89e2005bda7ddc6a4e6f" + integrity sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/wallet@5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.2.tgz#cd61429d1e934681e413f4bc847a5f2f87e3a03c" + integrity sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg== + dependencies: + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/hdnode" "^5.6.2" + "@ethersproject/json-wallets" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.1" + "@ethersproject/signing-key" "^5.6.2" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/wordlists" "^5.6.1" + +"@ethersproject/web@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" + integrity sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA== + dependencies: + "@ethersproject/base64" "^5.6.1" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/web@^5.6.1", "@ethersproject/web@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== @@ -267,6 +667,28 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@ethersproject/wordlists@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.1.tgz#1e78e2740a8a21e9e99947e47979d72e130aeda1" + integrity sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/wordlists@^5.6.1", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@fastify/busboy@^2.0.0": version "2.1.1" resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" @@ -811,13 +1233,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== -"@types/node@22.7.5": - version "22.7.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b" - integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ== - dependencies: - undici-types "~6.19.2" - "@types/node@^22.5.2": version "22.5.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.4.tgz#83f7d1f65bc2ed223bdbf57c7884f1d5a4fa84e8" @@ -967,15 +1382,15 @@ dependencies: dotenv "^16.1.4" -"@zetachain/protocol-contracts@10.0.0-rc11": - version "10.0.0-rc11" - resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-10.0.0-rc11.tgz#53f55ead492f7b5802b1feae4e51abc75730af33" - integrity sha512-qWazjqnIGRngf4OmyeSIv7sHICQRdMQ1CKPIQIqxA8qFR+gHhDHSfvMdRAvgWbsfkimXOIFiHVIATypyWhviJw== +"@zetachain/protocol-contracts@11.0.0-rc3": + version "11.0.0-rc3" + resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-11.0.0-rc3.tgz#9b719391d0728fd1b4e046c5f496180a45ecf0d5" + integrity sha512-Q8lOFOi7S1wdOfOBZPTxsOoyV6kyWwYEhg4vk+HmB36n0Q6A2VvTI7qmw8rxCvq0a5BUASC8IYx0+HzsOPvNOw== dependencies: "@openzeppelin/contracts" "^5.0.2" "@openzeppelin/contracts-upgradeable" "^5.0.2" "@zetachain/networks" "^10.0.0" - ethers "^6.13.1" + ethers "5.6.8" acorn-jsx@^5.3.2: version "5.3.2" @@ -999,6 +1414,11 @@ adm-zip@^0.4.16: resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + aes-js@4.0.0-beta.5: version "4.0.0-beta.5" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" @@ -1134,6 +1554,11 @@ base-x@^3.0.2: dependencies: safe-buffer "^5.0.1" +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + binary-extensions@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" @@ -1771,18 +2196,41 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" -ethers@^6.13.1: - version "6.13.4" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.4.tgz#bd3e1c3dc1e7dc8ce10f9ffb4ee40967a651b53c" - integrity sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA== - 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" +ethers@5.6.8: + version "5.6.8" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.8.tgz#d36b816b4896341a80a8bbd2a44e8cb6e9b98dd4" + integrity sha512-YxIGaltAOdvBFPZwIkyHnXbW40f1r8mHUgapW6dxkO+6t7H6wY8POUn0Kbxrd/N7I4hHxyi7YCddMAH/wmho2w== + dependencies: + "@ethersproject/abi" "5.6.3" + "@ethersproject/abstract-provider" "5.6.1" + "@ethersproject/abstract-signer" "5.6.2" + "@ethersproject/address" "5.6.1" + "@ethersproject/base64" "5.6.1" + "@ethersproject/basex" "5.6.1" + "@ethersproject/bignumber" "5.6.2" + "@ethersproject/bytes" "5.6.1" + "@ethersproject/constants" "5.6.1" + "@ethersproject/contracts" "5.6.2" + "@ethersproject/hash" "5.6.1" + "@ethersproject/hdnode" "5.6.2" + "@ethersproject/json-wallets" "5.6.1" + "@ethersproject/keccak256" "5.6.1" + "@ethersproject/logger" "5.6.0" + "@ethersproject/networks" "5.6.3" + "@ethersproject/pbkdf2" "5.6.1" + "@ethersproject/properties" "5.6.0" + "@ethersproject/providers" "5.6.8" + "@ethersproject/random" "5.6.1" + "@ethersproject/rlp" "5.6.1" + "@ethersproject/sha2" "5.6.1" + "@ethersproject/signing-key" "5.6.2" + "@ethersproject/solidity" "5.6.1" + "@ethersproject/strings" "5.6.1" + "@ethersproject/transactions" "5.6.2" + "@ethersproject/units" "5.6.1" + "@ethersproject/wallet" "5.6.2" + "@ethersproject/web" "5.6.1" + "@ethersproject/wordlists" "5.6.1" ethers@^6.13.2: version "6.13.2" @@ -2947,7 +3395,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scrypt-js@^3.0.0: +scrypt-js@3.0.1, scrypt-js@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== @@ -3228,11 +3676,6 @@ tslib@2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tslib@2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" - integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== - tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -3405,6 +3848,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + ws@8.17.1: version "8.17.1" resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"