From 92385a24ed7c5fd8f36fa78f2af6efe0a8cad0dd Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 17:44:50 +0300 Subject: [PATCH 01/44] Update eslint config --- .eslintrc.cjs | 36 +++++++------ hardhat.config.ts | 2 +- src/abi.ts | 4 +- src/deploy.ts | 30 +++++------ src/gnosis-safe.ts | 42 +++++++-------- src/multiSend.ts | 4 +- src/submitters/auto-submitter.ts | 36 ++++++------- src/submitters/eoa-submitter.ts | 8 +-- .../safe-ima-legacy-marionette-submitter.ts | 10 ++-- .../safe-ima-marionette-submitter.ts | 8 +-- src/submitters/safe-submitter.ts | 10 ++-- src/submitters/safe-to-ima-submitter.ts | 25 +++++---- src/submitters/submitter.ts | 4 +- src/submitters/types/marionette.ts | 6 +-- src/types/SkaleManifestData.ts | 4 +- src/upgrader.ts | 54 +++++++++---------- src/verification.ts | 6 +-- src/version.ts | 11 ++-- 18 files changed, 151 insertions(+), 149 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 654fefb..0a8e4bd 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,20 +1,26 @@ /* eslint-env node */ module.exports = { - extends: [ - // 'eslint:all', - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended' + "extends": [ + // "eslint:all", + "eslint:recommended", + "plugin:@typescript-eslint/recommended" ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - root: true, - rules: { - "object-curly-spacing": [ "error", "always" ], - "padded-blocks": [ "error", "never" ], - "one-var": ["error", "consecutive"] - }, - ignorePatterns: [ + "ignorePatterns": [ "dist/**", "typechain-types/**" - ] - }; + ], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "root": true, + "rules": { + "object-curly-spacing": "error", + "one-var": [ + "error", + "never" + ], + "padded-blocks": [ + "error", + "never" + ] + } +}; diff --git a/hardhat.config.ts b/hardhat.config.ts index 3829bb5..12d206e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,4 +1,4 @@ -import { HardhatUserConfig } from "hardhat/config"; +import {HardhatUserConfig} from "hardhat/config"; import '@typechain/hardhat' import "@nomiclabs/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; diff --git a/src/abi.ts b/src/abi.ts index dae5fa3..773a529 100644 --- a/src/abi.ts +++ b/src/abi.ts @@ -1,4 +1,4 @@ -import { Interface } from "ethers/lib/utils"; +import {Interface} from "ethers/lib/utils"; export function getAbi(contractInterface: Interface) { const abi = JSON.parse(contractInterface.format("json") as string) as []; @@ -7,7 +7,7 @@ export function getAbi(contractInterface: Interface) { if (obj.type === "function") { const func = obj as {name: string, type: string, inputs: object[], outputs: object[]}; func.inputs.concat(func.outputs).forEach((output: object) => { - Object.assign(output, Object.assign({ name: "" }, output)); + Object.assign(output, Object.assign({name: ""}, output)); }) } }); diff --git a/src/deploy.ts b/src/deploy.ts index 49f2e17..e0b5db6 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,13 +1,13 @@ -import { Manifest, hashBytecode } from "@openzeppelin/upgrades-core"; -import { ethers, artifacts } from "hardhat"; -import { promises as fs } from 'fs'; -import { SkaleManifestData } from "./types/SkaleManifestData"; -import { Artifact } from "hardhat/types"; +import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; +import {ethers, artifacts} from "hardhat"; +import {promises as fs} from 'fs'; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {Artifact} from "hardhat/types"; async function _deployLibrary(libraryName: string) { const - Library = await ethers.getContractFactory(libraryName), - library = await Library.deploy(); + Library = await ethers.getContractFactory(libraryName); + const library = await Library.deploy(); await library.deployed(); return library.address; } @@ -41,9 +41,9 @@ function _linkBytecode(artifact: Artifact, libraries: Map) { export async function getLinkedContractFactory(contractName: string, libraries: Map) { const - cArtifact = await artifacts.readArtifact(contractName), - linkedBytecode = _linkBytecode(cArtifact, libraries), - ContractFactory = await ethers.getContractFactory(cArtifact.abi, linkedBytecode); + cArtifact = await artifacts.readArtifact(contractName); + const linkedBytecode = _linkBytecode(cArtifact, libraries); + const ContractFactory = await ethers.getContractFactory(cArtifact.abi, linkedBytecode); return ContractFactory; } @@ -52,7 +52,7 @@ export async function getManifestFile(): Promise { } export async function getContractFactory(contract: string) { - const { linkReferences } = await artifacts.readArtifact(contract); + const {linkReferences} = await artifacts.readArtifact(contract); if (!Object.keys(linkReferences).length) return await ethers.getContractFactory(contract); @@ -63,10 +63,10 @@ export async function getContractFactory(contract: string) { } const - libraries = await deployLibraries(libraryNames), - libraryArtifacts: { [key: string]: unknown } = {}; + libraries = await deployLibraries(libraryNames); + const libraryArtifacts: { [key: string]: unknown } = {}; for (const [libraryName, libraryAddress] of libraries.entries()) { - const { bytecode } = await artifacts.readArtifact(libraryName); + const {bytecode} = await artifacts.readArtifact(libraryName); libraryArtifacts[libraryName] = { "address": libraryAddress, "bytecodeHash": hashBytecode(bytecode) @@ -78,7 +78,7 @@ export async function getContractFactory(contract: string) { Object.assign(libraryArtifacts, manifest.libraries); } finally { if (manifest !== undefined) { - Object.assign(manifest, { libraries: libraryArtifacts }); + Object.assign(manifest, {libraries: libraryArtifacts}); } await fs.writeFile(await getManifestFile(), JSON.stringify(manifest, null, 4)); } diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 7972bb3..baec707 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; -import { ethers } from "hardhat"; -import { UnsignedTransaction } from "ethers"; +import {ethers} from "hardhat"; +import {UnsignedTransaction} from "ethers"; import SafeApiKit from '@safe-global/api-kit' -import Safe, { EthersAdapter } from '@safe-global/protocol-kit' -import { MetaTransactionData, SafeTransactionDataPartial, SafeTransaction } from '@safe-global/safe-core-sdk-types' +import Safe, {EthersAdapter} from '@safe-global/protocol-kit' +import {MetaTransactionData, SafeTransactionDataPartial, SafeTransaction} from '@safe-global/safe-core-sdk-types' enum Network { @@ -36,8 +36,8 @@ export async function createMultiSendTransaction(safeAddress: string, transactio } const - safeService = await getSafeService(), - nonce = await safeService.getNextNonce(safeAddress); + safeService = await getSafeService(); + const nonce = await safeService.getNextNonce(safeAddress); console.log("Will send tx to Gnosis with nonce", nonce); const @@ -48,10 +48,10 @@ export async function createMultiSendTransaction(safeAddress: string, transactio gasToken: ethers.constants.AddressZero, // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether refundReceiver: ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) nonce: nonce // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce - }, - ethAdapter = await getEthAdapter(), - safeSdk = await Safe.create({ ethAdapter, safeAddress }), - safeTransaction = await safeSdk.createTransaction({ safeTransactionData, options }); + }; + const ethAdapter = await getEthAdapter(); + const safeSdk = await Safe.create({ethAdapter, safeAddress}); + const safeTransaction = await safeSdk.createTransaction({safeTransactionData, options}); await estimateSafeTransaction(safeAddress, safeTransactionData); @@ -80,12 +80,12 @@ async function estimateSafeTransaction(safeAddress: string, safeTransactionData: async function proposeTransaction(safeAddress: string, safeTransaction: SafeTransaction) { const - [ safeOwner ] = await ethers.getSigners(), - ethAdapter = await getEthAdapter(), - safeSdk = await Safe.create({ ethAdapter, safeAddress }), - safeTxHash = await safeSdk.getTransactionHash(safeTransaction), - senderSignature = await safeSdk.signTransactionHash(safeTxHash), - safeService = await getSafeService(); + [ safeOwner ] = await ethers.getSigners(); + const ethAdapter = await getEthAdapter(); + const safeSdk = await Safe.create({ethAdapter, safeAddress}); + const safeTxHash = await safeSdk.getTransactionHash(safeTransaction); + const senderSignature = await safeSdk.signTransactionHash(safeTxHash); + const safeService = await getSafeService(); await safeService.proposeTransaction({ safeAddress, safeTransactionData: safeTransaction.data, @@ -97,8 +97,8 @@ async function proposeTransaction(safeAddress: string, safeTransaction: SafeTran async function getEthAdapter(): Promise { const - [safeOwner] = await ethers.getSigners(), - ethAdapter = new EthersAdapter({ + [safeOwner] = await ethers.getSigners(); + const ethAdapter = new EthersAdapter({ ethers, signerOrProvider: safeOwner }); @@ -107,9 +107,9 @@ async function getEthAdapter(): Promise { async function getSafeService() { const - chainId = (await ethers.provider.getNetwork()).chainId, - ethAdapter: EthersAdapter = await getEthAdapter(), - safeService = new SafeApiKit({ + chainId = (await ethers.provider.getNetwork()).chainId; + const ethAdapter: EthersAdapter = await getEthAdapter(); + const safeService = new SafeApiKit({ txServiceUrl: getSafeTransactionUrl(chainId), ethAdapter }); diff --git a/src/multiSend.ts b/src/multiSend.ts index b4715f2..f397f70 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,4 +1,4 @@ -import { BigNumber } from "ethers"; +import {BigNumber} from "ethers"; function padWithZeros(value: string, targetLength: number) { return ("0".repeat(targetLength) + value).slice(-targetLength); @@ -45,4 +45,4 @@ export function encodeTransaction(operation: 0 | 1, to: string, value: BigNumber _dataLength, _data, ].join(""); -} \ No newline at end of file +} diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 28075dd..8feaa0c 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -1,22 +1,22 @@ -import { getManifestAdmin } from "@openzeppelin/hardhat-upgrades/dist/admin"; -import { Transaction } from "ethers"; -import { ProxyAdmin } from "../../typechain-types"; -import { Submitter } from "./submitter"; -import hre, { ethers } from "hardhat"; -import { EoaSubmitter } from "./eoa-submitter"; -import { SafeSubmitter } from "./safe-submitter"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; +import {Transaction} from "ethers"; +import {ProxyAdmin} from "../../typechain-types"; +import {Submitter} from "./submitter"; +import hre, {ethers} from "hardhat"; +import {EoaSubmitter} from "./eoa-submitter"; +import {SafeSubmitter} from "./safe-submitter"; import chalk from "chalk"; -import { SafeImaLegacyMarionetteSubmitter } from "./safe-ima-legacy-marionette-submitter"; -import { MARIONETTE_ADDRESS } from "./types/marionette"; -import { skaleContracts } from "@skalenetwork/skale-contracts-ethers-v5"; +import {SafeImaLegacyMarionetteSubmitter} from "./safe-ima-legacy-marionette-submitter"; +import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; export class AutoSubmitter extends Submitter { async submit(transactions: Transaction[]) { let submitter: Submitter; // TODO: remove unknown when move everything to ethers 6 const - proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin, - owner = await proxyAdmin.owner(); + proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; + const owner = await proxyAdmin.owner(); if (await hre.ethers.provider.getCode(owner) === "0x") { console.log("Owner is not a contract"); submitter = new EoaSubmitter(); @@ -27,10 +27,10 @@ export class AutoSubmitter extends Submitter { console.log("Marionette owner is detected"); const - imaInstance = await this._getImaInstance(), - mainnetChainId = this._getMainnetChainId(), - safeAddress = this._getSafeAddress(), - schainHash = this._getSchainHash(); + imaInstance = await this._getImaInstance(); + const mainnetChainId = this._getMainnetChainId(); + const safeAddress = this._getSafeAddress(); + const schainHash = this._getSchainHash(); // TODO: after marionette has multiSend functionality // query version and properly select a submitter @@ -78,8 +78,8 @@ export class AutoSubmitter extends Submitter { process.exit(1); } const - network = await skaleContracts.getNetworkByProvider(ethers.provider), - ima = await network.getProject("ima"); + network = await skaleContracts.getNetworkByProvider(ethers.provider); + const ima = await network.getProject("ima"); return await ima.getInstance(process.env.IMA); } diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 7954725..5e558c1 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -1,6 +1,6 @@ -import { ethers } from "hardhat"; -import { UnsignedTransaction } from "ethers"; -import { Submitter } from "./submitter"; +import {ethers} from "hardhat"; +import {UnsignedTransaction} from "ethers"; +import {Submitter} from "./submitter"; export class EoaSubmitter extends Submitter { async submit(transactions: UnsignedTransaction[]) { @@ -18,4 +18,4 @@ export class EoaSubmitter extends Submitter { console.log("The transaction was sent") } } -} \ No newline at end of file +} diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index abb6c8c..9682960 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -1,7 +1,7 @@ -import { BytesLike, UnsignedTransaction } from "ethers"; -import { ethers } from "hardhat"; -import { SafeToImaSubmitter } from "./safe-to-ima-submitter"; -import { MARIONETTE_ADDRESS } from "./types/marionette"; +import {BytesLike, UnsignedTransaction} from "ethers"; +import {ethers} from "hardhat"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; +import {MARIONETTE_ADDRESS} from "./types/marionette"; export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( @@ -56,4 +56,4 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { } await super.submit(transactionsToMarionette); } -} \ No newline at end of file +} diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index d54bc3c..e403d9e 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -1,7 +1,7 @@ -import { UnsignedTransaction } from "ethers"; -import { ethers } from "hardhat"; -import { SafeToImaSubmitter } from "./safe-to-ima-submitter"; -import { Marionette, MARIONETTE_ADDRESS } from "./types/marionette"; +import {UnsignedTransaction} from "ethers"; +import {ethers} from "hardhat"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; +import {Marionette, MARIONETTE_ADDRESS} from "./types/marionette"; export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( diff --git a/src/submitters/safe-submitter.ts b/src/submitters/safe-submitter.ts index ef7cad3..2557f93 100644 --- a/src/submitters/safe-submitter.ts +++ b/src/submitters/safe-submitter.ts @@ -1,7 +1,7 @@ -import { UnsignedTransaction } from "ethers"; -import { ethers } from "hardhat"; -import { createMultiSendTransaction } from "../gnosis-safe"; -import { Submitter } from "./submitter"; +import {UnsignedTransaction} from "ethers"; +import {ethers} from "hardhat"; +import {createMultiSendTransaction} from "../gnosis-safe"; +import {Submitter} from "./submitter"; export class SafeSubmitter extends Submitter { safeAddress: string; @@ -19,4 +19,4 @@ export class SafeSubmitter extends Submitter { } await createMultiSendTransaction(this.safeAddress, transactions); } -} \ No newline at end of file +} diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index e93e073..db939b9 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -1,6 +1,6 @@ -import { BytesLike, Contract, UnsignedTransaction } from "ethers"; -import { SafeSubmitter } from "./safe-submitter"; -import { Instance } from "@skalenetwork/skale-contracts-ethers-v5"; +import {BytesLike, Contract, UnsignedTransaction} from "ethers"; +import {SafeSubmitter} from "./safe-submitter"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; export class SafeToImaSubmitter extends SafeSubmitter { imaInstance: Instance; @@ -17,16 +17,15 @@ export class SafeToImaSubmitter extends SafeSubmitter { if (transactions.length > 1) { this._atomicityWarning(); } - const - messageProxyForMainnet = await this._getMessageProxyForMainnet(), - transactionsToIma = transactions.map((transaction) => { - return { - to: messageProxyForMainnet.address, - data: messageProxyForMainnet.interface.encodeFunctionData( - "postOutgoingMessage", - [this.targetSchainHash, transaction.to, transaction.data]) - } - }); + const messageProxyForMainnet = await this._getMessageProxyForMainnet(); + const transactionsToIma = transactions.map((transaction) => { + return { + to: messageProxyForMainnet.address, + data: messageProxyForMainnet.interface.encodeFunctionData( + "postOutgoingMessage", + [this.targetSchainHash, transaction.to, transaction.data]) + } + }); await super.submit(transactionsToIma); } diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index a6a31c1..727c91a 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -1,4 +1,4 @@ -import { UnsignedTransaction } from "ethers"; +import {UnsignedTransaction} from "ethers"; import chalk from "chalk"; export abstract class Submitter { @@ -15,4 +15,4 @@ export abstract class Submitter { console.log(chalk.yellow("Not atomic upgrade is performing")); } } -} \ No newline at end of file +} diff --git a/src/submitters/types/marionette.ts b/src/submitters/types/marionette.ts index 4c384c1..d9c2fc3 100644 --- a/src/submitters/types/marionette.ts +++ b/src/submitters/types/marionette.ts @@ -1,5 +1,5 @@ -import { BigNumberish, BytesLike } from "ethers"; -import { ethers as RawEthers } from "ethers" +import {BigNumberish, BytesLike} from "ethers"; +import {ethers as RawEthers} from "ethers" export const MARIONETTE_ADDRESS = "0xD2c0DeFACe000000000000000000000000000000"; @@ -14,4 +14,4 @@ export interface Marionette extends RawEthers.Contract { functionCalls: FunctionCallStruct[] ): Promise version(): Promise; -} \ No newline at end of file +} diff --git a/src/types/SkaleManifestData.ts b/src/types/SkaleManifestData.ts index 401a2ab..caabeff 100644 --- a/src/types/SkaleManifestData.ts +++ b/src/types/SkaleManifestData.ts @@ -1,4 +1,4 @@ -import { ManifestData } from "@openzeppelin/upgrades-core"; +import {ManifestData} from "@openzeppelin/upgrades-core"; export interface SkaleManifestData extends ManifestData { libraries: { @@ -7,4 +7,4 @@ export interface SkaleManifestData extends ManifestData { bytecodeHash: string } } -} \ No newline at end of file +} diff --git a/src/upgrader.ts b/src/upgrader.ts index 72e64b9..b40c541 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,18 +1,18 @@ import hre from "hardhat"; import chalk from "chalk"; -import { ProxyAdmin } from "../typechain-types"; -import { artifacts, ethers, network, upgrades } from "hardhat"; -import { getManifestAdmin } from "@openzeppelin/hardhat-upgrades/dist/admin"; -import { getVersion } from "./version"; -import { promises as fs } from "fs"; -import { deployLibraries, getLinkedContractFactory, getManifestFile } from "./deploy"; -import { UnsignedTransaction } from "ethers"; -import { getImplementationAddress, hashBytecode } from "@openzeppelin/upgrades-core"; -import { verify } from "./verification"; -import { Submitter } from "./submitters/submitter"; -import { SkaleManifestData } from "./types/SkaleManifestData"; -import { AutoSubmitter } from "./submitters/auto-submitter"; -import { Instance } from "@skalenetwork/skale-contracts-ethers-v5"; +import {ProxyAdmin} from "../typechain-types"; +import {artifacts, ethers, network, upgrades} from "hardhat"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; +import {getVersion} from "./version"; +import {promises as fs} from "fs"; +import {deployLibraries, getLinkedContractFactory, getManifestFile} from "./deploy"; +import {UnsignedTransaction} from "ethers"; +import {getImplementationAddress, hashBytecode} from "@openzeppelin/upgrades-core"; +import {verify} from "./verification"; +import {Submitter} from "./submitters/submitter"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {AutoSubmitter} from "./submitters/auto-submitter"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; export abstract class Upgrader { instance: Instance; @@ -75,13 +75,13 @@ export abstract class Upgrader { const contractsToUpgrade: {proxyAddress: string, implementationAddress: string, name: string}[] = []; for (const contract of this.contractNamesToUpgrade) { const - contractFactory = await this._getContractFactoryAndUpdateManifest(contract), - proxyAddress = (await this.instance.getContract(contract)).address; + contractFactory = await this._getContractFactoryAndUpdateManifest(contract); + const proxyAddress = (await this.instance.getContract(contract)).address; console.log(`Prepare upgrade of ${contract}`); const - currentImplementationAddress = await getImplementationAddress(network.provider, proxyAddress), - newImplementationAddress = await upgrades.prepareUpgrade( + currentImplementationAddress = await getImplementationAddress(network.provider, proxyAddress); + const newImplementationAddress = await upgrades.prepareUpgrade( proxyAddress, contractFactory, { @@ -134,23 +134,21 @@ export abstract class Upgrader { // private async _getContractFactoryAndUpdateManifest(contract: string) { - const - { linkReferences } = await artifacts.readArtifact(contract), - manifest = JSON.parse(await fs.readFile(await getManifestFile(), "utf-8")) as SkaleManifestData; + const {linkReferences} = await artifacts.readArtifact(contract); + const manifest = JSON.parse(await fs.readFile(await getManifestFile(), "utf-8")) as SkaleManifestData; if (!Object.keys(linkReferences).length) return await ethers.getContractFactory(contract); const - librariesToUpgrade = [], - oldLibraries: {[k: string]: string} = {}; + librariesToUpgrade = []; + const oldLibraries: {[k: string]: string} = {}; if (manifest.libraries === undefined) { - Object.assign(manifest, { libraries: {} }); + Object.assign(manifest, {libraries: {}}); } for (const key of Object.keys(linkReferences)) { - const - libraryName = Object.keys(linkReferences[key])[0], - { bytecode } = await artifacts.readArtifact(libraryName); + const libraryName = Object.keys(linkReferences[key])[0]; + const {bytecode} = await artifacts.readArtifact(libraryName); if (manifest.libraries[libraryName] === undefined) { librariesToUpgrade.push(libraryName); continue; @@ -164,8 +162,8 @@ export abstract class Upgrader { } const libraries = await deployLibraries(librariesToUpgrade); for (const [libraryName, libraryAddress] of libraries.entries()) { - const { bytecode } = await artifacts.readArtifact(libraryName); - manifest.libraries[libraryName] = { "address": libraryAddress, "bytecodeHash": hashBytecode(bytecode) }; + const {bytecode} = await artifacts.readArtifact(libraryName); + manifest.libraries[libraryName] = {"address": libraryAddress, "bytecodeHash": hashBytecode(bytecode)}; } Object.assign(libraries, oldLibraries); await fs.writeFile(await getManifestFile(), JSON.stringify(manifest, null, 4)); diff --git a/src/verification.ts b/src/verification.ts index ea39b6f..c6a295f 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -1,7 +1,7 @@ -import { ethers, run, network } from "hardhat"; -import { builtinChains } from "@nomicfoundation/hardhat-verify/internal/chain-config"; +import {ethers, run, network} from "hardhat"; +import {builtinChains} from "@nomicfoundation/hardhat-verify/internal/chain-config"; import chalk from "chalk"; -import { getImplementationAddress } from "@openzeppelin/upgrades-core"; +import {getImplementationAddress} from "@openzeppelin/upgrades-core"; export async function verify(contractName: string, contractAddress: string, constructorArguments: object) { const chainId = (await ethers.provider.getNetwork()).chainId; diff --git a/src/version.ts b/src/version.ts index 6c5cfb4..4fa857d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,5 +1,5 @@ -import { exec as asyncExec } from "child_process"; -import { promises as fs, existsSync } from "fs"; +import {exec as asyncExec} from "child_process"; +import {promises as fs, existsSync} from "fs"; import util from "util"; @@ -13,13 +13,12 @@ async function getVersionFilename(folder?: string) { (await exec("git rev-parse --show-toplevel")).stdout.trim() ); } - const - VERSION_FILENAME = 'VERSION', - path = `${folder}/${VERSION_FILENAME}`; + const VERSION_FILENAME = 'VERSION'; + const path = `${folder}/${VERSION_FILENAME}`; if (existsSync(path)) { return path; } - for (const entry of await fs.readdir(folder, { withFileTypes: true, recursive: true })) { + for (const entry of await fs.readdir(folder, {withFileTypes: true, recursive: true})) { if (entry.isFile() && entry.name === VERSION_FILENAME ) { return `${entry.path}/${entry.name}`; } From 9a171c5bfc4b08cd0cc1919ca117da959fc61767 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 18:02:53 +0300 Subject: [PATCH 02/44] Turn on all checks --- .eslintrc.cjs | 37 ++++- hardhat.config.ts | 8 +- src/abi.ts | 12 +- src/deploy.ts | 84 ++++++++--- src/gnosis-safe.ts | 136 ++++++++++------- src/multiSend.ts | 40 +++-- src/submitters/auto-submitter.ts | 133 +++++++++------- src/submitters/eoa-submitter.ts | 12 +- src/submitters/index.ts | 2 +- .../safe-ima-legacy-marionette-submitter.ts | 24 ++- .../safe-ima-marionette-submitter.ts | 81 +++++----- src/submitters/safe-submitter.ts | 10 +- src/submitters/safe-to-ima-submitter.ts | 32 ++-- src/submitters/submitter.ts | 6 +- src/submitters/types/marionette.ts | 2 +- src/upgrader.ts | 142 ++++++++++++------ src/verification.ts | 37 +++-- src/version.ts | 23 +-- 18 files changed, 521 insertions(+), 300 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0a8e4bd..bdcdef8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,7 +1,7 @@ /* eslint-env node */ module.exports = { "extends": [ - // "eslint:all", + "eslint:all", "eslint:recommended", "plugin:@typescript-eslint/recommended" ], @@ -21,6 +21,39 @@ module.exports = { "padded-blocks": [ "error", "never" - ] + ], + + "class-methods-use-this": "warn", + "consistent-return": "warn", + "eqeqeq": "warn", + "func-style": "warn", + "id-length": "warn", + "init-declarations": "warn", + "line-comment-position": "warn", + "lines-around-comment": "warn", + "max-depth": "warn", + "max-len": "warn", + "max-lines-per-function": "warn", + "max-params": "warn", + "max-statements": "warn", + "multiline-comment-style": "warn", + "no-await-in-loop": "warn", + "no-console": "warn", + "no-continue": "warn", + "no-duplicate-imports": "warn", + "no-inline-comments": "warn", + "no-magic-numbers": "warn", + "no-mixed-operators": "warn", + "no-negated-condition": "warn", + "no-shadow": "warn", + "no-ternary": "warn", + "no-undefined": "warn", + "no-underscore-dangle": "warn", + "no-use-before-define": "warn", + "no-warning-comments": "warn", + "prefer-destructuring": "warn", + "radix": "warn", + "sort-imports": "warn", + "sort-keys": "warn" } }; diff --git a/hardhat.config.ts b/hardhat.config.ts index 12d206e..a51de98 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,12 +1,12 @@ import {HardhatUserConfig} from "hardhat/config"; -import '@typechain/hardhat' +import "@typechain/hardhat"; import "@nomiclabs/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; const config: HardhatUserConfig = { - typechain: { - target: "ethers-v5", - externalArtifacts: ['node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json'] + "typechain": { + "target": "ethers-v5", + "externalArtifacts": ["node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json"] } }; diff --git a/src/abi.ts b/src/abi.ts index 773a529..af56d5d 100644 --- a/src/abi.ts +++ b/src/abi.ts @@ -1,14 +1,20 @@ import {Interface} from "ethers/lib/utils"; -export function getAbi(contractInterface: Interface) { +export function getAbi (contractInterface: Interface) { const abi = JSON.parse(contractInterface.format("json") as string) as []; abi.forEach((obj: {type: string}) => { if (obj.type === "function") { const func = obj as {name: string, type: string, inputs: object[], outputs: object[]}; func.inputs.concat(func.outputs).forEach((output: object) => { - Object.assign(output, Object.assign({name: ""}, output)); - }) + Object.assign( + output, + { + "name": "", + ...output + } + ); + }); } }); diff --git a/src/deploy.ts b/src/deploy.ts index e0b5db6..002ff27 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,36 +1,45 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; -import {ethers, artifacts} from "hardhat"; -import {promises as fs} from 'fs'; +import {artifacts, ethers} from "hardhat"; +import {promises as fs} from "fs"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {Artifact} from "hardhat/types"; -async function _deployLibrary(libraryName: string) { +async function _deployLibrary (libraryName: string) { const Library = await ethers.getContractFactory(libraryName); - const library = await Library.deploy(); + const library = await Library.deploy(); await library.deployed(); return library.address; } -export async function deployLibraries(libraryNames: string[]) { +export async function deployLibraries (libraryNames: string[]) { const libraries = new Map(); for (const libraryName of libraryNames) { - libraries.set(libraryName, await _deployLibrary(libraryName)); + libraries.set( + libraryName, + await _deployLibrary(libraryName) + ); } return libraries; } -function _linkBytecode(artifact: Artifact, libraries: Map) { - let bytecode = artifact.bytecode; +function _linkBytecode (artifact: Artifact, libraries: Map) { + let {bytecode} = artifact; for (const [, fileReferences] of Object.entries(artifact.linkReferences)) { - for (const [libName, fixups] of Object.entries(fileReferences)) { + for (const [ + libName, + fixups + ] of Object.entries(fileReferences)) { const addr = libraries.get(libName); if (addr === undefined) { continue; } for (const fixup of fixups) { bytecode = - bytecode.substr(0, 2 + fixup.start * 2) + + bytecode.substr( + 0, + 2 + fixup.start * 2 + ) + addr.substr(2) + bytecode.substr(2 + (fixup.start + fixup.length) * 2); } @@ -39,22 +48,29 @@ function _linkBytecode(artifact: Artifact, libraries: Map) { return bytecode; } -export async function getLinkedContractFactory(contractName: string, libraries: Map) { +export async function getLinkedContractFactory (contractName: string, libraries: Map) { const cArtifact = await artifacts.readArtifact(contractName); - const linkedBytecode = _linkBytecode(cArtifact, libraries); - const ContractFactory = await ethers.getContractFactory(cArtifact.abi, linkedBytecode); + const linkedBytecode = _linkBytecode( + cArtifact, + libraries + ); + const ContractFactory = await ethers.getContractFactory( + cArtifact.abi, + linkedBytecode + ); return ContractFactory; } -export async function getManifestFile(): Promise { +export async function getManifestFile (): Promise { return (await Manifest.forNetwork(ethers.provider)).file; } -export async function getContractFactory(contract: string) { +export async function getContractFactory (contract: string) { const {linkReferences} = await artifacts.readArtifact(contract); - if (!Object.keys(linkReferences).length) + if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); + } const libraryNames = []; for (const key of Object.keys(linkReferences)) { @@ -64,8 +80,11 @@ export async function getContractFactory(contract: string) { const libraries = await deployLibraries(libraryNames); - const libraryArtifacts: { [key: string]: unknown } = {}; - for (const [libraryName, libraryAddress] of libraries.entries()) { + const libraryArtifacts: { [key: string]: unknown } = {}; + for (const [ + libraryName, + libraryAddress + ] of libraries.entries()) { const {bytecode} = await artifacts.readArtifact(libraryName); libraryArtifacts[libraryName] = { "address": libraryAddress, @@ -74,13 +93,32 @@ export async function getContractFactory(contract: string) { } let manifest; try { - manifest = JSON.parse(await fs.readFile(await getManifestFile(), "utf-8")) as SkaleManifestData; - Object.assign(libraryArtifacts, manifest.libraries); + manifest = JSON.parse(await fs.readFile( + await getManifestFile(), + "utf-8" + )) as SkaleManifestData; + Object.assign( + libraryArtifacts, + manifest.libraries + ); } finally { if (manifest !== undefined) { - Object.assign(manifest, {libraries: libraryArtifacts}); + Object.assign( + manifest, + {"libraries": libraryArtifacts} + ); } - await fs.writeFile(await getManifestFile(), JSON.stringify(manifest, null, 4)); + await fs.writeFile( + await getManifestFile(), + JSON.stringify( + manifest, + null, + 4 + ) + ); } - return await getLinkedContractFactory(contract, libraries); + return await getLinkedContractFactory( + contract, + libraries + ); } diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index baec707..1363bce 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; import {ethers} from "hardhat"; import {UnsignedTransaction} from "ethers"; -import SafeApiKit from '@safe-global/api-kit' -import Safe, {EthersAdapter} from '@safe-global/protocol-kit' -import {MetaTransactionData, SafeTransactionDataPartial, SafeTransaction} from '@safe-global/safe-core-sdk-types' +import SafeApiKit from "@safe-global/api-kit"; +import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; +import {MetaTransactionData, SafeTransaction, SafeTransactionDataPartial} from "@safe-global/safe-core-sdk-types"; enum Network { @@ -13,113 +13,133 @@ enum Network { HARDHAT = 31337, } -// constants +// Constants const URLS = { - safe_transaction: { + "safe_transaction": { [Network.MAINNET]: "https://safe-transaction-mainnet.safe.global", - [Network.GOERLI]: "https://safe-transaction-goerli.safe.global", + [Network.GOERLI]: "https://safe-transaction-goerli.safe.global" } -} +}; -// public functions +// Public functions -export async function createMultiSendTransaction(safeAddress: string, transactions: UnsignedTransaction[]) { +export async function createMultiSendTransaction (safeAddress: string, transactions: UnsignedTransaction[]) { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ - to: transaction.to ? transaction.to : ethers.constants.AddressZero, - data: transaction.data ? transaction.data.toString() : "0x", - value: transaction.value ? transaction.value.toString() : "0", - operation: 0, + "to": transaction.to + ? transaction.to + : ethers.constants.AddressZero, + "data": transaction.data + ? transaction.data.toString() + : "0x", + "value": transaction.value + ? transaction.value.toString() + : "0", + "operation": 0 }); } const safeService = await getSafeService(); - const nonce = await safeService.getNextNonce(safeAddress); - console.log("Will send tx to Gnosis with nonce", nonce); + const nonce = await safeService.getNextNonce(safeAddress); + console.log( + "Will send tx to Gnosis with nonce", + nonce + ); const options = { - safeTxGas: "0", // Max gas to use in the transaction - baseGas: "0", // Gas costs not related to the transaction execution (signature check, refund payment...) - gasPrice: "0", // Gas price used for the refund calculation - gasToken: ethers.constants.AddressZero, // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether - refundReceiver: ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) - nonce: nonce // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce + "safeTxGas": "0", // Max gas to use in the transaction + "baseGas": "0", // Gas costs not related to the transaction execution (signature check, refund payment...) + "gasPrice": "0", // Gas price used for the refund calculation + "gasToken": ethers.constants.AddressZero, // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether + "refundReceiver": ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) + nonce // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce }; - const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ethAdapter, safeAddress}); - const safeTransaction = await safeSdk.createTransaction({safeTransactionData, options}); + const ethAdapter = await getEthAdapter(); + const safeSdk = await Safe.create({ethAdapter, + safeAddress}); + const safeTransaction = await safeSdk.createTransaction({safeTransactionData, + options}); - await estimateSafeTransaction(safeAddress, safeTransactionData); + await estimateSafeTransaction( + safeAddress, + safeTransactionData + ); - await proposeTransaction(safeAddress, safeTransaction); + await proposeTransaction( + safeAddress, + safeTransaction + ); } -// private functions +// Private functions -async function estimateSafeTransaction(safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) { +async function estimateSafeTransaction (safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) { console.log("Estimate gas"); const safeService = await getSafeService(); for (const transaction of safeTransactionData as MetaTransactionData[]) { const estimateResponse = await safeService.estimateSafeTransaction( safeAddress, { - to: transaction.to, - value: transaction.value, - data: transaction.data, - operation: transaction.operation || 0, + "to": transaction.to, + "value": transaction.value, + "data": transaction.data, + "operation": transaction.operation || 0 } ); - console.log(chalk.cyan(`Recommend to set gas limit to ${parseInt(estimateResponse.safeTxGas, 10)}`)); + console.log(chalk.cyan(`Recommend to set gas limit to ${parseInt( + estimateResponse.safeTxGas, + 10 + )}`)); } console.log(chalk.green("Send transaction to gnosis safe")); } -async function proposeTransaction(safeAddress: string, safeTransaction: SafeTransaction) { +async function proposeTransaction (safeAddress: string, safeTransaction: SafeTransaction) { const - [ safeOwner ] = await ethers.getSigners(); - const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ethAdapter, safeAddress}); - const safeTxHash = await safeSdk.getTransactionHash(safeTransaction); - const senderSignature = await safeSdk.signTransactionHash(safeTxHash); - const safeService = await getSafeService(); + [safeOwner] = await ethers.getSigners(); + const ethAdapter = await getEthAdapter(); + const safeSdk = await Safe.create({ethAdapter, + safeAddress}); + const safeTxHash = await safeSdk.getTransactionHash(safeTransaction); + const senderSignature = await safeSdk.signTransactionHash(safeTxHash); + const safeService = await getSafeService(); await safeService.proposeTransaction({ safeAddress, - safeTransactionData: safeTransaction.data, + "safeTransactionData": safeTransaction.data, safeTxHash, - senderAddress: safeOwner.address, - senderSignature: senderSignature.data + "senderAddress": safeOwner.address, + "senderSignature": senderSignature.data }); } -async function getEthAdapter(): Promise { +async function getEthAdapter (): Promise { const [safeOwner] = await ethers.getSigners(); - const ethAdapter = new EthersAdapter({ - ethers, - signerOrProvider: safeOwner - }); + const ethAdapter = new EthersAdapter({ + ethers, + "signerOrProvider": safeOwner + }); return ethAdapter; } -async function getSafeService() { +async function getSafeService () { const - chainId = (await ethers.provider.getNetwork()).chainId; - const ethAdapter: EthersAdapter = await getEthAdapter(); - const safeService = new SafeApiKit({ - txServiceUrl: getSafeTransactionUrl(chainId), - ethAdapter - }); + {chainId} = await ethers.provider.getNetwork(); + const ethAdapter: EthersAdapter = await getEthAdapter(); + const safeService = new SafeApiKit({ + "txServiceUrl": getSafeTransactionUrl(chainId), + ethAdapter + }); return safeService; } -function getSafeTransactionUrl(chainId: number) { +function getSafeTransactionUrl (chainId: number) { if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { return URLS.safe_transaction[chainId as keyof typeof URLS.safe_transaction]; - } else { - throw Error(`Can't get safe-transaction url at network with chainId = ${chainId}`); } + throw Error(`Can't get safe-transaction url at network with chainId = ${chainId}`); } diff --git a/src/multiSend.ts b/src/multiSend.ts index f397f70..aa04415 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,15 +1,15 @@ import {BigNumber} from "ethers"; -function padWithZeros(value: string, targetLength: number) { +function padWithZeros (value: string, targetLength: number) { return ("0".repeat(targetLength) + value).slice(-targetLength); } -export function encodeTransaction(operation: 0 | 1, to: string, value: BigNumber | number, data: string) { - /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte), - /// to as a address (=> 20 bytes), - /// value as a uint256 (=> 32 bytes), - /// data length as a uint256 (=> 32 bytes), - /// data as bytes. +export function encodeTransaction (operation: 0 | 1, to: string, value: BigNumber | number, data: string) { + // / operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte), + // / to as a address (=> 20 bytes), + // / value as a uint256 (=> 32 bytes), + // / data length as a uint256 (=> 32 bytes), + // / data as bytes. let _operation; if (operation === 0) { @@ -17,32 +17,42 @@ export function encodeTransaction(operation: 0 | 1, to: string, value: BigNumber } else if (operation === 1) { _operation = "01"; } else { - throw Error(`Operation has an incorrect value`); + throw Error("Operation has an incorrect value"); } let _to = to; if (to.startsWith("0x")) { _to = _to.slice(2); } - _to = padWithZeros(_to, 20 * 2); + _to = padWithZeros( + _to, + 20 * 2 + ); - const _value = padWithZeros(BigNumber.from(value).toHexString().slice(2), 32 * 2); + const _value = padWithZeros( + BigNumber.from(value).toHexString(). + slice(2), + 32 * 2 + ); let _data = data; if (data.startsWith("0x")) { _data = _data.slice(2); } if (_data.length % 2 !== 0) { - _data = "0" + _data; + _data = `0${_data}`; } - const _dataLength = padWithZeros((_data.length / 2).toString(16), 32 * 2); + const _dataLength = padWithZeros( + (_data.length / 2).toString(16), + 32 * 2 + ); - return "0x" + [ + return `0x${[ _operation, _to, _value, _dataLength, - _data, - ].join(""); + _data + ].join("")}`; } diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 8feaa0c..f4928b7 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -11,12 +11,12 @@ import {MARIONETTE_ADDRESS} from "./types/marionette"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; export class AutoSubmitter extends Submitter { - async submit(transactions: Transaction[]) { + async submit (transactions: Transaction[]) { let submitter: Submitter; // TODO: remove unknown when move everything to ethers 6 const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; - const owner = await proxyAdmin.owner(); + const owner = await proxyAdmin.owner(); if (await hre.ethers.provider.getCode(owner) === "0x") { console.log("Owner is not a contract"); submitter = new EoaSubmitter(); @@ -28,40 +28,42 @@ export class AutoSubmitter extends Submitter { const imaInstance = await this._getImaInstance(); - const mainnetChainId = this._getMainnetChainId(); - const safeAddress = this._getSafeAddress(); - const schainHash = this._getSchainHash(); + const mainnetChainId = this._getMainnetChainId(); + const safeAddress = this._getSafeAddress(); + const schainHash = this._getSchainHash(); - // TODO: after marionette has multiSend functionality - // query version and properly select a submitter - // based on it - // - // if (await this._versionFunctionExists()) { - // console.log("version() function was found. Use normal Marionette") - // submitter = new SafeImaMarionetteSubmitter( - // safeAddress, - // imaAbi, - // schainHash, - // mainnetChainId - // ) - // } else { - // console.log("No version() function was found. Use legacy Marionette") - // submitter = new SafeImaLegacyMarionetteSubmitter( - // safeAddress, - // imaAbi, - // schainHash, - // mainnetChainId - // ) - // } + /* + * TODO: after marionette has multiSend functionality + * query version and properly select a submitter + * based on it + * + * if (await this._versionFunctionExists()) { + * console.log("version() function was found. Use normal Marionette") + * submitter = new SafeImaMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } else { + * console.log("No version() function was found. Use legacy Marionette") + * submitter = new SafeImaLegacyMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } + */ submitter = new SafeImaLegacyMarionetteSubmitter( safeAddress, imaInstance, schainHash, mainnetChainId - ) + ); } else { - // assuming owner is a Gnosis Safe + // Assuming owner is a Gnosis Safe console.log("Using Gnosis Safe"); submitter = new SafeSubmitter(owner); @@ -70,20 +72,20 @@ export class AutoSubmitter extends Submitter { await submitter.submit(transactions); } - // private + // Private - async _getImaInstance() { + async _getImaInstance () { if (!process.env.IMA) { console.log(chalk.red("Set target IMA alias to IMA environment variable")); process.exit(1); } const network = await skaleContracts.getNetworkByProvider(ethers.provider); - const ima = await network.getProject("ima"); + const ima = await network.getProject("ima"); return await ima.getInstance(process.env.IMA); } - _getSafeAddress() { + _getSafeAddress () { if (!process.env.SAFE_ADDRESS) { console.log(chalk.red("Set Gnosis Safe owner address to SAFE_ADDRESS environment variable")); process.exit(1); @@ -91,22 +93,25 @@ export class AutoSubmitter extends Submitter { return process.env.SAFE_ADDRESS; } - _getSchainHash() { - // query Context to get schain hash + _getSchainHash () { + // Query Context to get schain hash if (!process.env.SCHAIN_HASH) { if (!process.env.SCHAIN_NAME) { console.log(chalk.red("Set schain name to SCHAIN_NAME environment variable")); console.log(chalk.red("or schain hash to SCHAIN_HASH environment variable")); process.exit(1); } else { - return ethers.utils.solidityKeccak256(["string"], [process.env.SCHAIN_NAME]); + return ethers.utils.solidityKeccak256( + ["string"], + [process.env.SCHAIN_NAME] + ); } } else { return process.env.SCHAIN_HASH; } } - _getMainnetChainId() { + _getMainnetChainId () { if (!process.env.MAINNET_CHAIN_ID) { console.log(chalk.red("Set chainId of mainnet to MAINNET_CHAIN_ID environment variable")); console.log(chalk.red("Use 1 for Ethereum mainnet or 5 for Goerli")); @@ -116,40 +121,52 @@ export class AutoSubmitter extends Submitter { } } - async _versionFunctionExists() { + async _versionFunctionExists () { const bytecode = await hre.ethers.provider.getCode(MARIONETTE_ADDRESS); - // If the bytecode doesn't include the function selector version() - // is definitely not present - if (!bytecode.includes(ethers.utils.id("version()").slice(2, 10))) { + /* + * If the bytecode doesn't include the function selector version() + * is definitely not present + */ + if (!bytecode.includes(ethers.utils.id("version()").slice( + 2, + 10 + ))) { return false; } const marionette = new ethers.Contract( MARIONETTE_ADDRESS, - [{ - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }], - hre.ethers.provider); + [ + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + hre.ethers.provider + ); - // If gas estimation doesn't revert then an execution is possible - // given the provided function selector + /* + * If gas estimation doesn't revert then an execution is possible + * given the provided function selector + */ try { await marionette.estimateGas.version(); return true; } catch { - // Otherwise (revert) we assume that there is no entry in the jump table - // meaning that the contract doesn't include version() + /* + * Otherwise (revert) we assume that there is no entry in the jump table + * meaning that the contract doesn't include version() + */ return false; } } diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 5e558c1..7a28ac8 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -3,19 +3,19 @@ import {UnsignedTransaction} from "ethers"; import {Submitter} from "./submitter"; export class EoaSubmitter extends Submitter { - async submit(transactions: UnsignedTransaction[]) { + async submit (transactions: UnsignedTransaction[]) { this._atomicityWarning(); - const [ deployer ] = await ethers.getSigners(); + const [deployer] = await ethers.getSigners(); for (const transaction of transactions) { console.log("Send transaction"); const response = await deployer.sendTransaction({ - to: transaction.to, - value: transaction.value, - data: transaction.data + "to": transaction.to, + "value": transaction.value, + "data": transaction.data }); console.log(`Waiting for a transaction with nonce ${response.nonce}`); await response.wait(); - console.log("The transaction was sent") + console.log("The transaction was sent"); } } } diff --git a/src/submitters/index.ts b/src/submitters/index.ts index a32d8fc..58952e4 100644 --- a/src/submitters/index.ts +++ b/src/submitters/index.ts @@ -3,4 +3,4 @@ export * from "./eoa-submitter"; export * from "./safe-ima-legacy-marionette-submitter"; export * from "./safe-submitter"; export * from "./safe-to-ima-submitter"; -export * from "./submitter"; \ No newline at end of file +export * from "./submitter"; diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 9682960..fd37428 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -37,21 +37,29 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { "type": "function" } ]), - ethers.provider); + ethers.provider + ); - async submit(transactions: UnsignedTransaction[]): Promise { + async submit (transactions: UnsignedTransaction[]): Promise { if (transactions.length > 1) { this._atomicityWarning(); } - const transactionsToMarionette = [] + const transactionsToMarionette = []; for (const transaction of transactions) { transactionsToMarionette.push({ - to: this.marionette.address, + "to": this.marionette.address, // eslint-disable-next-line @typescript-eslint/no-unsafe-call - data: await this.marionette.encodeFunctionCall( - transaction.to ? transaction.to : ethers.constants.AddressZero, - transaction.value ? transaction.value : 0, - transaction.data ? transaction.data : "0x") as BytesLike + "data": await this.marionette.encodeFunctionCall( + transaction.to + ? transaction.to + : ethers.constants.AddressZero, + transaction.value + ? transaction.value + : 0, + transaction.data + ? transaction.data + : "0x" + ) as BytesLike }); } await super.submit(transactionsToMarionette); diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index e403d9e..218404f 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -1,7 +1,7 @@ import {UnsignedTransaction} from "ethers"; import {ethers} from "hardhat"; import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; -import {Marionette, MARIONETTE_ADDRESS} from "./types/marionette"; +import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( @@ -9,56 +9,63 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { new ethers.utils.Interface([ { "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IMarionette.FunctionCall[]", - "name": "functionCalls", - "type": "tuple[]" - } + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMarionette.FunctionCall[]", + "name": "functionCalls", + "type": "tuple[]" + } ], "name": "encodeFunctionCalls", "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } ], "stateMutability": "pure", "type": "function" - } + } ]), - ethers.provider) as Marionette; + ethers.provider + ) as Marionette; - async submit(transactions: UnsignedTransaction[]): Promise { - const functionCalls = [] + async submit (transactions: UnsignedTransaction[]): Promise { + const functionCalls = []; for (const transaction of transactions) { functionCalls.push({ - receiver: transaction.to ? transaction.to : ethers.constants.AddressZero, - value: transaction.value ? transaction.value : 0, - data: (transaction.data ? transaction.data : "0x") + "receiver": transaction.to + ? transaction.to + : ethers.constants.AddressZero, + "value": transaction.value + ? transaction.value + : 0, + "data": transaction.data + ? transaction.data + : "0x" }); } await super.submit([ { - to: this.marionette.address, - data: await this.marionette.encodeFunctionCalls(functionCalls) + "to": this.marionette.address, + "data": await this.marionette.encodeFunctionCalls(functionCalls) } ]); } diff --git a/src/submitters/safe-submitter.ts b/src/submitters/safe-submitter.ts index 2557f93..67f41c3 100644 --- a/src/submitters/safe-submitter.ts +++ b/src/submitters/safe-submitter.ts @@ -5,18 +5,22 @@ import {Submitter} from "./submitter"; export class SafeSubmitter extends Submitter { safeAddress: string; + chainId: number | undefined; - constructor(safeAddress: string, chainId?: number) { + constructor (safeAddress: string, chainId?: number) { super(); this.safeAddress = safeAddress; this.chainId = chainId; } - async submit(transactions: UnsignedTransaction[]): Promise { + async submit (transactions: UnsignedTransaction[]): Promise { if (!this.chainId) { this.chainId = (await ethers.provider.getNetwork()).chainId; } - await createMultiSendTransaction(this.safeAddress, transactions); + await createMultiSendTransaction( + this.safeAddress, + transactions + ); } } diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index db939b9..36de05a 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -4,32 +4,40 @@ import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; export class SafeToImaSubmitter extends SafeSubmitter { imaInstance: Instance; + targetSchainHash: BytesLike; + private _messageProxyForMainnet: Contract | undefined; - constructor(safeAddress: string, imaInstance: Instance, targetSchainHash: BytesLike, chainId?: number) { - super(safeAddress, chainId); + constructor (safeAddress: string, imaInstance: Instance, targetSchainHash: BytesLike, chainId?: number) { + super( + safeAddress, + chainId + ); this.imaInstance = imaInstance; this.targetSchainHash = targetSchainHash; } - async submit(transactions: UnsignedTransaction[]): Promise { + async submit (transactions: UnsignedTransaction[]): Promise { if (transactions.length > 1) { this._atomicityWarning(); } const messageProxyForMainnet = await this._getMessageProxyForMainnet(); - const transactionsToIma = transactions.map((transaction) => { - return { - to: messageProxyForMainnet.address, - data: messageProxyForMainnet.interface.encodeFunctionData( - "postOutgoingMessage", - [this.targetSchainHash, transaction.to, transaction.data]) - } - }); + const transactionsToIma = transactions.map((transaction) => ({ + "to": messageProxyForMainnet.address, + "data": messageProxyForMainnet.interface.encodeFunctionData( + "postOutgoingMessage", + [ + this.targetSchainHash, + transaction.to, + transaction.data + ] + ) + })); await super.submit(transactionsToIma); } - private async _getMessageProxyForMainnet() { + private async _getMessageProxyForMainnet () { if (this._messageProxyForMainnet === undefined) { this._messageProxyForMainnet = await this.imaInstance.getContract("MessageProxyForMainnet"); } diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index 727c91a..f313350 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -4,10 +4,10 @@ import chalk from "chalk"; export abstract class Submitter { abstract submit(transactions: UnsignedTransaction[]): Promise; - // private + // Private - _atomicityWarning() { - if(!process.env.ALLOW_NOT_ATOMIC_UPGRADE) { + _atomicityWarning () { + if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) { console.log(chalk.red("The upgrade will consist of multiple transactions and will not be atomic")); console.log(chalk.red("If not atomic upgrade is OK set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); process.exit(1); diff --git a/src/submitters/types/marionette.ts b/src/submitters/types/marionette.ts index d9c2fc3..f8429a0 100644 --- a/src/submitters/types/marionette.ts +++ b/src/submitters/types/marionette.ts @@ -1,5 +1,5 @@ import {BigNumberish, BytesLike} from "ethers"; -import {ethers as RawEthers} from "ethers" +import {ethers as RawEthers} from "ethers"; export const MARIONETTE_ADDRESS = "0xD2c0DeFACe000000000000000000000000000000"; diff --git a/src/upgrader.ts b/src/upgrader.ts index b40c541..c438f8b 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -16,20 +16,27 @@ import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; export abstract class Upgrader { instance: Instance; + targetVersion: string; + contractNamesToUpgrade: string[]; + projectName: string; + transactions: UnsignedTransaction[]; + submitter: Submitter; - constructor(projectName: string, - targetVersion: string, - instance: Instance, - contractNamesToUpgrade: string[], - submitter: Submitter = new AutoSubmitter()) { + constructor ( + projectName: string, + targetVersion: string, + instance: Instance, + contractNamesToUpgrade: string[], + submitter: Submitter = new AutoSubmitter() + ) { this.targetVersion = targetVersion; - if (!targetVersion.includes('-')) { - this.targetVersion = targetVersion + '-stable.0'; + if (!targetVersion.includes("-")) { + this.targetVersion = `${targetVersion}-stable.0`; } this.instance = instance; this.contractNamesToUpgrade = contractNamesToUpgrade; @@ -38,26 +45,28 @@ export abstract class Upgrader { this.submitter = submitter; } - // abstract + // Abstract abstract getDeployedVersion: () => Promise + abstract setVersion: (newVersion: string) => Promise - // protected + // Protected + + deployNewContracts = () => Promise.resolve(); - deployNewContracts = () => { return Promise.resolve() }; - initialize = () => { return Promise.resolve() }; + initialize = () => Promise.resolve(); - // public + // Public - async upgrade() { + async upgrade () { const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; let deployedVersion = await this.getDeployedVersion(); const version = await getVersion(); if (deployedVersion) { - if (!deployedVersion.includes('-')) { - deployedVersion = deployedVersion + '-stable.0'; + if (!deployedVersion.includes("-")) { + deployedVersion += "-stable.0"; } if (deployedVersion !== this.targetVersion) { console.log(chalk.red(`This script can't upgrade version ${deployedVersion} to ${version}`)); @@ -76,25 +85,27 @@ export abstract class Upgrader { for (const contract of this.contractNamesToUpgrade) { const contractFactory = await this._getContractFactoryAndUpdateManifest(contract); - const proxyAddress = (await this.instance.getContract(contract)).address; + const proxyAddress = (await this.instance.getContract(contract)).address; console.log(`Prepare upgrade of ${contract}`); const - currentImplementationAddress = await getImplementationAddress(network.provider, proxyAddress); - const newImplementationAddress = await upgrades.prepareUpgrade( - proxyAddress, - contractFactory, - { - unsafeAllowLinkedLibraries: true, - unsafeAllowRenames: true - } - ) as string; - if (newImplementationAddress !== currentImplementationAddress) - { + currentImplementationAddress = await getImplementationAddress( + network.provider, + proxyAddress + ); + const newImplementationAddress = await upgrades.prepareUpgrade( + proxyAddress, + contractFactory, + { + "unsafeAllowLinkedLibraries": true, + "unsafeAllowRenames": true + } + ) as string; + if (newImplementationAddress !== currentImplementationAddress) { contractsToUpgrade.push({ proxyAddress, - implementationAddress: newImplementationAddress, - name: contract + "implementationAddress": newImplementationAddress, + "name": contract }); } else { console.log(chalk.gray(`Contract ${contract} is up to date`)); @@ -105,17 +116,30 @@ export abstract class Upgrader { for (const contract of contractsToUpgrade) { console.log(chalk.yellowBright(`Prepare transaction to upgrade ${contract.name} at ${contract.proxyAddress} to ${contract.implementationAddress}`)); this.transactions.push({ - to: proxyAdmin.address, - data: proxyAdmin.interface.encodeFunctionData("upgrade", [contract.proxyAddress, contract.implementationAddress]) + "to": proxyAdmin.address, + "data": proxyAdmin.interface.encodeFunctionData( + "upgrade", + [ + contract.proxyAddress, + contract.implementationAddress + ] + ) }); } await this.initialize(); - // write version + // Write version await this.setVersion(version); - await fs.writeFile(`data/transactions-${version}-${network.name}.json`, JSON.stringify(this.transactions, null, 4)); + await fs.writeFile( + `data/transactions-${version}-${network.name}.json`, + JSON.stringify( + this.transactions, + null, + 4 + ) + ); await this.submitter.submit(this.transactions); @@ -124,27 +148,38 @@ export abstract class Upgrader { } else { console.log("Start verification"); for (const contract of contractsToUpgrade) { - await verify(contract.name, contract.implementationAddress, []); + await verify( + contract.name, + contract.implementationAddress, + [] + ); } } console.log("Done"); } - // private + // Private - async _getContractFactoryAndUpdateManifest(contract: string) { + async _getContractFactoryAndUpdateManifest (contract: string) { const {linkReferences} = await artifacts.readArtifact(contract); - const manifest = JSON.parse(await fs.readFile(await getManifestFile(), "utf-8")) as SkaleManifestData; + const manifest = JSON.parse(await fs.readFile( + await getManifestFile(), + "utf-8" + )) as SkaleManifestData; - if (!Object.keys(linkReferences).length) + if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); + } const librariesToUpgrade = []; - const oldLibraries: {[k: string]: string} = {}; + const oldLibraries: {[k: string]: string} = {}; if (manifest.libraries === undefined) { - Object.assign(manifest, {libraries: {}}); + Object.assign( + manifest, + {"libraries": {}} + ); } for (const key of Object.keys(linkReferences)) { const libraryName = Object.keys(linkReferences[key])[0]; @@ -161,12 +196,29 @@ export abstract class Upgrader { } } const libraries = await deployLibraries(librariesToUpgrade); - for (const [libraryName, libraryAddress] of libraries.entries()) { + for (const [ + libraryName, + libraryAddress + ] of libraries.entries()) { const {bytecode} = await artifacts.readArtifact(libraryName); - manifest.libraries[libraryName] = {"address": libraryAddress, "bytecodeHash": hashBytecode(bytecode)}; + manifest.libraries[libraryName] = {"address": libraryAddress, + "bytecodeHash": hashBytecode(bytecode)}; } - Object.assign(libraries, oldLibraries); - await fs.writeFile(await getManifestFile(), JSON.stringify(manifest, null, 4)); - return await getLinkedContractFactory(contract, libraries); + Object.assign( + libraries, + oldLibraries + ); + await fs.writeFile( + await getManifestFile(), + JSON.stringify( + manifest, + null, + 4 + ) + ); + return await getLinkedContractFactory( + contract, + libraries + ); } } diff --git a/src/verification.ts b/src/verification.ts index c6a295f..9685b57 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -1,17 +1,20 @@ -import {ethers, run, network} from "hardhat"; +import {ethers, network, run} from "hardhat"; import {builtinChains} from "@nomicfoundation/hardhat-verify/internal/chain-config"; import chalk from "chalk"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; -export async function verify(contractName: string, contractAddress: string, constructorArguments: object) { - const chainId = (await ethers.provider.getNetwork()).chainId; - if (builtinChains.find(chain => chain.chainId === chainId) !== undefined) { - for (let retry = 0; retry <= 5; ++retry) { +export async function verify (contractName: string, contractAddress: string, constructorArguments: object) { + const {chainId} = await ethers.provider.getNetwork(); + if (builtinChains.find((chain) => chain.chainId === chainId) !== undefined) { + for (let retry = 0; retry <= 5; retry += 1) { try { - await run("verify:verify", { - address: contractAddress, - constructorArguments - }); + await run( + "verify:verify", + { + "address": contractAddress, + constructorArguments + } + ); break; } catch (e) { if (e instanceof Error) { @@ -22,13 +25,23 @@ export async function verify(contractName: string, contractAddress: string, cons console.log(chalk.red(`Contract ${contractName} was not verified on etherscan`)); console.log(e.toString()); } else { - console.log("Unknown exception type:", e) + console.log( + "Unknown exception type:", + e + ); } } } } } -export async function verifyProxy(contractName: string, proxyAddress: string, constructorArguments: object) { - await verify(contractName, await getImplementationAddress(network.provider, proxyAddress), constructorArguments); +export async function verifyProxy (contractName: string, proxyAddress: string, constructorArguments: object) { + await verify( + contractName, + await getImplementationAddress( + network.provider, + proxyAddress + ), + constructorArguments + ); } diff --git a/src/version.ts b/src/version.ts index 4fa857d..f79148d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,5 +1,5 @@ import {exec as asyncExec} from "child_process"; -import {promises as fs, existsSync} from "fs"; +import {existsSync, promises as fs} from "fs"; import util from "util"; @@ -7,19 +7,21 @@ const exec = util.promisify(asyncExec); class VersionNotFound extends Error {} -async function getVersionFilename(folder?: string) { +async function getVersionFilename (folder?: string) { if (folder === undefined) { - return getVersionFilename( - (await exec("git rev-parse --show-toplevel")).stdout.trim() - ); + return getVersionFilename((await exec("git rev-parse --show-toplevel")).stdout.trim()); } - const VERSION_FILENAME = 'VERSION'; + const VERSION_FILENAME = "VERSION"; const path = `${folder}/${VERSION_FILENAME}`; if (existsSync(path)) { return path; } - for (const entry of await fs.readdir(folder, {withFileTypes: true, recursive: true})) { - if (entry.isFile() && entry.name === VERSION_FILENAME ) { + for (const entry of await fs.readdir( + folder, + {"withFileTypes": true, + "recursive": true} + )) { + if (entry.isFile() && entry.name === VERSION_FILENAME) { return `${entry.path}/${entry.name}`; } } @@ -34,6 +36,9 @@ export const getVersion = async () => { const tag = (await exec("git describe --tags")).stdout.trim(); return tag; } catch { - return (await fs.readFile(await getVersionFilename(), "utf-8")).trim(); + return (await fs.readFile( + await getVersionFilename(), + "utf-8" + )).trim(); } }; From f145eabb756e3153a3a5c76b93ac8d27d940306c Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 18:30:59 +0300 Subject: [PATCH 03/44] Use this in class methods --- .eslintrc.cjs | 1 - src/submitters/auto-submitter.ts | 25 ++++++++++--------- src/submitters/eoa-submitter.ts | 6 +++-- .../safe-ima-legacy-marionette-submitter.ts | 2 +- src/submitters/safe-to-ima-submitter.ts | 2 +- src/submitters/submitter.ts | 4 +-- src/upgrader.ts | 18 +++++++------ 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index bdcdef8..14e2d39 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "class-methods-use-this": "warn", "consistent-return": "warn", "eqeqeq": "warn", "func-style": "warn", diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index f4928b7..2ee99b9 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -11,11 +11,13 @@ import {MARIONETTE_ADDRESS} from "./types/marionette"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; export class AutoSubmitter extends Submitter { + name = "Auto Submitter"; + async submit (transactions: Transaction[]) { + console.log(`Submit via ${this.name}`); let submitter: Submitter; // TODO: remove unknown when move everything to ethers 6 - const - proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; + const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; const owner = await proxyAdmin.owner(); if (await hre.ethers.provider.getCode(owner) === "0x") { console.log("Owner is not a contract"); @@ -26,11 +28,10 @@ export class AutoSubmitter extends Submitter { if (ethers.utils.getAddress(owner) == ethers.utils.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); - const - imaInstance = await this._getImaInstance(); - const mainnetChainId = this._getMainnetChainId(); - const safeAddress = this._getSafeAddress(); - const schainHash = this._getSchainHash(); + const imaInstance = await AutoSubmitter._getImaInstance(); + const mainnetChainId = AutoSubmitter._getMainnetChainId(); + const safeAddress = AutoSubmitter._getSafeAddress(); + const schainHash = AutoSubmitter._getSchainHash(); /* * TODO: after marionette has multiSend functionality @@ -74,7 +75,7 @@ export class AutoSubmitter extends Submitter { // Private - async _getImaInstance () { + private static async _getImaInstance () { if (!process.env.IMA) { console.log(chalk.red("Set target IMA alias to IMA environment variable")); process.exit(1); @@ -85,7 +86,7 @@ export class AutoSubmitter extends Submitter { return await ima.getInstance(process.env.IMA); } - _getSafeAddress () { + private static _getSafeAddress () { if (!process.env.SAFE_ADDRESS) { console.log(chalk.red("Set Gnosis Safe owner address to SAFE_ADDRESS environment variable")); process.exit(1); @@ -93,7 +94,7 @@ export class AutoSubmitter extends Submitter { return process.env.SAFE_ADDRESS; } - _getSchainHash () { + private static _getSchainHash () { // Query Context to get schain hash if (!process.env.SCHAIN_HASH) { if (!process.env.SCHAIN_NAME) { @@ -111,7 +112,7 @@ export class AutoSubmitter extends Submitter { } } - _getMainnetChainId () { + private static _getMainnetChainId () { if (!process.env.MAINNET_CHAIN_ID) { console.log(chalk.red("Set chainId of mainnet to MAINNET_CHAIN_ID environment variable")); console.log(chalk.red("Use 1 for Ethereum mainnet or 5 for Goerli")); @@ -121,7 +122,7 @@ export class AutoSubmitter extends Submitter { } } - async _versionFunctionExists () { + private static async _versionFunctionExists () { const bytecode = await hre.ethers.provider.getCode(MARIONETTE_ADDRESS); /* diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 7a28ac8..5276eb6 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -3,11 +3,13 @@ import {UnsignedTransaction} from "ethers"; import {Submitter} from "./submitter"; export class EoaSubmitter extends Submitter { + name = "EOA Submitter"; + async submit (transactions: UnsignedTransaction[]) { - this._atomicityWarning(); + EoaSubmitter._atomicityWarning(); const [deployer] = await ethers.getSigners(); for (const transaction of transactions) { - console.log("Send transaction"); + console.log(`Send transaction via ${this.name}`); const response = await deployer.sendTransaction({ "to": transaction.to, "value": transaction.value, diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index fd37428..6aaf5e4 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -42,7 +42,7 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { async submit (transactions: UnsignedTransaction[]): Promise { if (transactions.length > 1) { - this._atomicityWarning(); + SafeImaLegacyMarionetteSubmitter._atomicityWarning(); } const transactionsToMarionette = []; for (const transaction of transactions) { diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 36de05a..fd6f503 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -20,7 +20,7 @@ export class SafeToImaSubmitter extends SafeSubmitter { async submit (transactions: UnsignedTransaction[]): Promise { if (transactions.length > 1) { - this._atomicityWarning(); + SafeToImaSubmitter._atomicityWarning(); } const messageProxyForMainnet = await this._getMessageProxyForMainnet(); const transactionsToIma = transactions.map((transaction) => ({ diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index f313350..816e76f 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -4,9 +4,9 @@ import chalk from "chalk"; export abstract class Submitter { abstract submit(transactions: UnsignedTransaction[]): Promise; - // Private + // Protected - _atomicityWarning () { + protected static _atomicityWarning () { if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) { console.log(chalk.red("The upgrade will consist of multiple transactions and will not be atomic")); console.log(chalk.red("If not atomic upgrade is OK set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); diff --git a/src/upgrader.ts b/src/upgrader.ts index c438f8b..9aaede9 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -53,9 +53,9 @@ export abstract class Upgrader { // Protected - deployNewContracts = () => Promise.resolve(); + deployNewContracts?: () => Promise; - initialize = () => Promise.resolve(); + initialize?: () => Promise; // Public @@ -77,14 +77,16 @@ export abstract class Upgrader { } console.log(`Will mark updated version as ${version}`); - // Deploy new contracts - await this.deployNewContracts(); + if (this.deployNewContracts !== undefined) { + // Deploy new contracts + await this.deployNewContracts(); + } // Deploy new implementations const contractsToUpgrade: {proxyAddress: string, implementationAddress: string, name: string}[] = []; for (const contract of this.contractNamesToUpgrade) { const - contractFactory = await this._getContractFactoryAndUpdateManifest(contract); + contractFactory = await Upgrader._getContractFactoryAndUpdateManifest(contract); const proxyAddress = (await this.instance.getContract(contract)).address; console.log(`Prepare upgrade of ${contract}`); @@ -127,7 +129,9 @@ export abstract class Upgrader { }); } - await this.initialize(); + if (this.initialize !== undefined) { + await this.initialize(); + } // Write version await this.setVersion(version); @@ -161,7 +165,7 @@ export abstract class Upgrader { // Private - async _getContractFactoryAndUpdateManifest (contract: string) { + private static async _getContractFactoryAndUpdateManifest (contract: string) { const {linkReferences} = await artifacts.readArtifact(contract); const manifest = JSON.parse(await fs.readFile( await getManifestFile(), From 4f18e9ab9ce49e7a7427caf369ad96998514d021 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 18:35:59 +0300 Subject: [PATCH 04/44] Use return consistently --- .eslintrc.cjs | 1 - src/submitters/auto-submitter.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 14e2d39..b569345 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "consistent-return": "warn", "eqeqeq": "warn", "func-style": "warn", "id-length": "warn", diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 2ee99b9..6cbe1a2 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -100,7 +100,7 @@ export class AutoSubmitter extends Submitter { if (!process.env.SCHAIN_NAME) { console.log(chalk.red("Set schain name to SCHAIN_NAME environment variable")); console.log(chalk.red("or schain hash to SCHAIN_HASH environment variable")); - process.exit(1); + throw Error("Schain is not set"); } else { return ethers.utils.solidityKeccak256( ["string"], @@ -116,7 +116,7 @@ export class AutoSubmitter extends Submitter { if (!process.env.MAINNET_CHAIN_ID) { console.log(chalk.red("Set chainId of mainnet to MAINNET_CHAIN_ID environment variable")); console.log(chalk.red("Use 1 for Ethereum mainnet or 5 for Goerli")); - process.exit(1); + throw Error("Mainnet chainId is not set"); } else { return Number.parseInt(process.env.MAINNET_CHAIN_ID); } From e01af2d532c2fd919d918053f8c8b69e933654b7 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 18:40:13 +0300 Subject: [PATCH 05/44] Use triple = --- .eslintrc.cjs | 1 - src/submitters/auto-submitter.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index b569345..056b910 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "eqeqeq": "warn", "func-style": "warn", "id-length": "warn", "init-declarations": "warn", diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 6cbe1a2..9a86569 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -25,7 +25,7 @@ export class AutoSubmitter extends Submitter { } else { console.log("Owner is a contract"); - if (ethers.utils.getAddress(owner) == ethers.utils.getAddress(MARIONETTE_ADDRESS)) { + if (ethers.utils.getAddress(owner) === ethers.utils.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); const imaInstance = await AutoSubmitter._getImaInstance(); From ed9477e7ba9d1803175194a240d395911f7e848e Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:02:07 +0300 Subject: [PATCH 06/44] Use function expressions --- .eslintrc.cjs | 1 - src/abi.ts | 4 ++-- src/deploy.ts | 24 +++++++++++------------- src/gnosis-safe.ts | 24 ++++++++++++------------ src/multiSend.ts | 8 +++----- src/verification.ts | 8 ++++---- src/version.ts | 10 ++++++---- 7 files changed, 38 insertions(+), 41 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 056b910..0cc44e9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "func-style": "warn", "id-length": "warn", "init-declarations": "warn", "line-comment-position": "warn", diff --git a/src/abi.ts b/src/abi.ts index af56d5d..335f114 100644 --- a/src/abi.ts +++ b/src/abi.ts @@ -1,6 +1,6 @@ import {Interface} from "ethers/lib/utils"; -export function getAbi (contractInterface: Interface) { +export const getAbi = (contractInterface: Interface) => { const abi = JSON.parse(contractInterface.format("json") as string) as []; abi.forEach((obj: {type: string}) => { @@ -19,4 +19,4 @@ export function getAbi (contractInterface: Interface) { }); return abi; -} +}; diff --git a/src/deploy.ts b/src/deploy.ts index 002ff27..355848a 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -4,15 +4,15 @@ import {promises as fs} from "fs"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {Artifact} from "hardhat/types"; -async function _deployLibrary (libraryName: string) { +const _deployLibrary = async (libraryName: string) => { const Library = await ethers.getContractFactory(libraryName); const library = await Library.deploy(); await library.deployed(); return library.address; -} +}; -export async function deployLibraries (libraryNames: string[]) { +export const deployLibraries = async (libraryNames: string[]) => { const libraries = new Map(); for (const libraryName of libraryNames) { libraries.set( @@ -21,9 +21,9 @@ export async function deployLibraries (libraryNames: string[]) { ); } return libraries; -} +}; -function _linkBytecode (artifact: Artifact, libraries: Map) { +const _linkBytecode = (artifact: Artifact, libraries: Map) => { let {bytecode} = artifact; for (const [, fileReferences] of Object.entries(artifact.linkReferences)) { for (const [ @@ -46,9 +46,9 @@ function _linkBytecode (artifact: Artifact, libraries: Map) { } } return bytecode; -} +}; -export async function getLinkedContractFactory (contractName: string, libraries: Map) { +export const getLinkedContractFactory = async (contractName: string, libraries: Map) => { const cArtifact = await artifacts.readArtifact(contractName); const linkedBytecode = _linkBytecode( @@ -60,13 +60,11 @@ export async function getLinkedContractFactory (contractName: string, libraries: linkedBytecode ); return ContractFactory; -} +}; -export async function getManifestFile (): Promise { - return (await Manifest.forNetwork(ethers.provider)).file; -} +export const getManifestFile = async (): Promise => (await Manifest.forNetwork(ethers.provider)).file; -export async function getContractFactory (contract: string) { +export const getContractFactory = async (contract: string) => { const {linkReferences} = await artifacts.readArtifact(contract); if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); @@ -121,4 +119,4 @@ export async function getContractFactory (contract: string) { contract, libraries ); -} +}; diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 1363bce..ce383b2 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -24,7 +24,7 @@ const URLS = { // Public functions -export async function createMultiSendTransaction (safeAddress: string, transactions: UnsignedTransaction[]) { +export const createMultiSendTransaction = async (safeAddress: string, transactions: UnsignedTransaction[]) => { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ @@ -73,11 +73,11 @@ export async function createMultiSendTransaction (safeAddress: string, transacti safeAddress, safeTransaction ); -} +}; // Private functions -async function estimateSafeTransaction (safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) { +const estimateSafeTransaction = async (safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) => { console.log("Estimate gas"); const safeService = await getSafeService(); for (const transaction of safeTransactionData as MetaTransactionData[]) { @@ -96,9 +96,9 @@ async function estimateSafeTransaction (safeAddress: string, safeTransactionData )}`)); } console.log(chalk.green("Send transaction to gnosis safe")); -} +}; -async function proposeTransaction (safeAddress: string, safeTransaction: SafeTransaction) { +const proposeTransaction = async (safeAddress: string, safeTransaction: SafeTransaction) => { const [safeOwner] = await ethers.getSigners(); const ethAdapter = await getEthAdapter(); @@ -114,9 +114,9 @@ async function proposeTransaction (safeAddress: string, safeTransaction: SafeTra "senderAddress": safeOwner.address, "senderSignature": senderSignature.data }); -} +}; -async function getEthAdapter (): Promise { +const getEthAdapter = async (): Promise => { const [safeOwner] = await ethers.getSigners(); const ethAdapter = new EthersAdapter({ @@ -124,9 +124,9 @@ async function getEthAdapter (): Promise { "signerOrProvider": safeOwner }); return ethAdapter; -} +}; -async function getSafeService () { +const getSafeService = async () => { const {chainId} = await ethers.provider.getNetwork(); const ethAdapter: EthersAdapter = await getEthAdapter(); @@ -135,11 +135,11 @@ async function getSafeService () { ethAdapter }); return safeService; -} +}; -function getSafeTransactionUrl (chainId: number) { +const getSafeTransactionUrl = (chainId: number) => { if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { return URLS.safe_transaction[chainId as keyof typeof URLS.safe_transaction]; } throw Error(`Can't get safe-transaction url at network with chainId = ${chainId}`); -} +}; diff --git a/src/multiSend.ts b/src/multiSend.ts index aa04415..185cdb2 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,10 +1,8 @@ import {BigNumber} from "ethers"; -function padWithZeros (value: string, targetLength: number) { - return ("0".repeat(targetLength) + value).slice(-targetLength); -} +const padWithZeros = (value: string, targetLength: number) => ("0".repeat(targetLength) + value).slice(-targetLength); -export function encodeTransaction (operation: 0 | 1, to: string, value: BigNumber | number, data: string) { +export const encodeTransaction = (operation: 0 | 1, to: string, value: BigNumber | number, data: string) => { // / operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte), // / to as a address (=> 20 bytes), // / value as a uint256 (=> 32 bytes), @@ -55,4 +53,4 @@ export function encodeTransaction (operation: 0 | 1, to: string, value: BigNumbe _dataLength, _data ].join("")}`; -} +}; diff --git a/src/verification.ts b/src/verification.ts index 9685b57..a589248 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -3,7 +3,7 @@ import {builtinChains} from "@nomicfoundation/hardhat-verify/internal/chain-conf import chalk from "chalk"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; -export async function verify (contractName: string, contractAddress: string, constructorArguments: object) { +export const verify = async (contractName: string, contractAddress: string, constructorArguments: object) => { const {chainId} = await ethers.provider.getNetwork(); if (builtinChains.find((chain) => chain.chainId === chainId) !== undefined) { for (let retry = 0; retry <= 5; retry += 1) { @@ -33,9 +33,9 @@ export async function verify (contractName: string, contractAddress: string, con } } } -} +}; -export async function verifyProxy (contractName: string, proxyAddress: string, constructorArguments: object) { +export const verifyProxy = async (contractName: string, proxyAddress: string, constructorArguments: object) => { await verify( contractName, await getImplementationAddress( @@ -44,4 +44,4 @@ export async function verifyProxy (contractName: string, proxyAddress: string, c ), constructorArguments ); -} +}; diff --git a/src/version.ts b/src/version.ts index f79148d..a182828 100644 --- a/src/version.ts +++ b/src/version.ts @@ -7,7 +7,7 @@ const exec = util.promisify(asyncExec); class VersionNotFound extends Error {} -async function getVersionFilename (folder?: string) { +const getVersionFilename = async (folder?: string): Promise => { if (folder === undefined) { return getVersionFilename((await exec("git rev-parse --show-toplevel")).stdout.trim()); } @@ -18,15 +18,17 @@ async function getVersionFilename (folder?: string) { } for (const entry of await fs.readdir( folder, - {"withFileTypes": true, - "recursive": true} + { + "withFileTypes": true, + "recursive": true + } )) { if (entry.isFile() && entry.name === VERSION_FILENAME) { return `${entry.path}/${entry.name}`; } } throw new VersionNotFound("Can't find version file"); -} +}; export const getVersion = async () => { if (process.env.VERSION) { From 8a0dea250b1749122d40e7dd9e6785c6b8b2bd5c Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:03:50 +0300 Subject: [PATCH 07/44] Use long identifiers --- .eslintrc.cjs | 1 - src/verification.ts | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0cc44e9..99f98ef 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "id-length": "warn", "init-declarations": "warn", "line-comment-position": "warn", "lines-around-comment": "warn", diff --git a/src/verification.ts b/src/verification.ts index a589248..d5de72f 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -16,18 +16,18 @@ export const verify = async (contractName: string, contractAddress: string, cons } ); break; - } catch (e) { - if (e instanceof Error) { - if (e.toString().includes("Contract source code already verified")) { + } catch (error) { + if (error instanceof Error) { + if (error.toString().includes("Contract source code already verified")) { console.log(chalk.grey(`${contractName} is already verified`)); return; } console.log(chalk.red(`Contract ${contractName} was not verified on etherscan`)); - console.log(e.toString()); + console.log(error.toString()); } else { console.log( "Unknown exception type:", - e + error ); } } From b57fb4de2e9b0390f22e11691068eb7dff1c50fb Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:27:03 +0300 Subject: [PATCH 08/44] Init on declarations --- .eslintrc.cjs | 1 - src/deploy.ts | 44 +++++++------ src/multiSend.ts | 2 +- src/submitters/auto-submitter.ts | 104 ++++++++++++++++--------------- src/types/SkaleManifestData.ts | 2 +- src/upgrader.ts | 8 +-- 6 files changed, 78 insertions(+), 83 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 99f98ef..f26c4a7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "init-declarations": "warn", "line-comment-position": "warn", "lines-around-comment": "warn", "max-depth": "warn", diff --git a/src/deploy.ts b/src/deploy.ts index 355848a..4774dad 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -76,8 +76,7 @@ export const getContractFactory = async (contract: string) => { libraryNames.push(libraryName); } - const - libraries = await deployLibraries(libraryNames); + const libraries = await deployLibraries(libraryNames); const libraryArtifacts: { [key: string]: unknown } = {}; for (const [ libraryName, @@ -89,32 +88,31 @@ export const getContractFactory = async (contract: string) => { "bytecodeHash": hashBytecode(bytecode) }; } - let manifest; - try { - manifest = JSON.parse(await fs.readFile( - await getManifestFile(), - "utf-8" - )) as SkaleManifestData; + + const manifest = JSON.parse(await fs.readFile( + await getManifestFile(), + "utf-8" + )) as SkaleManifestData; + if (manifest.libraries === undefined) { + Object.assign( + manifest, + {"libraries": libraryArtifacts} + ); + } else { Object.assign( libraryArtifacts, manifest.libraries ); - } finally { - if (manifest !== undefined) { - Object.assign( - manifest, - {"libraries": libraryArtifacts} - ); - } - await fs.writeFile( - await getManifestFile(), - JSON.stringify( - manifest, - null, - 4 - ) - ); } + await fs.writeFile( + await getManifestFile(), + JSON.stringify( + manifest, + null, + 4 + ) + ); + return await getLinkedContractFactory( contract, libraries diff --git a/src/multiSend.ts b/src/multiSend.ts index 185cdb2..4de953d 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -9,7 +9,7 @@ export const encodeTransaction = (operation: 0 | 1, to: string, value: BigNumber // / data length as a uint256 (=> 32 bytes), // / data as bytes. - let _operation; + let _operation = ""; if (operation === 0) { _operation = "00"; } else if (operation === 1) { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 9a86569..38b004a 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -15,65 +15,67 @@ export class AutoSubmitter extends Submitter { async submit (transactions: Transaction[]) { console.log(`Submit via ${this.name}`); - let submitter: Submitter; + const submitter = await AutoSubmitter.getSubmitter(); + await submitter.submit(transactions); + } + + // Private + + private static async getSubmitter () { // TODO: remove unknown when move everything to ethers 6 const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; const owner = await proxyAdmin.owner(); if (await hre.ethers.provider.getCode(owner) === "0x") { console.log("Owner is not a contract"); - submitter = new EoaSubmitter(); - } else { - console.log("Owner is a contract"); - - if (ethers.utils.getAddress(owner) === ethers.utils.getAddress(MARIONETTE_ADDRESS)) { - console.log("Marionette owner is detected"); - - const imaInstance = await AutoSubmitter._getImaInstance(); - const mainnetChainId = AutoSubmitter._getMainnetChainId(); - const safeAddress = AutoSubmitter._getSafeAddress(); - const schainHash = AutoSubmitter._getSchainHash(); - - /* - * TODO: after marionette has multiSend functionality - * query version and properly select a submitter - * based on it - * - * if (await this._versionFunctionExists()) { - * console.log("version() function was found. Use normal Marionette") - * submitter = new SafeImaMarionetteSubmitter( - * safeAddress, - * imaAbi, - * schainHash, - * mainnetChainId - * ) - * } else { - * console.log("No version() function was found. Use legacy Marionette") - * submitter = new SafeImaLegacyMarionetteSubmitter( - * safeAddress, - * imaAbi, - * schainHash, - * mainnetChainId - * ) - * } - */ - - submitter = new SafeImaLegacyMarionetteSubmitter( - safeAddress, - imaInstance, - schainHash, - mainnetChainId - ); - } else { - // Assuming owner is a Gnosis Safe - console.log("Using Gnosis Safe"); + return new EoaSubmitter(); + } - submitter = new SafeSubmitter(owner); - } + console.log("Owner is a contract"); + if (ethers.utils.getAddress(owner) === ethers.utils.getAddress(MARIONETTE_ADDRESS)) { + console.log("Marionette owner is detected"); + + const imaInstance = await AutoSubmitter._getImaInstance(); + const mainnetChainId = AutoSubmitter._getMainnetChainId(); + const safeAddress = AutoSubmitter._getSafeAddress(); + const schainHash = AutoSubmitter._getSchainHash(); + + /* + * TODO: after marionette has multiSend functionality + * query version and properly select a submitter + * based on it + * + * if (await this._versionFunctionExists()) { + * console.log("version() function was found. Use normal Marionette") + * submitter = new SafeImaMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } else { + * console.log("No version() function was found. Use legacy Marionette") + * submitter = new SafeImaLegacyMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } + */ + + return new SafeImaLegacyMarionetteSubmitter( + safeAddress, + imaInstance, + schainHash, + mainnetChainId + ); } - await submitter.submit(transactions); - } - // Private + // Assuming owner is a Gnosis Safe + console.log("Using Gnosis Safe"); + + return new SafeSubmitter(owner); + } private static async _getImaInstance () { if (!process.env.IMA) { diff --git a/src/types/SkaleManifestData.ts b/src/types/SkaleManifestData.ts index caabeff..1fb82ed 100644 --- a/src/types/SkaleManifestData.ts +++ b/src/types/SkaleManifestData.ts @@ -1,7 +1,7 @@ import {ManifestData} from "@openzeppelin/upgrades-core"; export interface SkaleManifestData extends ManifestData { - libraries: { + libraries?: { [libraryName: string]: { address: string bytecodeHash: string diff --git a/src/upgrader.ts b/src/upgrader.ts index 9aaede9..368d15c 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -176,14 +176,10 @@ export abstract class Upgrader { return await ethers.getContractFactory(contract); } - const - librariesToUpgrade = []; + const librariesToUpgrade = []; const oldLibraries: {[k: string]: string} = {}; if (manifest.libraries === undefined) { - Object.assign( - manifest, - {"libraries": {}} - ); + manifest.libraries = {}; } for (const key of Object.keys(linkReferences)) { const libraryName = Object.keys(linkReferences[key])[0]; From 0500b8a8ce92b79b73fe308b7abcc57cce8975f3 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:30:48 +0300 Subject: [PATCH 09/44] Change comment line position --- .eslintrc.cjs | 1 - src/gnosis-safe.ts | 28 +++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f26c4a7..730490a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,7 +23,6 @@ module.exports = { "never" ], - "line-comment-position": "warn", "lines-around-comment": "warn", "max-depth": "warn", "max-len": "warn", diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index ce383b2..c1534b2 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -49,15 +49,25 @@ export const createMultiSendTransaction = async (safeAddress: string, transactio nonce ); - const - options = { - "safeTxGas": "0", // Max gas to use in the transaction - "baseGas": "0", // Gas costs not related to the transaction execution (signature check, refund payment...) - "gasPrice": "0", // Gas price used for the refund calculation - "gasToken": ethers.constants.AddressZero, // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether - "refundReceiver": ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) - nonce // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce - }; + const options = { + // Max gas to use in the transaction + "safeTxGas": "0", + + // Gas costs not related to the transaction execution (signature check, refund payment...) + "baseGas": "0", + + // Gas price used for the refund calculation + "gasPrice": "0", + + // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether + "gasToken": ethers.constants.AddressZero, + + // Address of receiver of gas payment (or `null` if tx.origin) + "refundReceiver": ethers.constants.AddressZero, + + // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce + nonce + }; const ethAdapter = await getEthAdapter(); const safeSdk = await Safe.create({ethAdapter, safeAddress}); From cb25bc1f54aec5126bba75f62735c5963456dc05 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:35:48 +0300 Subject: [PATCH 10/44] Configure lines-around-comment --- .eslintrc.cjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 730490a..303c8ac 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -13,6 +13,10 @@ module.exports = { "plugins": ["@typescript-eslint"], "root": true, "rules": { + "lines-around-comment": [ + "error", + {"allowBlockStart": true} + ], "object-curly-spacing": "error", "one-var": [ "error", @@ -23,7 +27,6 @@ module.exports = { "never" ], - "lines-around-comment": "warn", "max-depth": "warn", "max-len": "warn", "max-lines-per-function": "warn", From 3790f0b30734c3af2a570662500c498e0c822795 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 19:39:11 +0300 Subject: [PATCH 11/44] Reduce max depth --- .eslintrc.cjs | 1 - src/verification.ts | 50 +++++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 303c8ac..ebf8c44 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "max-depth": "warn", "max-len": "warn", "max-lines-per-function": "warn", "max-params": "warn", diff --git a/src/verification.ts b/src/verification.ts index d5de72f..970f217 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -5,31 +5,33 @@ import {getImplementationAddress} from "@openzeppelin/upgrades-core"; export const verify = async (contractName: string, contractAddress: string, constructorArguments: object) => { const {chainId} = await ethers.provider.getNetwork(); - if (builtinChains.find((chain) => chain.chainId === chainId) !== undefined) { - for (let retry = 0; retry <= 5; retry += 1) { - try { - await run( - "verify:verify", - { - "address": contractAddress, - constructorArguments - } - ); - break; - } catch (error) { - if (error instanceof Error) { - if (error.toString().includes("Contract source code already verified")) { - console.log(chalk.grey(`${contractName} is already verified`)); - return; - } - console.log(chalk.red(`Contract ${contractName} was not verified on etherscan`)); - console.log(error.toString()); - } else { - console.log( - "Unknown exception type:", - error - ); + if (builtinChains.find((chain) => chain.chainId === chainId) === undefined) { + console.log(chalk.grey("Verification on this network is not supported")); + return; + } + for (let retry = 0; retry <= 5; retry += 1) { + try { + await run( + "verify:verify", + { + "address": contractAddress, + constructorArguments } + ); + break; + } catch (error) { + if (error instanceof Error) { + if (error.toString().includes("Contract source code already verified")) { + console.log(chalk.grey(`${contractName} is already verified`)); + return; + } + console.log(chalk.red(`Contract ${contractName} was not verified on etherscan`)); + console.log(error.toString()); + } else { + console.log( + "Unknown exception type:", + error + ); } } } From 0874959f9b66e44067968d082119c83f8937ea00 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 13 Sep 2023 20:31:58 +0300 Subject: [PATCH 12/44] Remove long lines --- .eslintrc.cjs | 1 - hardhat.config.ts | 5 ++- src/abi.ts | 7 +++- src/deploy.ts | 9 +++-- src/gnosis-safe.ts | 46 ++++++++++++++++++------ src/multiSend.ts | 25 +++++++++---- src/submitters/auto-submitter.ts | 38 +++++++++++++------- src/submitters/eoa-submitter.ts | 3 +- src/submitters/safe-to-ima-submitter.ts | 10 ++++-- src/submitters/submitter.ts | 6 ++-- src/upgrader.ts | 48 ++++++++++++++++++------- src/verification.ts | 32 ++++++++++++----- src/version.ts | 4 ++- 13 files changed, 172 insertions(+), 62 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ebf8c44..34da299 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "max-len": "warn", "max-lines-per-function": "warn", "max-params": "warn", "max-statements": "warn", diff --git a/hardhat.config.ts b/hardhat.config.ts index a51de98..9db4014 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -3,10 +3,13 @@ import "@typechain/hardhat"; import "@nomiclabs/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; +const coreArtifacts = + "node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json"; + const config: HardhatUserConfig = { "typechain": { "target": "ethers-v5", - "externalArtifacts": ["node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json"] + "externalArtifacts": [coreArtifacts] } }; diff --git a/src/abi.ts b/src/abi.ts index 335f114..f2f6b50 100644 --- a/src/abi.ts +++ b/src/abi.ts @@ -5,7 +5,12 @@ export const getAbi = (contractInterface: Interface) => { abi.forEach((obj: {type: string}) => { if (obj.type === "function") { - const func = obj as {name: string, type: string, inputs: object[], outputs: object[]}; + const func = obj as { + name: string, + type: string, + inputs: object[], + outputs: object[] + }; func.inputs.concat(func.outputs).forEach((output: object) => { Object.assign( output, diff --git a/src/deploy.ts b/src/deploy.ts index 4774dad..a127333 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -48,7 +48,10 @@ const _linkBytecode = (artifact: Artifact, libraries: Map) => { return bytecode; }; -export const getLinkedContractFactory = async (contractName: string, libraries: Map) => { +export const getLinkedContractFactory = async ( + contractName: string, + libraries: Map +) => { const cArtifact = await artifacts.readArtifact(contractName); const linkedBytecode = _linkBytecode( @@ -62,7 +65,9 @@ export const getLinkedContractFactory = async (contractName: string, libraries: return ContractFactory; }; -export const getManifestFile = async (): Promise => (await Manifest.forNetwork(ethers.provider)).file; +export const getManifestFile = async function getManifestFile () { + return (await Manifest.forNetwork(ethers.provider)).file; +}; export const getContractFactory = async (contract: string) => { const {linkReferences} = await artifacts.readArtifact(contract); diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index c1534b2..553f508 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -3,7 +3,11 @@ import {ethers} from "hardhat"; import {UnsignedTransaction} from "ethers"; import SafeApiKit from "@safe-global/api-kit"; import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; -import {MetaTransactionData, SafeTransaction, SafeTransactionDataPartial} from "@safe-global/safe-core-sdk-types"; +import { + MetaTransactionData, + SafeTransaction, + SafeTransactionDataPartial +} from "@safe-global/safe-core-sdk-types"; enum Network { @@ -24,7 +28,10 @@ const URLS = { // Public functions -export const createMultiSendTransaction = async (safeAddress: string, transactions: UnsignedTransaction[]) => { +export const createMultiSendTransaction = async ( + safeAddress: string, + transactions: UnsignedTransaction[] +) => { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ @@ -53,26 +60,34 @@ export const createMultiSendTransaction = async (safeAddress: string, transactio // Max gas to use in the transaction "safeTxGas": "0", - // Gas costs not related to the transaction execution (signature check, refund payment...) + // Gas costs not related to the transaction execution + // (signature check, refund payment...) "baseGas": "0", // Gas price used for the refund calculation "gasPrice": "0", - // Token address (hold by the Safe) to be used as a refund to the sender, if `null` is Ether + /* Token address (hold by the Safe) + * to be used as a refund to the sender, + * if `null` is Ether + */ "gasToken": ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) "refundReceiver": ethers.constants.AddressZero, - // Nonce of the Safe, transaction cannot be executed until Safe's nonce is not equal to this nonce + // Nonce of the Safe, + // Transaction cannot be executed until + // Safe's nonce is not equal to this nonce nonce }; const ethAdapter = await getEthAdapter(); const safeSdk = await Safe.create({ethAdapter, safeAddress}); - const safeTransaction = await safeSdk.createTransaction({safeTransactionData, - options}); + const safeTransaction = await safeSdk.createTransaction({ + safeTransactionData, + options + }); await estimateSafeTransaction( safeAddress, @@ -87,7 +102,10 @@ export const createMultiSendTransaction = async (safeAddress: string, transactio // Private functions -const estimateSafeTransaction = async (safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) => { +const estimateSafeTransaction = async ( + safeAddress: string, + safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[] +) => { console.log("Estimate gas"); const safeService = await getSafeService(); for (const transaction of safeTransactionData as MetaTransactionData[]) { @@ -108,7 +126,10 @@ const estimateSafeTransaction = async (safeAddress: string, safeTransactionData: console.log(chalk.green("Send transaction to gnosis safe")); }; -const proposeTransaction = async (safeAddress: string, safeTransaction: SafeTransaction) => { +const proposeTransaction = async ( + safeAddress: string, + safeTransaction: SafeTransaction +) => { const [safeOwner] = await ethers.getSigners(); const ethAdapter = await getEthAdapter(); @@ -149,7 +170,10 @@ const getSafeService = async () => { const getSafeTransactionUrl = (chainId: number) => { if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { - return URLS.safe_transaction[chainId as keyof typeof URLS.safe_transaction]; + return URLS.safe_transaction[ + chainId as keyof typeof URLS.safe_transaction + ]; } - throw Error(`Can't get safe-transaction url at network with chainId = ${chainId}`); + throw Error("Can't get safe-transaction url" + + ` at network with chainId = ${chainId}`); }; diff --git a/src/multiSend.ts b/src/multiSend.ts index 4de953d..3ee9546 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,14 +1,25 @@ import {BigNumber} from "ethers"; -const padWithZeros = (value: string, targetLength: number) => ("0".repeat(targetLength) + value).slice(-targetLength); +const padWithZeros = ( + value: string, + targetLength: number +) => ("0".repeat(targetLength) + value).slice(-targetLength); -export const encodeTransaction = (operation: 0 | 1, to: string, value: BigNumber | number, data: string) => { - // / operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte), - // / to as a address (=> 20 bytes), - // / value as a uint256 (=> 32 bytes), - // / data length as a uint256 (=> 32 bytes), - // / data as bytes. +export const encodeTransaction = ( + /* Operation as a uint8 with 0 for a call + * or 1 for a delegatecall (=> 1 byte) + */ + operation: 0 | 1, + // To as a address (=> 20 bytes) + to: string, + + // Value as a uint256 (=> 32 bytes) + value: BigNumber | number, + + // Data as bytes. + data: string +) => { let _operation = ""; if (operation === 0) { _operation = "00"; diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 38b004a..ee162ff 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -6,7 +6,9 @@ import hre, {ethers} from "hardhat"; import {EoaSubmitter} from "./eoa-submitter"; import {SafeSubmitter} from "./safe-submitter"; import chalk from "chalk"; -import {SafeImaLegacyMarionetteSubmitter} from "./safe-ima-legacy-marionette-submitter"; +import { + SafeImaLegacyMarionetteSubmitter +} from "./safe-ima-legacy-marionette-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; @@ -31,7 +33,8 @@ export class AutoSubmitter extends Submitter { } console.log("Owner is a contract"); - if (ethers.utils.getAddress(owner) === ethers.utils.getAddress(MARIONETTE_ADDRESS)) { + if (ethers.utils.getAddress(owner) === + ethers.utils.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); const imaInstance = await AutoSubmitter._getImaInstance(); @@ -45,7 +48,8 @@ export class AutoSubmitter extends Submitter { * based on it * * if (await this._versionFunctionExists()) { - * console.log("version() function was found. Use normal Marionette") + * console.log("version() function was found." + + * " Use normal Marionette") * submitter = new SafeImaMarionetteSubmitter( * safeAddress, * imaAbi, @@ -53,7 +57,8 @@ export class AutoSubmitter extends Submitter { * mainnetChainId * ) * } else { - * console.log("No version() function was found. Use legacy Marionette") + * console.log("No version() function was found." + + * " Use legacy Marionette") * submitter = new SafeImaLegacyMarionetteSubmitter( * safeAddress, * imaAbi, @@ -79,18 +84,20 @@ export class AutoSubmitter extends Submitter { private static async _getImaInstance () { if (!process.env.IMA) { - console.log(chalk.red("Set target IMA alias to IMA environment variable")); + console.log(chalk.red("Set target IMA alias" + + " to IMA environment variable")); process.exit(1); } - const - network = await skaleContracts.getNetworkByProvider(ethers.provider); + const network = + await skaleContracts.getNetworkByProvider(ethers.provider); const ima = await network.getProject("ima"); return await ima.getInstance(process.env.IMA); } private static _getSafeAddress () { if (!process.env.SAFE_ADDRESS) { - console.log(chalk.red("Set Gnosis Safe owner address to SAFE_ADDRESS environment variable")); + console.log(chalk.red("Set Gnosis Safe owner address" + + " to SAFE_ADDRESS environment variable")); process.exit(1); } return process.env.SAFE_ADDRESS; @@ -100,8 +107,10 @@ export class AutoSubmitter extends Submitter { // Query Context to get schain hash if (!process.env.SCHAIN_HASH) { if (!process.env.SCHAIN_NAME) { - console.log(chalk.red("Set schain name to SCHAIN_NAME environment variable")); - console.log(chalk.red("or schain hash to SCHAIN_HASH environment variable")); + console.log(chalk.red("Set schain name" + + " to SCHAIN_NAME environment variable")); + console.log(chalk.red("or schain hash" + + " to SCHAIN_HASH environment variable")); throw Error("Schain is not set"); } else { return ethers.utils.solidityKeccak256( @@ -116,8 +125,10 @@ export class AutoSubmitter extends Submitter { private static _getMainnetChainId () { if (!process.env.MAINNET_CHAIN_ID) { - console.log(chalk.red("Set chainId of mainnet to MAINNET_CHAIN_ID environment variable")); - console.log(chalk.red("Use 1 for Ethereum mainnet or 5 for Goerli")); + console.log(chalk.red("Set chainId of mainnet" + + " to MAINNET_CHAIN_ID environment variable")); + console.log(chalk.red("Use 1 for Ethereum mainnet" + + " or 5 for Goerli")); throw Error("Mainnet chainId is not set"); } else { return Number.parseInt(process.env.MAINNET_CHAIN_ID); @@ -167,7 +178,8 @@ export class AutoSubmitter extends Submitter { return true; } catch { /* - * Otherwise (revert) we assume that there is no entry in the jump table + * Otherwise (revert) we assume + * that there is no entry in the jump table * meaning that the contract doesn't include version() */ return false; diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 5276eb6..592eeaa 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -15,7 +15,8 @@ export class EoaSubmitter extends Submitter { "value": transaction.value, "data": transaction.data }); - console.log(`Waiting for a transaction with nonce ${response.nonce}`); + console.log("Waiting for a transaction" + + ` with nonce ${response.nonce}`); await response.wait(); console.log("The transaction was sent"); } diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index fd6f503..7192f2e 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -9,7 +9,12 @@ export class SafeToImaSubmitter extends SafeSubmitter { private _messageProxyForMainnet: Contract | undefined; - constructor (safeAddress: string, imaInstance: Instance, targetSchainHash: BytesLike, chainId?: number) { + constructor ( + safeAddress: string, + imaInstance: Instance, + targetSchainHash: BytesLike, + chainId?: number + ) { super( safeAddress, chainId @@ -39,7 +44,8 @@ export class SafeToImaSubmitter extends SafeSubmitter { private async _getMessageProxyForMainnet () { if (this._messageProxyForMainnet === undefined) { - this._messageProxyForMainnet = await this.imaInstance.getContract("MessageProxyForMainnet"); + this._messageProxyForMainnet = + await this.imaInstance.getContract("MessageProxyForMainnet"); } return this._messageProxyForMainnet; } diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index 816e76f..3ca3b9f 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -8,8 +8,10 @@ export abstract class Submitter { protected static _atomicityWarning () { if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) { - console.log(chalk.red("The upgrade will consist of multiple transactions and will not be atomic")); - console.log(chalk.red("If not atomic upgrade is OK set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); + console.log(chalk.red("The upgrade will consist" + + " of multiple transactions and will not be atomic")); + console.log(chalk.red("If not atomic upgrade is OK" + + " set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); process.exit(1); } else { console.log(chalk.yellow("Not atomic upgrade is performing")); diff --git a/src/upgrader.ts b/src/upgrader.ts index 368d15c..82e5783 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -5,9 +5,16 @@ import {artifacts, ethers, network, upgrades} from "hardhat"; import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {getVersion} from "./version"; import {promises as fs} from "fs"; -import {deployLibraries, getLinkedContractFactory, getManifestFile} from "./deploy"; +import { + deployLibraries, + getLinkedContractFactory, + getManifestFile +} from "./deploy"; import {UnsignedTransaction} from "ethers"; -import {getImplementationAddress, hashBytecode} from "@openzeppelin/upgrades-core"; +import { + getImplementationAddress, + hashBytecode +} from "@openzeppelin/upgrades-core"; import {verify} from "./verification"; import {Submitter} from "./submitters/submitter"; import {SkaleManifestData} from "./types/SkaleManifestData"; @@ -69,11 +76,16 @@ export abstract class Upgrader { deployedVersion += "-stable.0"; } if (deployedVersion !== this.targetVersion) { - console.log(chalk.red(`This script can't upgrade version ${deployedVersion} to ${version}`)); + const cannotUpgradeMessage = + `This script can't upgrade version ${deployedVersion}` + + ` to ${version}`; + console.log(chalk.red(cannotUpgradeMessage)); process.exit(1); } } else { - console.log(chalk.yellow(`Can't check currently deployed version of ${this.projectName}`)); + const cannotCheckMessage = + `Can't check currently deployed version of ${this.projectName}`; + console.log(chalk.yellow(cannotCheckMessage)); } console.log(`Will mark updated version as ${version}`); @@ -83,11 +95,16 @@ export abstract class Upgrader { } // Deploy new implementations - const contractsToUpgrade: {proxyAddress: string, implementationAddress: string, name: string}[] = []; + const contractsToUpgrade: { + proxyAddress: string, + implementationAddress: string, + name: string + }[] = []; for (const contract of this.contractNamesToUpgrade) { - const - contractFactory = await Upgrader._getContractFactoryAndUpdateManifest(contract); - const proxyAddress = (await this.instance.getContract(contract)).address; + const contractFactory = + await Upgrader.getContractFactoryAndUpdateManifest(contract); + const proxyAddress = + (await this.instance.getContract(contract)).address; console.log(`Prepare upgrade of ${contract}`); const @@ -116,7 +133,11 @@ export abstract class Upgrader { // Switch proxies to new implementations for (const contract of contractsToUpgrade) { - console.log(chalk.yellowBright(`Prepare transaction to upgrade ${contract.name} at ${contract.proxyAddress} to ${contract.implementationAddress}`)); + const infoMessage = + `Prepare transaction to upgrade ${contract.name}` + + ` at ${contract.proxyAddress}` + + ` to ${contract.implementationAddress}`; + console.log(chalk.yellowBright(infoMessage)); this.transactions.push({ "to": proxyAdmin.address, "data": proxyAdmin.interface.encodeFunctionData( @@ -165,7 +186,8 @@ export abstract class Upgrader { // Private - private static async _getContractFactoryAndUpdateManifest (contract: string) { + private static async getContractFactoryAndUpdateManifest (contract: + string) { const {linkReferences} = await artifacts.readArtifact(contract); const manifest = JSON.parse(await fs.readFile( await getManifestFile(), @@ -188,11 +210,13 @@ export abstract class Upgrader { librariesToUpgrade.push(libraryName); continue; } - const libraryBytecodeHash = manifest.libraries[libraryName].bytecodeHash; + const libraryBytecodeHash = + manifest.libraries[libraryName].bytecodeHash; if (hashBytecode(bytecode) !== libraryBytecodeHash) { librariesToUpgrade.push(libraryName); } else { - oldLibraries[libraryName] = manifest.libraries[libraryName].address; + oldLibraries[libraryName] = + manifest.libraries[libraryName].address; } } const libraries = await deployLibraries(librariesToUpgrade); diff --git a/src/verification.ts b/src/verification.ts index 970f217..d2ddb6d 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -1,12 +1,19 @@ import {ethers, network, run} from "hardhat"; -import {builtinChains} from "@nomicfoundation/hardhat-verify/internal/chain-config"; +import { + builtinChains +} from "@nomicfoundation/hardhat-verify/internal/chain-config"; import chalk from "chalk"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; -export const verify = async (contractName: string, contractAddress: string, constructorArguments: object) => { +export const verify = async ( + contractName: string, + contractAddress: string, + constructorArguments: object +) => { const {chainId} = await ethers.provider.getNetwork(); - if (builtinChains.find((chain) => chain.chainId === chainId) === undefined) { - console.log(chalk.grey("Verification on this network is not supported")); + if (!builtinChains.map((chain) => chain.chainId).includes(chainId)) { + const errorMessage = "Verification on this network is not supported"; + console.log(chalk.grey(errorMessage)); return; } for (let retry = 0; retry <= 5; retry += 1) { @@ -21,11 +28,16 @@ export const verify = async (contractName: string, contractAddress: string, cons break; } catch (error) { if (error instanceof Error) { - if (error.toString().includes("Contract source code already verified")) { - console.log(chalk.grey(`${contractName} is already verified`)); + const alreadyVerifiedErrorLine = + "Contract source code already verified"; + if (error.toString().includes(alreadyVerifiedErrorLine)) { + const infoMessage = `${contractName} is already verified`; + console.log(chalk.grey(infoMessage)); return; } - console.log(chalk.red(`Contract ${contractName} was not verified on etherscan`)); + const errorMessage = + `Contract ${contractName} was not verified on etherscan`; + console.log(chalk.red(errorMessage)); console.log(error.toString()); } else { console.log( @@ -37,7 +49,11 @@ export const verify = async (contractName: string, contractAddress: string, cons } }; -export const verifyProxy = async (contractName: string, proxyAddress: string, constructorArguments: object) => { +export const verifyProxy = async ( + contractName: string, + proxyAddress: string, + constructorArguments: object +) => { await verify( contractName, await getImplementationAddress( diff --git a/src/version.ts b/src/version.ts index a182828..bb03bd2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -9,7 +9,9 @@ class VersionNotFound extends Error {} const getVersionFilename = async (folder?: string): Promise => { if (folder === undefined) { - return getVersionFilename((await exec("git rev-parse --show-toplevel")).stdout.trim()); + return getVersionFilename(( + await exec("git rev-parse --show-toplevel") + ).stdout.trim()); } const VERSION_FILENAME = "VERSION"; const path = `${folder}/${VERSION_FILENAME}`; From 936ca5ff29b20be4df26e14008d0a3817dd81852 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 14 Sep 2023 17:12:49 +0300 Subject: [PATCH 13/44] Remove long functions --- .eslintrc.cjs | 1 - src/deploy.ts | 56 ++++---- src/gnosis-safe.ts | 96 +++++++------ src/multiSend.ts | 39 ++--- src/submitters/auto-submitter.ts | 4 + src/types/ContractToUpgrade.ts | 5 + src/upgrader.ts | 240 +++++++++++++++++++------------ 7 files changed, 262 insertions(+), 179 deletions(-) create mode 100644 src/types/ContractToUpgrade.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 34da299..9e53ffc 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "max-lines-per-function": "warn", "max-params": "warn", "max-statements": "warn", "multiline-comment-style": "warn", diff --git a/src/deploy.ts b/src/deploy.ts index a127333..da3d25a 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -4,6 +4,10 @@ import {promises as fs} from "fs"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {Artifact} from "hardhat/types"; +interface LibraryArtifacts { + [key: string]: unknown +} + const _deployLibrary = async (libraryName: string) => { const Library = await ethers.getContractFactory(libraryName); @@ -69,6 +73,32 @@ export const getManifestFile = async function getManifestFile () { return (await Manifest.forNetwork(ethers.provider)).file; }; +const updateManifest = async (libraryArtifacts: LibraryArtifacts) => { + const manifest = JSON.parse(await fs.readFile( + await getManifestFile(), + "utf-8" + )) as SkaleManifestData; + if (manifest.libraries === undefined) { + Object.assign( + manifest, + {"libraries": libraryArtifacts} + ); + } else { + Object.assign( + libraryArtifacts, + manifest.libraries + ); + } + await fs.writeFile( + await getManifestFile(), + JSON.stringify( + manifest, + null, + 4 + ) + ); +}; + export const getContractFactory = async (contract: string) => { const {linkReferences} = await artifacts.readArtifact(contract); if (!Object.keys(linkReferences).length) { @@ -82,7 +112,7 @@ export const getContractFactory = async (contract: string) => { } const libraries = await deployLibraries(libraryNames); - const libraryArtifacts: { [key: string]: unknown } = {}; + const libraryArtifacts: LibraryArtifacts = {}; for (const [ libraryName, libraryAddress @@ -94,29 +124,7 @@ export const getContractFactory = async (contract: string) => { }; } - const manifest = JSON.parse(await fs.readFile( - await getManifestFile(), - "utf-8" - )) as SkaleManifestData; - if (manifest.libraries === undefined) { - Object.assign( - manifest, - {"libraries": libraryArtifacts} - ); - } else { - Object.assign( - libraryArtifacts, - manifest.libraries - ); - } - await fs.writeFile( - await getManifestFile(), - JSON.stringify( - manifest, - null, - 4 - ) - ); + await updateManifest(libraryArtifacts); return await getLinkedContractFactory( contract, diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 553f508..49febf7 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -26,30 +26,35 @@ const URLS = { } }; +const defaultOptions = { + // Max gas to use in the transaction + "safeTxGas": "0", + + // Gas costs not related to the transaction execution + // (signature check, refund payment...) + "baseGas": "0", + + // Gas price used for the refund calculation + "gasPrice": "0", + + /* Token address (hold by the Safe) + * to be used as a refund to the sender, + * if `null` is Ether + */ + "gasToken": ethers.constants.AddressZero, + + // Address of receiver of gas payment (or `null` if tx.origin) + "refundReceiver": ethers.constants.AddressZero +}; + // Public functions export const createMultiSendTransaction = async ( safeAddress: string, transactions: UnsignedTransaction[] ) => { - const safeTransactionData: MetaTransactionData[] = []; - for (const transaction of transactions) { - safeTransactionData.push({ - "to": transaction.to - ? transaction.to - : ethers.constants.AddressZero, - "data": transaction.data - ? transaction.data.toString() - : "0x", - "value": transaction.value - ? transaction.value.toString() - : "0", - "operation": 0 - }); - } - - const - safeService = await getSafeService(); + const safeTransactionData = getSafeTransactionData(transactions); + const safeService = await getSafeService(); const nonce = await safeService.getNextNonce(safeAddress); console.log( "Will send tx to Gnosis with nonce", @@ -57,33 +62,19 @@ export const createMultiSendTransaction = async ( ); const options = { - // Max gas to use in the transaction - "safeTxGas": "0", - - // Gas costs not related to the transaction execution - // (signature check, refund payment...) - "baseGas": "0", - - // Gas price used for the refund calculation - "gasPrice": "0", - - /* Token address (hold by the Safe) - * to be used as a refund to the sender, - * if `null` is Ether - */ - "gasToken": ethers.constants.AddressZero, - - // Address of receiver of gas payment (or `null` if tx.origin) - "refundReceiver": ethers.constants.AddressZero, - - // Nonce of the Safe, - // Transaction cannot be executed until - // Safe's nonce is not equal to this nonce - nonce + ...defaultOptions, + ...{ + // Nonce of the Safe, + // Transaction cannot be executed until + // Safe's nonce is not equal to this nonce + nonce + } }; const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ethAdapter, - safeAddress}); + const safeSdk = await Safe.create({ + ethAdapter, + safeAddress + }); const safeTransaction = await safeSdk.createTransaction({ safeTransactionData, options @@ -102,6 +93,25 @@ export const createMultiSendTransaction = async ( // Private functions +const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { + const safeTransactionData: MetaTransactionData[] = []; + for (const transaction of transactions) { + safeTransactionData.push({ + "to": transaction.to + ? transaction.to + : ethers.constants.AddressZero, + "data": transaction.data + ? transaction.data.toString() + : "0x", + "value": transaction.value + ? transaction.value.toString() + : "0", + "operation": 0 + }); + } + return safeTransactionData; +}; + const estimateSafeTransaction = async ( safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[] diff --git a/src/multiSend.ts b/src/multiSend.ts index 3ee9546..b150297 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -5,6 +5,27 @@ const padWithZeros = ( targetLength: number ) => ("0".repeat(targetLength) + value).slice(-targetLength); +const getOperationBytes = (operation: 0 | 1) => { + if (operation === 0) { + return "00"; + } else if (operation === 1) { + return "01"; + } + throw Error("Operation has an incorrect value"); +}; + +const getToBytes = (to: string) => { + let _to = to; + if (to.startsWith("0x")) { + _to = _to.slice(2); + } + _to = padWithZeros( + _to, + 20 * 2 + ); + return _to; +}; + export const encodeTransaction = ( /* Operation as a uint8 with 0 for a call * or 1 for a delegatecall (=> 1 byte) @@ -20,23 +41,9 @@ export const encodeTransaction = ( // Data as bytes. data: string ) => { - let _operation = ""; - if (operation === 0) { - _operation = "00"; - } else if (operation === 1) { - _operation = "01"; - } else { - throw Error("Operation has an incorrect value"); - } + const _operation = getOperationBytes(operation); - let _to = to; - if (to.startsWith("0x")) { - _to = _to.slice(2); - } - _to = padWithZeros( - _to, - 20 * 2 - ); + const _to = getToBytes(to); const _value = padWithZeros( BigNumber.from(value).toHexString(). diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index ee162ff..7cb333b 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -33,6 +33,10 @@ export class AutoSubmitter extends Submitter { } console.log("Owner is a contract"); + return AutoSubmitter.getSubmitterForContractOwner(owner); + } + + private static async getSubmitterForContractOwner (owner: string) { if (ethers.utils.getAddress(owner) === ethers.utils.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); diff --git a/src/types/ContractToUpgrade.ts b/src/types/ContractToUpgrade.ts new file mode 100644 index 0000000..a2c054a --- /dev/null +++ b/src/types/ContractToUpgrade.ts @@ -0,0 +1,5 @@ +export interface ContractToUpgrade { + proxyAddress: string, + implementationAddress: string, + name: string +} diff --git a/src/upgrader.ts b/src/upgrader.ts index 82e5783..4c2b581 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -20,6 +20,9 @@ import {Submitter} from "./submitters/submitter"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {LinkReferences} from "hardhat/types"; +import {ContractToUpgrade} from "./types/ContractToUpgrade"; + export abstract class Upgrader { instance: Instance; @@ -69,24 +72,8 @@ export abstract class Upgrader { async upgrade () { const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; - let deployedVersion = await this.getDeployedVersion(); const version = await getVersion(); - if (deployedVersion) { - if (!deployedVersion.includes("-")) { - deployedVersion += "-stable.0"; - } - if (deployedVersion !== this.targetVersion) { - const cannotUpgradeMessage = - `This script can't upgrade version ${deployedVersion}` + - ` to ${version}`; - console.log(chalk.red(cannotUpgradeMessage)); - process.exit(1); - } - } else { - const cannotCheckMessage = - `Can't check currently deployed version of ${this.projectName}`; - console.log(chalk.yellow(cannotCheckMessage)); - } + await this.checkVersion(version); console.log(`Will mark updated version as ${version}`); if (this.deployNewContracts !== undefined) { @@ -94,12 +81,78 @@ export abstract class Upgrader { await this.deployNewContracts(); } - // Deploy new implementations - const contractsToUpgrade: { - proxyAddress: string, - implementationAddress: string, - name: string - }[] = []; + const contractsToUpgrade = await this.deployNewImplementations(); + + this.switchToNewImplementations( + contractsToUpgrade, + proxyAdmin + ); + + if (this.initialize !== undefined) { + await this.initialize(); + } + + // Write version + await this.setVersion(version); + + await fs.writeFile( + `data/transactions-${version}-${network.name}.json`, + JSON.stringify( + this.transactions, + null, + 4 + ) + ); + + await this.submitter.submit(this.transactions); + + await Upgrader.verify(contractsToUpgrade); + + console.log("Done"); + } + + // Private + + private static async verify (contractsToUpgrade: ContractToUpgrade[]) { + if (process.env.NO_VERIFY) { + console.log("Skip verification"); + } else { + console.log("Start verification"); + for (const contract of contractsToUpgrade) { + await verify( + contract.name, + contract.implementationAddress, + [] + ); + } + } + } + + private switchToNewImplementations ( + contractsToUpgrade: ContractToUpgrade[], + proxyAdmin: ProxyAdmin + ) { + for (const contract of contractsToUpgrade) { + const infoMessage = + `Prepare transaction to upgrade ${contract.name}` + + ` at ${contract.proxyAddress}` + + ` to ${contract.implementationAddress}`; + console.log(chalk.yellowBright(infoMessage)); + this.transactions.push({ + "to": proxyAdmin.address, + "data": proxyAdmin.interface.encodeFunctionData( + "upgrade", + [ + contract.proxyAddress, + contract.implementationAddress + ] + ) + }); + } + } + + private async deployNewImplementations () { + const contractsToUpgrade: ContractToUpgrade[] = []; for (const contract of this.contractNamesToUpgrade) { const contractFactory = await Upgrader.getContractFactoryAndUpdateManifest(contract); @@ -130,62 +183,37 @@ export abstract class Upgrader { console.log(chalk.gray(`Contract ${contract} is up to date`)); } } + return contractsToUpgrade; + } - // Switch proxies to new implementations - for (const contract of contractsToUpgrade) { - const infoMessage = - `Prepare transaction to upgrade ${contract.name}` + - ` at ${contract.proxyAddress}` + - ` to ${contract.implementationAddress}`; - console.log(chalk.yellowBright(infoMessage)); - this.transactions.push({ - "to": proxyAdmin.address, - "data": proxyAdmin.interface.encodeFunctionData( - "upgrade", - [ - contract.proxyAddress, - contract.implementationAddress - ] - ) - }); - } - - if (this.initialize !== undefined) { - await this.initialize(); + private async getNormalizedDeployedVersion () { + const deployedVersion = await this.getDeployedVersion(); + if (deployedVersion) { + if (!deployedVersion.includes("-")) { + return `${deployedVersion}-stable.0`; + } + return deployedVersion; } + return deployedVersion; + } - // Write version - await this.setVersion(version); - - await fs.writeFile( - `data/transactions-${version}-${network.name}.json`, - JSON.stringify( - this.transactions, - null, - 4 - ) - ); - - await this.submitter.submit(this.transactions); - - if (process.env.NO_VERIFY) { - console.log("Skip verification"); - } else { - console.log("Start verification"); - for (const contract of contractsToUpgrade) { - await verify( - contract.name, - contract.implementationAddress, - [] - ); + private async checkVersion (version: string) { + const deployedVersion = await this.getNormalizedDeployedVersion(); + if (deployedVersion) { + if (deployedVersion !== this.targetVersion) { + const cannotUpgradeMessage = + `This script can't upgrade version ${deployedVersion}` + + ` to ${version}`; + console.log(chalk.red(cannotUpgradeMessage)); + process.exit(1); } + } else { + const cannotCheckMessage = + `Can't check currently deployed version of ${this.projectName}`; + console.log(chalk.yellow(cannotCheckMessage)); } - - console.log("Done"); } - // Private - private static async getContractFactoryAndUpdateManifest (contract: string) { const {linkReferences} = await artifacts.readArtifact(contract); @@ -193,40 +221,31 @@ export abstract class Upgrader { await getManifestFile(), "utf-8" )) as SkaleManifestData; + if (manifest.libraries === undefined) { + manifest.libraries = {}; + } if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); } - const librariesToUpgrade = []; - const oldLibraries: {[k: string]: string} = {}; - if (manifest.libraries === undefined) { - manifest.libraries = {}; - } - for (const key of Object.keys(linkReferences)) { - const libraryName = Object.keys(linkReferences[key])[0]; - const {bytecode} = await artifacts.readArtifact(libraryName); - if (manifest.libraries[libraryName] === undefined) { - librariesToUpgrade.push(libraryName); - continue; - } - const libraryBytecodeHash = - manifest.libraries[libraryName].bytecodeHash; - if (hashBytecode(bytecode) !== libraryBytecodeHash) { - librariesToUpgrade.push(libraryName); - } else { - oldLibraries[libraryName] = - manifest.libraries[libraryName].address; - } - } + const { + librariesToUpgrade, + oldLibraries + } = await Upgrader.getLibrariesToUpgrade( + manifest, + linkReferences + ); const libraries = await deployLibraries(librariesToUpgrade); for (const [ libraryName, libraryAddress ] of libraries.entries()) { const {bytecode} = await artifacts.readArtifact(libraryName); - manifest.libraries[libraryName] = {"address": libraryAddress, - "bytecodeHash": hashBytecode(bytecode)}; + manifest.libraries[libraryName] = { + "address": libraryAddress, + "bytecodeHash": hashBytecode(bytecode) + }; } Object.assign( libraries, @@ -245,4 +264,35 @@ export abstract class Upgrader { libraries ); } + + private static async getLibrariesToUpgrade ( + manifest: SkaleManifestData, + linkReferences: LinkReferences + ) { + const librariesToUpgrade = []; + const oldLibraries: {[k: string]: string} = {}; + if (manifest.libraries === undefined) { + manifest.libraries = {}; + } + for (const key of Object.keys(linkReferences)) { + const libraryName = Object.keys(linkReferences[key])[0]; + const {bytecode} = await artifacts.readArtifact(libraryName); + if (manifest.libraries[libraryName] === undefined) { + librariesToUpgrade.push(libraryName); + continue; + } + const libraryBytecodeHash = + manifest.libraries[libraryName].bytecodeHash; + if (hashBytecode(bytecode) !== libraryBytecodeHash) { + librariesToUpgrade.push(libraryName); + } else { + oldLibraries[libraryName] = + manifest.libraries[libraryName].address; + } + } + return { + librariesToUpgrade, + oldLibraries + }; + } } From f42b46c4998c6239222d6e837ded62a7b14e019e Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 14 Sep 2023 17:35:29 +0300 Subject: [PATCH 14/44] Remove too many parameters --- .eslintrc.cjs | 1 - src/multiSend.ts | 17 +-- src/submitters/auto-submitter.ts | 7 +- src/submitters/safe-to-ima-submitter.ts | 12 ++- src/types/ContractToUpgrade.ts | 5 - src/upgrader.ts | 134 +++++------------------- 6 files changed, 50 insertions(+), 126 deletions(-) delete mode 100644 src/types/ContractToUpgrade.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9e53ffc..0dd45ed 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "max-params": "warn", "max-statements": "warn", "multiline-comment-style": "warn", "no-await-in-loop": "warn", diff --git a/src/multiSend.ts b/src/multiSend.ts index b150297..f57eeee 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -26,7 +26,8 @@ const getToBytes = (to: string) => { return _to; }; -export const encodeTransaction = ( +interface Transaction { + /* Operation as a uint8 with 0 for a call * or 1 for a delegatecall (=> 1 byte) */ @@ -40,19 +41,21 @@ export const encodeTransaction = ( // Data as bytes. data: string -) => { - const _operation = getOperationBytes(operation); +} + +export const encodeTransaction = (transaction: Transaction) => { + const _operation = getOperationBytes(transaction.operation); - const _to = getToBytes(to); + const _to = getToBytes(transaction.to); const _value = padWithZeros( - BigNumber.from(value).toHexString(). + BigNumber.from(transaction.value).toHexString(). slice(2), 32 * 2 ); - let _data = data; - if (data.startsWith("0x")) { + let _data = transaction.data; + if (transaction.data.startsWith("0x")) { _data = _data.slice(2); } if (_data.length % 2 !== 0) { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 7cb333b..bb46d3d 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -71,12 +71,13 @@ export class AutoSubmitter extends Submitter { * ) * } */ - return new SafeImaLegacyMarionetteSubmitter( safeAddress, imaInstance, - schainHash, - mainnetChainId + { + mainnetChainId, + "targetSchainHash": schainHash + } ); } diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 7192f2e..380d341 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -2,6 +2,11 @@ import {BytesLike, Contract, UnsignedTransaction} from "ethers"; import {SafeSubmitter} from "./safe-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +interface Network { + targetSchainHash: BytesLike, + mainnetChainId?: number +} + export class SafeToImaSubmitter extends SafeSubmitter { imaInstance: Instance; @@ -12,15 +17,14 @@ export class SafeToImaSubmitter extends SafeSubmitter { constructor ( safeAddress: string, imaInstance: Instance, - targetSchainHash: BytesLike, - chainId?: number + network: Network ) { super( safeAddress, - chainId + network.mainnetChainId ); this.imaInstance = imaInstance; - this.targetSchainHash = targetSchainHash; + this.targetSchainHash = network.targetSchainHash; } async submit (transactions: UnsignedTransaction[]): Promise { diff --git a/src/types/ContractToUpgrade.ts b/src/types/ContractToUpgrade.ts deleted file mode 100644 index a2c054a..0000000 --- a/src/types/ContractToUpgrade.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface ContractToUpgrade { - proxyAddress: string, - implementationAddress: string, - name: string -} diff --git a/src/upgrader.ts b/src/upgrader.ts index 4c2b581..6921f69 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,29 +1,35 @@ import hre from "hardhat"; import chalk from "chalk"; import {ProxyAdmin} from "../typechain-types"; -import {artifacts, ethers, network, upgrades} from "hardhat"; +import {network, upgrades} from "hardhat"; import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {getVersion} from "./version"; import {promises as fs} from "fs"; -import { - deployLibraries, - getLinkedContractFactory, - getManifestFile -} from "./deploy"; import {UnsignedTransaction} from "ethers"; -import { - getImplementationAddress, - hashBytecode -} from "@openzeppelin/upgrades-core"; +import {getImplementationAddress} from "@openzeppelin/upgrades-core"; import {verify} from "./verification"; import {Submitter} from "./submitters/submitter"; -import {SkaleManifestData} from "./types/SkaleManifestData"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; -import {LinkReferences} from "hardhat/types"; -import {ContractToUpgrade} from "./types/ContractToUpgrade"; +import {getContractFactoryAndUpdateManifest} from "./contractFactory"; +interface ContractToUpgrade { + proxyAddress: string, + implementationAddress: string, + name: string +} + +interface Project { + name: string; + instance: Instance; +} + +interface Target { + version: string; + contractNamesToUpgrade: string[] +} + export abstract class Upgrader { instance: Instance; @@ -38,19 +44,17 @@ export abstract class Upgrader { submitter: Submitter; constructor ( - projectName: string, - targetVersion: string, - instance: Instance, - contractNamesToUpgrade: string[], + project: Project, + target: Target, submitter: Submitter = new AutoSubmitter() ) { - this.targetVersion = targetVersion; - if (!targetVersion.includes("-")) { - this.targetVersion = `${targetVersion}-stable.0`; + this.targetVersion = target.version; + if (!target.version.includes("-")) { + this.targetVersion = `${target.version}-stable.0`; } - this.instance = instance; - this.contractNamesToUpgrade = contractNamesToUpgrade; - this.projectName = projectName; + this.instance = project.instance; + this.contractNamesToUpgrade = target.contractNamesToUpgrade; + this.projectName = project.name; this.transactions = []; this.submitter = submitter; } @@ -155,7 +159,7 @@ export abstract class Upgrader { const contractsToUpgrade: ContractToUpgrade[] = []; for (const contract of this.contractNamesToUpgrade) { const contractFactory = - await Upgrader.getContractFactoryAndUpdateManifest(contract); + await getContractFactoryAndUpdateManifest(contract); const proxyAddress = (await this.instance.getContract(contract)).address; @@ -213,86 +217,4 @@ export abstract class Upgrader { console.log(chalk.yellow(cannotCheckMessage)); } } - - private static async getContractFactoryAndUpdateManifest (contract: - string) { - const {linkReferences} = await artifacts.readArtifact(contract); - const manifest = JSON.parse(await fs.readFile( - await getManifestFile(), - "utf-8" - )) as SkaleManifestData; - if (manifest.libraries === undefined) { - manifest.libraries = {}; - } - - if (!Object.keys(linkReferences).length) { - return await ethers.getContractFactory(contract); - } - - const { - librariesToUpgrade, - oldLibraries - } = await Upgrader.getLibrariesToUpgrade( - manifest, - linkReferences - ); - const libraries = await deployLibraries(librariesToUpgrade); - for (const [ - libraryName, - libraryAddress - ] of libraries.entries()) { - const {bytecode} = await artifacts.readArtifact(libraryName); - manifest.libraries[libraryName] = { - "address": libraryAddress, - "bytecodeHash": hashBytecode(bytecode) - }; - } - Object.assign( - libraries, - oldLibraries - ); - await fs.writeFile( - await getManifestFile(), - JSON.stringify( - manifest, - null, - 4 - ) - ); - return await getLinkedContractFactory( - contract, - libraries - ); - } - - private static async getLibrariesToUpgrade ( - manifest: SkaleManifestData, - linkReferences: LinkReferences - ) { - const librariesToUpgrade = []; - const oldLibraries: {[k: string]: string} = {}; - if (manifest.libraries === undefined) { - manifest.libraries = {}; - } - for (const key of Object.keys(linkReferences)) { - const libraryName = Object.keys(linkReferences[key])[0]; - const {bytecode} = await artifacts.readArtifact(libraryName); - if (manifest.libraries[libraryName] === undefined) { - librariesToUpgrade.push(libraryName); - continue; - } - const libraryBytecodeHash = - manifest.libraries[libraryName].bytecodeHash; - if (hashBytecode(bytecode) !== libraryBytecodeHash) { - librariesToUpgrade.push(libraryName); - } else { - oldLibraries[libraryName] = - manifest.libraries[libraryName].address; - } - } - return { - librariesToUpgrade, - oldLibraries - }; - } } From 1e6d43fba33f5360a684cd45ab6000a5578ed297 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 14 Sep 2023 18:47:46 +0300 Subject: [PATCH 15/44] Remove functions with many statements --- .eslintrc.cjs | 1 - src/contractFactory.ts | 109 +++++++++++++++++++++++++++++++ src/deploy.ts | 37 +++++++---- src/types/SkaleManifestData.ts | 2 +- src/upgrader.ts | 113 ++++++++++++++++++++------------- src/verification.ts | 76 ++++++++++++++-------- 6 files changed, 250 insertions(+), 88 deletions(-) create mode 100644 src/contractFactory.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0dd45ed..d34b3ed 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "max-statements": "warn", "multiline-comment-style": "warn", "no-await-in-loop": "warn", "no-console": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts new file mode 100644 index 0000000..1ac3030 --- /dev/null +++ b/src/contractFactory.ts @@ -0,0 +1,109 @@ +import {artifacts, ethers} from "hardhat"; +import {promises as fs} from "fs"; +import {hashBytecode} from "@openzeppelin/upgrades-core"; +import {LinkReferences} from "hardhat/types"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import { + deployLibraries, + getLinkedContractFactory, + getManifestFile +} from "./deploy"; + + +const getSkaleManifest = async () => { + const manifest = JSON.parse(await fs.readFile( + await getManifestFile(), + "utf-8" + )); + if (manifest.libraries === undefined) { + manifest.libraries = {}; + } + return manifest as SkaleManifestData; +}; + +const updateManifest = async ( + manifest: SkaleManifestData, + libraries: Map, + oldLibraries: {[k: string]: string} +) => { + for (const [ + libraryName, + libraryAddress + ] of libraries.entries()) { + const {bytecode} = await artifacts.readArtifact(libraryName); + manifest.libraries[libraryName] = { + "address": libraryAddress, + "bytecodeHash": hashBytecode(bytecode) + }; + } + Object.assign( + libraries, + oldLibraries + ); + await fs.writeFile( + await getManifestFile(), + JSON.stringify( + manifest, + null, + 4 + ) + ); +}; + +export const getContractFactoryAndUpdateManifest = async (contract: string) => { + const {linkReferences} = await artifacts.readArtifact(contract); + if (!Object.keys(linkReferences).length) { + return await ethers.getContractFactory(contract); + } + + const manifest = await getSkaleManifest(); + + const { + librariesToUpgrade, + oldLibraries + } = await getLibrariesToUpgrade( + manifest, + linkReferences + ); + const libraries = await deployLibraries(librariesToUpgrade); + await updateManifest( + manifest, + libraries, + oldLibraries + ); + return await getLinkedContractFactory( + contract, + libraries + ); +}; + +const getLibrariesNames = + (linkReferences: LinkReferences) => Object.values(linkReferences). + map((libraryObject) => Object.keys(libraryObject)[0]); + + +const getLibrariesToUpgrade = async ( + manifest: SkaleManifestData, + linkReferences: LinkReferences +) => { + const librariesToUpgrade = []; + const oldLibraries: {[k: string]: string} = {}; + for (const libraryName of getLibrariesNames(linkReferences)) { + const {bytecode} = await artifacts.readArtifact(libraryName); + if (manifest.libraries[libraryName] === undefined) { + librariesToUpgrade.push(libraryName); + } else if ( + hashBytecode(bytecode) !== manifest.libraries[libraryName]. + bytecodeHash + ) { + librariesToUpgrade.push(libraryName); + } else { + oldLibraries[libraryName] = + manifest.libraries[libraryName].address; + } + } + return { + librariesToUpgrade, + oldLibraries + }; +}; diff --git a/src/deploy.ts b/src/deploy.ts index da3d25a..f4df96d 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -2,7 +2,7 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; import {promises as fs} from "fs"; import {SkaleManifestData} from "./types/SkaleManifestData"; -import {Artifact} from "hardhat/types"; +import {Artifact, LinkReferences} from "hardhat/types"; interface LibraryArtifacts { [key: string]: unknown @@ -99,19 +99,7 @@ const updateManifest = async (libraryArtifacts: LibraryArtifacts) => { ); }; -export const getContractFactory = async (contract: string) => { - const {linkReferences} = await artifacts.readArtifact(contract); - if (!Object.keys(linkReferences).length) { - return await ethers.getContractFactory(contract); - } - - const libraryNames = []; - for (const key of Object.keys(linkReferences)) { - const libraryName = Object.keys(linkReferences[key])[0]; - libraryNames.push(libraryName); - } - - const libraries = await deployLibraries(libraryNames); +const getLibraryArtifacts = async (libraries: Map) => { const libraryArtifacts: LibraryArtifacts = {}; for (const [ libraryName, @@ -123,6 +111,27 @@ export const getContractFactory = async (contract: string) => { "bytecodeHash": hashBytecode(bytecode) }; } + return libraryArtifacts; +}; + +const getLibraryNames = (linkReferences: LinkReferences) => { + const libraryNames = []; + for (const key of Object.keys(linkReferences)) { + const libraryName = Object.keys(linkReferences[key])[0]; + libraryNames.push(libraryName); + } + return libraryNames; +}; + +export const getContractFactory = async (contract: string) => { + const {linkReferences} = await artifacts.readArtifact(contract); + if (!Object.keys(linkReferences).length) { + return await ethers.getContractFactory(contract); + } + + const libraryNames = getLibraryNames(linkReferences); + const libraries = await deployLibraries(libraryNames); + const libraryArtifacts = await getLibraryArtifacts(libraries); await updateManifest(libraryArtifacts); diff --git a/src/types/SkaleManifestData.ts b/src/types/SkaleManifestData.ts index 1fb82ed..caabeff 100644 --- a/src/types/SkaleManifestData.ts +++ b/src/types/SkaleManifestData.ts @@ -1,7 +1,7 @@ import {ManifestData} from "@openzeppelin/upgrades-core"; export interface SkaleManifestData extends ManifestData { - libraries?: { + libraries: { [libraryName: string]: { address: string bytecodeHash: string diff --git a/src/upgrader.ts b/src/upgrader.ts index 6921f69..09f8609 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -74,31 +74,54 @@ export abstract class Upgrader { // Public async upgrade () { - const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; + const version = await this.prepareVersion(); - const version = await getVersion(); - await this.checkVersion(version); - console.log(`Will mark updated version as ${version}`); - - if (this.deployNewContracts !== undefined) { - // Deploy new contracts - await this.deployNewContracts(); - } + await this.callDeployNewContracts(); const contractsToUpgrade = await this.deployNewImplementations(); this.switchToNewImplementations( contractsToUpgrade, - proxyAdmin + await getManifestAdmin(hre) as unknown as ProxyAdmin ); + await this.callInitialize(); + + // Write version + await this.setVersion(version); + + await this.writeTransactions(version); + + await this.submitter.submit(this.transactions); + + await Upgrader.verify(contractsToUpgrade); + + console.log("Done"); + } + + // Private + + private async callInitialize () { if (this.initialize !== undefined) { await this.initialize(); } + } - // Write version - await this.setVersion(version); + private async callDeployNewContracts () { + if (this.deployNewContracts !== undefined) { + // Deploy new contracts + await this.deployNewContracts(); + } + } + private async prepareVersion () { + const version = await getVersion(); + await this.checkVersion(version); + console.log(`Will mark updated version as ${version}`); + return version; + } + + private async writeTransactions (version: string) { await fs.writeFile( `data/transactions-${version}-${network.name}.json`, JSON.stringify( @@ -107,16 +130,8 @@ export abstract class Upgrader { 4 ) ); - - await this.submitter.submit(this.transactions); - - await Upgrader.verify(contractsToUpgrade); - - console.log("Done"); } - // Private - private static async verify (contractsToUpgrade: ContractToUpgrade[]) { if (process.env.NO_VERIFY) { console.log("Skip verification"); @@ -158,36 +173,44 @@ export abstract class Upgrader { private async deployNewImplementations () { const contractsToUpgrade: ContractToUpgrade[] = []; for (const contract of this.contractNamesToUpgrade) { - const contractFactory = + const updatedContract = + await this.deployNewImplementation(contract); + if (updatedContract !== undefined) { + contractsToUpgrade.push(updatedContract); + } + } + return contractsToUpgrade; + } + + private async deployNewImplementation (contract: string) { + const contractFactory = await getContractFactoryAndUpdateManifest(contract); - const proxyAddress = + const proxyAddress = (await this.instance.getContract(contract)).address; - console.log(`Prepare upgrade of ${contract}`); - const - currentImplementationAddress = await getImplementationAddress( - network.provider, - proxyAddress - ); - const newImplementationAddress = await upgrades.prepareUpgrade( - proxyAddress, - contractFactory, - { - "unsafeAllowLinkedLibraries": true, - "unsafeAllowRenames": true - } - ) as string; - if (newImplementationAddress !== currentImplementationAddress) { - contractsToUpgrade.push({ - proxyAddress, - "implementationAddress": newImplementationAddress, - "name": contract - }); - } else { - console.log(chalk.gray(`Contract ${contract} is up to date`)); + console.log(`Prepare upgrade of ${contract}`); + const + currentImplementationAddress = await getImplementationAddress( + network.provider, + proxyAddress + ); + const newImplementationAddress = await upgrades.prepareUpgrade( + proxyAddress, + contractFactory, + { + "unsafeAllowLinkedLibraries": true, + "unsafeAllowRenames": true } + ) as string; + if (newImplementationAddress !== currentImplementationAddress) { + return { + proxyAddress, + "implementationAddress": newImplementationAddress, + "name": contract + }; } - return contractsToUpgrade; + console.log(chalk.gray(`Contract ${contract} is up to date`)); + return undefined; } private async getNormalizedDeployedVersion () { diff --git a/src/verification.ts b/src/verification.ts index d2ddb6d..d036d55 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -5,6 +5,50 @@ import { import chalk from "chalk"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; +const processError = (error: unknown, contractName: string) => { + if (error instanceof Error) { + const alreadyVerifiedErrorLine = + "Contract source code already verified"; + if (error.toString().includes(alreadyVerifiedErrorLine)) { + const infoMessage = `${contractName} is already verified`; + console.log(chalk.grey(infoMessage)); + return; + } + const errorMessage = + `Contract ${contractName} was not verified on etherscan`; + console.log(chalk.red(errorMessage)); + console.log(error.toString()); + } else { + console.log( + "Unknown exception type:", + error + ); + } +}; + +const verificationAttempt = async ( + contractName: string, + contractAddress: string, + constructorArguments: object +) => { + try { + await run( + "verify:verify", + { + "address": contractAddress, + constructorArguments + } + ); + return true; + } catch (error) { + processError( + error, + contractName + ); + } + return false; +}; + export const verify = async ( contractName: string, contractAddress: string, @@ -17,34 +61,12 @@ export const verify = async ( return; } for (let retry = 0; retry <= 5; retry += 1) { - try { - await run( - "verify:verify", - { - "address": contractAddress, - constructorArguments - } - ); + if (await verificationAttempt( + contractName, + contractAddress, + constructorArguments + )) { break; - } catch (error) { - if (error instanceof Error) { - const alreadyVerifiedErrorLine = - "Contract source code already verified"; - if (error.toString().includes(alreadyVerifiedErrorLine)) { - const infoMessage = `${contractName} is already verified`; - console.log(chalk.grey(infoMessage)); - return; - } - const errorMessage = - `Contract ${contractName} was not verified on etherscan`; - console.log(chalk.red(errorMessage)); - console.log(error.toString()); - } else { - console.log( - "Unknown exception type:", - error - ); - } } } }; From 1f1bca39d88fa193d76ba0310949cea0f0f7d946 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 14 Sep 2023 18:51:13 +0300 Subject: [PATCH 16/44] Use consistent multiline comments --- .eslintrc.cjs | 1 - src/gnosis-safe.ts | 18 ++++++++---- src/multiSend.ts | 3 +- src/submitters/auto-submitter.ts | 48 ++++++++++++++++---------------- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d34b3ed..adf690e 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "multiline-comment-style": "warn", "no-await-in-loop": "warn", "no-console": "warn", "no-continue": "warn", diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 49febf7..574eb12 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -30,14 +30,17 @@ const defaultOptions = { // Max gas to use in the transaction "safeTxGas": "0", - // Gas costs not related to the transaction execution - // (signature check, refund payment...) + /* + * Gas costs not related to the transaction execution + * (signature check, refund payment...) + */ "baseGas": "0", // Gas price used for the refund calculation "gasPrice": "0", - /* Token address (hold by the Safe) + /* + * Token address (hold by the Safe) * to be used as a refund to the sender, * if `null` is Ether */ @@ -64,9 +67,12 @@ export const createMultiSendTransaction = async ( const options = { ...defaultOptions, ...{ - // Nonce of the Safe, - // Transaction cannot be executed until - // Safe's nonce is not equal to this nonce + + /* + * Nonce of the Safe, + * Transaction cannot be executed until + * Safe's nonce is not equal to this nonce + */ nonce } }; diff --git a/src/multiSend.ts b/src/multiSend.ts index f57eeee..1c41073 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -28,7 +28,8 @@ const getToBytes = (to: string) => { interface Transaction { - /* Operation as a uint8 with 0 for a call + /* + * Operation as a uint8 with 0 for a call * or 1 for a delegatecall (=> 1 byte) */ operation: 0 | 1, diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index bb46d3d..818fa46 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -47,30 +47,30 @@ export class AutoSubmitter extends Submitter { const schainHash = AutoSubmitter._getSchainHash(); /* - * TODO: after marionette has multiSend functionality - * query version and properly select a submitter - * based on it - * - * if (await this._versionFunctionExists()) { - * console.log("version() function was found." + - * " Use normal Marionette") - * submitter = new SafeImaMarionetteSubmitter( - * safeAddress, - * imaAbi, - * schainHash, - * mainnetChainId - * ) - * } else { - * console.log("No version() function was found." + - * " Use legacy Marionette") - * submitter = new SafeImaLegacyMarionetteSubmitter( - * safeAddress, - * imaAbi, - * schainHash, - * mainnetChainId - * ) - * } - */ + * TODO: after marionette has multiSend functionality + * query version and properly select a submitter + * based on it + * + * if (await this._versionFunctionExists()) { + * console.log("version() function was found." + + * " Use normal Marionette") + * submitter = new SafeImaMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } else { + * console.log("No version() function was found." + + * " Use legacy Marionette") + * submitter = new SafeImaLegacyMarionetteSubmitter( + * safeAddress, + * imaAbi, + * schainHash, + * mainnetChainId + * ) + * } + */ return new SafeImaLegacyMarionetteSubmitter( safeAddress, imaInstance, From bf9a9c11999b7e093ca8ee517cb866dde3ace55b Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Fri, 15 Sep 2023 19:41:55 +0300 Subject: [PATCH 17/44] Stop using await in loops --- .eslintrc.cjs | 1 - src/contractFactory.ts | 35 ++++++++++-- src/deploy.ts | 55 ++++++++++++++----- src/gnosis-safe.ts | 28 +++++----- src/submitters/eoa-submitter.ts | 26 +++++---- .../safe-ima-legacy-marionette-submitter.ts | 18 +++--- src/upgrader.ts | 28 ++++------ src/verification.ts | 35 ++++++++++-- 8 files changed, 149 insertions(+), 77 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index adf690e..6a4a664 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,6 @@ module.exports = { "never" ], - "no-await-in-loop": "warn", "no-console": "warn", "no-continue": "warn", "no-duplicate-imports": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts index 1ac3030..f7b27d0 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -21,19 +21,41 @@ const getSkaleManifest = async () => { return manifest as SkaleManifestData; }; +const loadBytesCodes = async (libraryNames: string[]) => { + const byteCodes = new Map(); + + (await Promise. + all(libraryNames.map((libraryName) => (async () => { + const {bytecode} = await artifacts.readArtifact(libraryName); + return [ + libraryName, + bytecode + ]; + })()))).forEach(([ + libraryName, + bytecode + ]) => { + byteCodes.set( + libraryName, + bytecode + ); + }); + return byteCodes; +}; + const updateManifest = async ( manifest: SkaleManifestData, libraries: Map, oldLibraries: {[k: string]: string} ) => { + const byteCodes = await loadBytesCodes(Array.from(libraries.keys())); for (const [ libraryName, libraryAddress ] of libraries.entries()) { - const {bytecode} = await artifacts.readArtifact(libraryName); manifest.libraries[libraryName] = { "address": libraryAddress, - "bytecodeHash": hashBytecode(bytecode) + "bytecodeHash": hashBytecode(byteCodes.get(libraryName) as string) }; } Object.assign( @@ -88,13 +110,14 @@ const getLibrariesToUpgrade = async ( ) => { const librariesToUpgrade = []; const oldLibraries: {[k: string]: string} = {}; - for (const libraryName of getLibrariesNames(linkReferences)) { - const {bytecode} = await artifacts.readArtifact(libraryName); + const librariesNames = getLibrariesNames(linkReferences); + const byteCodes = await loadBytesCodes(librariesNames); + for (const libraryName of librariesNames) { if (manifest.libraries[libraryName] === undefined) { librariesToUpgrade.push(libraryName); } else if ( - hashBytecode(bytecode) !== manifest.libraries[libraryName]. - bytecodeHash + hashBytecode(byteCodes.get(libraryName) as string) !== + manifest.libraries[libraryName].bytecodeHash ) { librariesToUpgrade.push(libraryName); } else { diff --git a/src/deploy.ts b/src/deploy.ts index f4df96d..72eccd1 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -8,22 +8,34 @@ interface LibraryArtifacts { [key: string]: unknown } -const _deployLibrary = async (libraryName: string) => { - const - Library = await ethers.getContractFactory(libraryName); - const library = await Library.deploy(); +const deployLibrary = async (libraryName: string, nonce: number) => { + const Library = await ethers.getContractFactory(libraryName); + const library = await Library.deploy({nonce}); await library.deployed(); return library.address; }; export const deployLibraries = async (libraryNames: string[]) => { + const [deployer] = await ethers.getSigners(); + const nonce = await deployer.getTransactionCount(); const libraries = new Map(); - for (const libraryName of libraryNames) { + + (await Promise.all(libraryNames.map((libraryName, index) => (async () => [ + libraryName, + await deployLibrary( + libraryName, + nonce + index + ) + ])()))).forEach(([ + libraryName, + libraryAddress + ]) => { libraries.set( libraryName, - await _deployLibrary(libraryName) + libraryAddress ); - } + }); + return libraries; }; @@ -101,16 +113,33 @@ const updateManifest = async (libraryArtifacts: LibraryArtifacts) => { const getLibraryArtifacts = async (libraries: Map) => { const libraryArtifacts: LibraryArtifacts = {}; - for (const [ - libraryName, - libraryAddress - ] of libraries.entries()) { + + const getLibraryArtifact = async ( + libraryName: string, + libraryAddress: string + ) => { const {bytecode} = await artifacts.readArtifact(libraryName); - libraryArtifacts[libraryName] = { + return { "address": libraryAddress, - "bytecodeHash": hashBytecode(bytecode) + "bytecodeHash": hashBytecode(bytecode), + libraryName + }; + }; + + for (const libraryArtifact of await Promise. + all(Array.from(libraries.entries()).map(([ + libraryName, + libraryAddress + ]) => getLibraryArtifact( + libraryName, + libraryAddress + )))) { + libraryArtifacts[libraryArtifact.libraryName] = { + "address": libraryArtifact.address, + "bytecodeHash": libraryArtifact.bytecodeHash }; } + return libraryArtifacts; }; diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 574eb12..c19cba6 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -124,20 +124,20 @@ const estimateSafeTransaction = async ( ) => { console.log("Estimate gas"); const safeService = await getSafeService(); - for (const transaction of safeTransactionData as MetaTransactionData[]) { - const estimateResponse = await safeService.estimateSafeTransaction( - safeAddress, - { - "to": transaction.to, - "value": transaction.value, - "data": transaction.data, - "operation": transaction.operation || 0 - } - ); - console.log(chalk.cyan(`Recommend to set gas limit to ${parseInt( - estimateResponse.safeTxGas, - 10 - )}`)); + const gasEstimations = await Promise. + all((safeTransactionData as MetaTransactionData[]). + map((transaction) => safeService.estimateSafeTransaction( + safeAddress, + { + "to": transaction.to, + "value": transaction.value, + "data": transaction.data, + "operation": transaction.operation || 0 + } + ))); + for (const estimateResponse of gasEstimations) { + console.log(chalk.cyan("Recommend to set gas limit" + + ` to ${estimateResponse.safeTxGas}`)); } console.log(chalk.green("Send transaction to gnosis safe")); }; diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 592eeaa..64ce210 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -8,17 +8,19 @@ export class EoaSubmitter extends Submitter { async submit (transactions: UnsignedTransaction[]) { EoaSubmitter._atomicityWarning(); const [deployer] = await ethers.getSigners(); - for (const transaction of transactions) { - console.log(`Send transaction via ${this.name}`); - const response = await deployer.sendTransaction({ - "to": transaction.to, - "value": transaction.value, - "data": transaction.data - }); - console.log("Waiting for a transaction" + - ` with nonce ${response.nonce}`); - await response.wait(); - console.log("The transaction was sent"); - } + const nonce = await deployer.getTransactionCount(); + console.log(`Send transaction via ${this.name}`); + const responses = + await Promise.all(transactions. + map((transaction, index) => deployer.sendTransaction({ + "to": transaction.to, + "value": transaction.value, + "data": transaction.data, + "nonce": nonce + index + }))); + + console.log("Waiting for transactions"); + await Promise.all(responses.map((response) => response.wait())); + console.log("The transactions were sent"); } } diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 6aaf5e4..7b8fa42 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -44,12 +44,9 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { if (transactions.length > 1) { SafeImaLegacyMarionetteSubmitter._atomicityWarning(); } - const transactionsToMarionette = []; - for (const transaction of transactions) { - transactionsToMarionette.push({ - "to": this.marionette.address, - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - "data": await this.marionette.encodeFunctionCall( + const transactionsToMarionette = + (await Promise.all(transactions. + map((transaction) => this.marionette.encodeFunctionCall( transaction.to ? transaction.to : ethers.constants.AddressZero, @@ -59,9 +56,12 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { transaction.data ? transaction.data : "0x" - ) as BytesLike - }); - } + ) as Promise)) + ).map((data) => ({ + data, + "to": this.marionette.address + })); + await super.submit(transactionsToMarionette); } } diff --git a/src/upgrader.ts b/src/upgrader.ts index 09f8609..873c4a8 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -30,6 +30,10 @@ interface Target { contractNamesToUpgrade: string[] } +const withoutUndefined = (array: Array) => array. + filter((element) => element !== undefined) as Array; + + export abstract class Upgrader { instance: Instance; @@ -137,13 +141,11 @@ export abstract class Upgrader { console.log("Skip verification"); } else { console.log("Start verification"); - for (const contract of contractsToUpgrade) { - await verify( - contract.name, - contract.implementationAddress, - [] - ); - } + await Promise.all(contractsToUpgrade.map((contract) => verify( + contract.name, + contract.implementationAddress, + [] + ))); } } @@ -171,15 +173,9 @@ export abstract class Upgrader { } private async deployNewImplementations () { - const contractsToUpgrade: ContractToUpgrade[] = []; - for (const contract of this.contractNamesToUpgrade) { - const updatedContract = - await this.deployNewImplementation(contract); - if (updatedContract !== undefined) { - contractsToUpgrade.push(updatedContract); - } - } - return contractsToUpgrade; + const contracts = await Promise.all(this.contractNamesToUpgrade. + map(this.deployNewImplementation)); + return withoutUndefined(contracts); } private async deployNewImplementation (contract: string) { diff --git a/src/verification.ts b/src/verification.ts index d036d55..5a79f03 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -49,6 +49,30 @@ const verificationAttempt = async ( return false; }; +interface VerificationTarget { + contractName: string; + contractAddress: string; + constructorArguments: object; +} + +const verifyWithRetry = async ( + verificationTarget: VerificationTarget, + attempts: number +) => { + if (attempts > 0) { + if (!await verificationAttempt( + verificationTarget.contractName, + verificationTarget.contractAddress, + verificationTarget.constructorArguments + )) { + await verifyWithRetry( + verificationTarget, + attempts - 1 + ); + } + } +}; + export const verify = async ( contractName: string, contractAddress: string, @@ -60,15 +84,14 @@ export const verify = async ( console.log(chalk.grey(errorMessage)); return; } - for (let retry = 0; retry <= 5; retry += 1) { - if (await verificationAttempt( + await verifyWithRetry( + { contractName, contractAddress, constructorArguments - )) { - break; - } - } + }, + 5 + ); }; export const verifyProxy = async ( From b647ec2a2ee69aa2c0a94b3fe0b12762059cc83f Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 13:02:38 +0300 Subject: [PATCH 18/44] Stop using continue --- .eslintrc.cjs | 3 +-- src/deploy.ts | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6a4a664..64e2825 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -17,6 +17,7 @@ module.exports = { "error", {"allowBlockStart": true} ], + "no-console": "off", "object-curly-spacing": "error", "one-var": [ "error", @@ -27,8 +28,6 @@ module.exports = { "never" ], - "no-console": "warn", - "no-continue": "warn", "no-duplicate-imports": "warn", "no-inline-comments": "warn", "no-magic-numbers": "warn", diff --git a/src/deploy.ts b/src/deploy.ts index 72eccd1..30daa83 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -47,17 +47,16 @@ const _linkBytecode = (artifact: Artifact, libraries: Map) => { fixups ] of Object.entries(fileReferences)) { const addr = libraries.get(libName); - if (addr === undefined) { - continue; - } - for (const fixup of fixups) { - bytecode = - bytecode.substr( - 0, - 2 + fixup.start * 2 - ) + - addr.substr(2) + - bytecode.substr(2 + (fixup.start + fixup.length) * 2); + if (addr !== undefined) { + for (const fixup of fixups) { + bytecode = + bytecode.substr( + 0, + 2 + fixup.start * 2 + ) + + addr.substr(2) + + bytecode.substr(2 + (fixup.start + fixup.length) * 2); + } } } } From 3fdc4d40956d00c8326aae3d8fd4f76322a5768b Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 13:04:27 +0300 Subject: [PATCH 19/44] Remove duplicate imports --- .eslintrc.cjs | 1 - src/submitters/types/marionette.ts | 4 ++-- src/upgrader.ts | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 64e2825..5755b5b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,7 +28,6 @@ module.exports = { "never" ], - "no-duplicate-imports": "warn", "no-inline-comments": "warn", "no-magic-numbers": "warn", "no-mixed-operators": "warn", diff --git a/src/submitters/types/marionette.ts b/src/submitters/types/marionette.ts index f8429a0..4cf00d4 100644 --- a/src/submitters/types/marionette.ts +++ b/src/submitters/types/marionette.ts @@ -1,5 +1,5 @@ -import {BigNumberish, BytesLike} from "ethers"; -import {ethers as RawEthers} from "ethers"; +import {BigNumberish, BytesLike, ethers as RawEthers} from "ethers"; + export const MARIONETTE_ADDRESS = "0xD2c0DeFACe000000000000000000000000000000"; diff --git a/src/upgrader.ts b/src/upgrader.ts index 873c4a8..db9799c 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,7 +1,6 @@ -import hre from "hardhat"; +import hre, {network, upgrades} from "hardhat"; import chalk from "chalk"; import {ProxyAdmin} from "../typechain-types"; -import {network, upgrades} from "hardhat"; import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {getVersion} from "./version"; import {promises as fs} from "fs"; From 144841c3ba7cf02763dff36627f899a3b7885c07 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 15:23:04 +0300 Subject: [PATCH 20/44] Stop using magic numbers --- .eslintrc.cjs | 2 - src/contractFactory.ts | 14 ++- src/deploy.ts | 49 +++++----- src/gnosis-safe.ts | 21 ++-- src/multiSend.ts | 98 ++++++++----------- src/submitters/auto-submitter.ts | 43 ++++---- .../safe-ima-legacy-marionette-submitter.ts | 6 +- .../safe-ima-marionette-submitter.ts | 3 +- src/submitters/safe-to-ima-submitter.ts | 3 +- src/submitters/submitter.ts | 3 +- src/upgrader.ts | 6 +- src/verification.ts | 9 +- 12 files changed, 130 insertions(+), 127 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5755b5b..0b27c52 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,8 +28,6 @@ module.exports = { "never" ], - "no-inline-comments": "warn", - "no-magic-numbers": "warn", "no-mixed-operators": "warn", "no-negated-condition": "warn", "no-shadow": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts index f7b27d0..b323989 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -62,12 +62,13 @@ const updateManifest = async ( libraries, oldLibraries ); + const indentation = 4; await fs.writeFile( await getManifestFile(), JSON.stringify( manifest, null, - 4 + indentation ) ); }; @@ -99,9 +100,14 @@ export const getContractFactoryAndUpdateManifest = async (contract: string) => { ); }; -const getLibrariesNames = - (linkReferences: LinkReferences) => Object.values(linkReferences). - map((libraryObject) => Object.keys(libraryObject)[0]); + +export const getLibrariesNames = (linkReferences: LinkReferences) => { + const libraryNames = []; + for (const libraryFile of Object.values(linkReferences)) { + libraryNames.push(...Object.keys(libraryFile)); + } + return libraryNames; +}; const getLibrariesToUpgrade = async ( diff --git a/src/deploy.ts b/src/deploy.ts index 30daa83..91fc8eb 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -2,7 +2,9 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; import {promises as fs} from "fs"; import {SkaleManifestData} from "./types/SkaleManifestData"; -import {Artifact, LinkReferences} from "hardhat/types"; +import {Artifact} from "hardhat/types"; +import {hexDataSlice, hexConcat} from "ethers/lib/utils"; +import {getLibrariesNames} from "./contractFactory"; interface LibraryArtifacts { [key: string]: unknown @@ -39,23 +41,32 @@ export const deployLibraries = async (libraryNames: string[]) => { return libraries; }; -const _linkBytecode = (artifact: Artifact, libraries: Map) => { +const firstByteIndex = 0; + +const linkBytecode = (artifact: Artifact, libraries: Map) => { let {bytecode} = artifact; for (const [, fileReferences] of Object.entries(artifact.linkReferences)) { for (const [ libName, fixups ] of Object.entries(fileReferences)) { - const addr = libraries.get(libName); - if (addr !== undefined) { + const libAddress = libraries.get(libName); + if (typeof libAddress !== "undefined") { for (const fixup of fixups) { - bytecode = - bytecode.substr( - 0, - 2 + fixup.start * 2 - ) + - addr.substr(2) + - bytecode.substr(2 + (fixup.start + fixup.length) * 2); + const bytecodeBefore = hexDataSlice( + bytecode, + firstByteIndex, + fixup.start + ); + const bytecodeAfter = hexDataSlice( + bytecode, + fixup.start + fixup.length + ); + bytecode = hexConcat([ + bytecodeBefore, + libAddress, + bytecodeAfter + ]); } } } @@ -69,7 +80,7 @@ export const getLinkedContractFactory = async ( ) => { const cArtifact = await artifacts.readArtifact(contractName); - const linkedBytecode = _linkBytecode( + const linkedBytecode = linkBytecode( cArtifact, libraries ); @@ -100,12 +111,13 @@ const updateManifest = async (libraryArtifacts: LibraryArtifacts) => { manifest.libraries ); } + const indentation = 4; await fs.writeFile( await getManifestFile(), JSON.stringify( manifest, null, - 4 + indentation ) ); }; @@ -142,22 +154,13 @@ const getLibraryArtifacts = async (libraries: Map) => { return libraryArtifacts; }; -const getLibraryNames = (linkReferences: LinkReferences) => { - const libraryNames = []; - for (const key of Object.keys(linkReferences)) { - const libraryName = Object.keys(linkReferences[key])[0]; - libraryNames.push(libraryName); - } - return libraryNames; -}; - export const getContractFactory = async (contract: string) => { const {linkReferences} = await artifacts.readArtifact(contract); if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); } - const libraryNames = getLibraryNames(linkReferences); + const libraryNames = getLibrariesNames(linkReferences); const libraries = await deployLibraries(libraryNames); const libraryArtifacts = await getLibraryArtifacts(libraries); diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index c19cba6..43360d4 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -5,24 +5,21 @@ import SafeApiKit from "@safe-global/api-kit"; import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; import { MetaTransactionData, + OperationType, SafeTransaction, SafeTransactionDataPartial } from "@safe-global/safe-core-sdk-types"; +import {getNetwork} from "@ethersproject/networks"; -enum Network { - MAINNET = 1, - GOERLI = 5, - GANACHE = 1337, - HARDHAT = 31337, -} - // Constants const URLS = { "safe_transaction": { - [Network.MAINNET]: "https://safe-transaction-mainnet.safe.global", - [Network.GOERLI]: "https://safe-transaction-goerli.safe.global" + [getNetwork("mainnet").chainId]: + "https://safe-transaction-mainnet.safe.global", + [getNetwork("goerli").chainId]: + "https://safe-transaction-goerli.safe.global" } }; @@ -129,10 +126,10 @@ const estimateSafeTransaction = async ( map((transaction) => safeService.estimateSafeTransaction( safeAddress, { - "to": transaction.to, - "value": transaction.value, "data": transaction.data, - "operation": transaction.operation || 0 + "operation": transaction.operation || OperationType.Call, + "to": transaction.to, + "value": transaction.value } ))); for (const estimateResponse of gasEstimations) { diff --git a/src/multiSend.ts b/src/multiSend.ts index 1c41073..54b41ca 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,30 +1,12 @@ -import {BigNumber} from "ethers"; - -const padWithZeros = ( - value: string, - targetLength: number -) => ("0".repeat(targetLength) + value).slice(-targetLength); - -const getOperationBytes = (operation: 0 | 1) => { - if (operation === 0) { - return "00"; - } else if (operation === 1) { - return "01"; - } - throw Error("Operation has an incorrect value"); -}; - -const getToBytes = (to: string) => { - let _to = to; - if (to.startsWith("0x")) { - _to = _to.slice(2); - } - _to = padWithZeros( - _to, - 20 * 2 - ); - return _to; -}; +import {OperationType} from "@safe-global/safe-core-sdk-types"; +import {BigNumberish, BytesLike} from "ethers"; +import { + hexConcat, + hexDataLength, + hexValue, + hexZeroPad, + hexlify +} from "ethers/lib/utils"; interface Transaction { @@ -32,47 +14,49 @@ interface Transaction { * Operation as a uint8 with 0 for a call * or 1 for a delegatecall (=> 1 byte) */ - operation: 0 | 1, + operation: OperationType, // To as a address (=> 20 bytes) to: string, // Value as a uint256 (=> 32 bytes) - value: BigNumber | number, + value: BigNumberish, // Data as bytes. - data: string + data: BytesLike } -export const encodeTransaction = (transaction: Transaction) => { - const _operation = getOperationBytes(transaction.operation); +const OPERATION_BYTES = 1; +const ADDRESS_BYTES = 20; +const UINT256_BYTES = 32; +const TO_BYTES = ADDRESS_BYTES; +const VALUE_BYTES = UINT256_BYTES; +const DATA_LENGTH_BYTES = UINT256_BYTES; - const _to = getToBytes(transaction.to); - - const _value = padWithZeros( - BigNumber.from(transaction.value).toHexString(). - slice(2), - 32 * 2 +export const encodeTransaction = (transaction: Transaction) => { + const operation = hexZeroPad( + hexValue(transaction.operation), + OPERATION_BYTES ); - - let _data = transaction.data; - if (transaction.data.startsWith("0x")) { - _data = _data.slice(2); - } - if (_data.length % 2 !== 0) { - _data = `0${_data}`; - } - - const _dataLength = padWithZeros( - (_data.length / 2).toString(16), - 32 * 2 + const to = hexZeroPad( + hexValue(transaction.to), + TO_BYTES + ); + const value = hexZeroPad( + hexValue(transaction.value), + VALUE_BYTES + ); + const data = hexlify(transaction.data); + const dataLength = hexZeroPad( + hexValue(hexDataLength(data)), + DATA_LENGTH_BYTES ); - return `0x${[ - _operation, - _to, - _value, - _dataLength, - _data - ].join("")}`; + return hexConcat([ + operation, + to, + value, + dataLength, + data + ]); }; diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 818fa46..5d79cfa 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -11,10 +11,27 @@ import { } from "./safe-ima-legacy-marionette-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; +import {EXIT_CODES} from "../exitCodes"; export class AutoSubmitter extends Submitter { name = "Auto Submitter"; + static marionetteInterface = [ + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ]; + async submit (transactions: Transaction[]) { console.log(`Submit via ${this.name}`); const submitter = await AutoSubmitter.getSubmitter(); @@ -91,7 +108,7 @@ export class AutoSubmitter extends Submitter { if (!process.env.IMA) { console.log(chalk.red("Set target IMA alias" + " to IMA environment variable")); - process.exit(1); + process.exit(EXIT_CODES.UNKNOWN_IMA); } const network = await skaleContracts.getNetworkByProvider(ethers.provider); @@ -103,7 +120,7 @@ export class AutoSubmitter extends Submitter { if (!process.env.SAFE_ADDRESS) { console.log(chalk.red("Set Gnosis Safe owner address" + " to SAFE_ADDRESS environment variable")); - process.exit(1); + process.exit(EXIT_CODES.UNKNOWN_SAFE_ADDRESS); } return process.env.SAFE_ADDRESS; } @@ -142,35 +159,23 @@ export class AutoSubmitter extends Submitter { private static async _versionFunctionExists () { const bytecode = await hre.ethers.provider.getCode(MARIONETTE_ADDRESS); + const hexPrefixLength = 2; + const selectorLength = 10; /* * If the bytecode doesn't include the function selector version() * is definitely not present */ if (!bytecode.includes(ethers.utils.id("version()").slice( - 2, - 10 + hexPrefixLength, + selectorLength ))) { return false; } const marionette = new ethers.Contract( MARIONETTE_ADDRESS, - [ - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], + AutoSubmitter.marionetteInterface, hre.ethers.provider ); diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 7b8fa42..29ca59d 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -41,9 +41,11 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { ); async submit (transactions: UnsignedTransaction[]): Promise { - if (transactions.length > 1) { + const singleTransaction = 1; + if (transactions.length > singleTransaction) { SafeImaLegacyMarionetteSubmitter._atomicityWarning(); } + const zeroValue = 0; const transactionsToMarionette = (await Promise.all(transactions. map((transaction) => this.marionette.encodeFunctionCall( @@ -52,7 +54,7 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { : ethers.constants.AddressZero, transaction.value ? transaction.value - : 0, + : zeroValue, transaction.data ? transaction.data : "0x" diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index 218404f..5f5b3e4 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -49,6 +49,7 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { async submit (transactions: UnsignedTransaction[]): Promise { const functionCalls = []; + const zeroValue = 0; for (const transaction of transactions) { functionCalls.push({ "receiver": transaction.to @@ -56,7 +57,7 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { : ethers.constants.AddressZero, "value": transaction.value ? transaction.value - : 0, + : zeroValue, "data": transaction.data ? transaction.data : "0x" diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 380d341..66d5f75 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -28,7 +28,8 @@ export class SafeToImaSubmitter extends SafeSubmitter { } async submit (transactions: UnsignedTransaction[]): Promise { - if (transactions.length > 1) { + const singleTransaction = 1; + if (transactions.length > singleTransaction) { SafeToImaSubmitter._atomicityWarning(); } const messageProxyForMainnet = await this._getMessageProxyForMainnet(); diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index 3ca3b9f..6de9e55 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -1,5 +1,6 @@ import {UnsignedTransaction} from "ethers"; import chalk from "chalk"; +import {EXIT_CODES} from "../exitCodes"; export abstract class Submitter { abstract submit(transactions: UnsignedTransaction[]): Promise; @@ -12,7 +13,7 @@ export abstract class Submitter { " of multiple transactions and will not be atomic")); console.log(chalk.red("If not atomic upgrade is OK" + " set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); - process.exit(1); + process.exit(EXIT_CODES.NOT_ATOMIC_UPGRADE); } else { console.log(chalk.yellow("Not atomic upgrade is performing")); } diff --git a/src/upgrader.ts b/src/upgrader.ts index db9799c..95115bc 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -11,6 +11,7 @@ import {Submitter} from "./submitters/submitter"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; import {getContractFactoryAndUpdateManifest} from "./contractFactory"; +import {EXIT_CODES} from "./exitCodes"; interface ContractToUpgrade { @@ -125,12 +126,13 @@ export abstract class Upgrader { } private async writeTransactions (version: string) { + const indentation = 4; await fs.writeFile( `data/transactions-${version}-${network.name}.json`, JSON.stringify( this.transactions, null, - 4 + indentation ) ); } @@ -227,7 +229,7 @@ export abstract class Upgrader { `This script can't upgrade version ${deployedVersion}` + ` to ${version}`; console.log(chalk.red(cannotUpgradeMessage)); - process.exit(1); + process.exit(EXIT_CODES.BAD_VERSION); } } else { const cannotCheckMessage = diff --git a/src/verification.ts b/src/verification.ts index 5a79f03..5d36721 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -5,6 +5,8 @@ import { import chalk from "chalk"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; +const RETRIES_AMOUNT = 5; + const processError = (error: unknown, contractName: string) => { if (error instanceof Error) { const alreadyVerifiedErrorLine = @@ -59,15 +61,16 @@ const verifyWithRetry = async ( verificationTarget: VerificationTarget, attempts: number ) => { - if (attempts > 0) { + if (attempts) { if (!await verificationAttempt( verificationTarget.contractName, verificationTarget.contractAddress, verificationTarget.constructorArguments )) { + const failedAttempts = 1; await verifyWithRetry( verificationTarget, - attempts - 1 + attempts - failedAttempts ); } } @@ -90,7 +93,7 @@ export const verify = async ( contractAddress, constructorArguments }, - 5 + RETRIES_AMOUNT ); }; From edb7f3766916f2b7a7ff81d7b4b7799e810f1715 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 16:31:11 +0300 Subject: [PATCH 21/44] Add exit codes --- .eslintrc.cjs | 1 - src/exitCodes.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/exitCodes.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0b27c52..3517640 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,7 +28,6 @@ module.exports = { "never" ], - "no-mixed-operators": "warn", "no-negated-condition": "warn", "no-shadow": "warn", "no-ternary": "warn", diff --git a/src/exitCodes.ts b/src/exitCodes.ts new file mode 100644 index 0000000..d669a26 --- /dev/null +++ b/src/exitCodes.ts @@ -0,0 +1,8 @@ +export enum EXIT_CODES { + SUCCESS, + BAD_VERSION, + NOT_ATOMIC_UPGRADE, + UNKNOWN_SAFE_ADDRESS, + UNKNOWN_IMA +} + From 23f7484d60357bea4590d8dd4582237b39988670 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 16:36:47 +0300 Subject: [PATCH 22/44] Remove negated conditions --- .eslintrc.cjs | 1 - src/contractFactory.ts | 6 ++--- src/submitters/auto-submitter.ts | 39 +++++++++++++++----------------- src/submitters/submitter.ts | 6 ++--- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3517640..3d2f234 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,7 +28,6 @@ module.exports = { "never" ], - "no-negated-condition": "warn", "no-shadow": "warn", "no-ternary": "warn", "no-undefined": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts index b323989..0d3c153 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -122,13 +122,13 @@ const getLibrariesToUpgrade = async ( if (manifest.libraries[libraryName] === undefined) { librariesToUpgrade.push(libraryName); } else if ( - hashBytecode(byteCodes.get(libraryName) as string) !== + hashBytecode(byteCodes.get(libraryName) as string) === manifest.libraries[libraryName].bytecodeHash ) { - librariesToUpgrade.push(libraryName); - } else { oldLibraries[libraryName] = manifest.libraries[libraryName].address; + } else { + librariesToUpgrade.push(libraryName); } } return { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 5d79cfa..96e772c 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -127,34 +127,31 @@ export class AutoSubmitter extends Submitter { private static _getSchainHash () { // Query Context to get schain hash - if (!process.env.SCHAIN_HASH) { - if (!process.env.SCHAIN_NAME) { - console.log(chalk.red("Set schain name" + - " to SCHAIN_NAME environment variable")); - console.log(chalk.red("or schain hash" + - " to SCHAIN_HASH environment variable")); - throw Error("Schain is not set"); - } else { - return ethers.utils.solidityKeccak256( - ["string"], - [process.env.SCHAIN_NAME] - ); - } - } else { + if (process.env.SCHAIN_HASH) { return process.env.SCHAIN_HASH; } + if (process.env.SCHAIN_NAME) { + return ethers.utils.solidityKeccak256( + ["string"], + [process.env.SCHAIN_NAME] + ); + } + console.log(chalk.red("Set schain name" + + " to SCHAIN_NAME environment variable")); + console.log(chalk.red("or schain hash" + + " to SCHAIN_HASH environment variable")); + throw Error("Schain is not set"); } private static _getMainnetChainId () { - if (!process.env.MAINNET_CHAIN_ID) { - console.log(chalk.red("Set chainId of mainnet" + - " to MAINNET_CHAIN_ID environment variable")); - console.log(chalk.red("Use 1 for Ethereum mainnet" + - " or 5 for Goerli")); - throw Error("Mainnet chainId is not set"); - } else { + if (process.env.MAINNET_CHAIN_ID) { return Number.parseInt(process.env.MAINNET_CHAIN_ID); } + console.log(chalk.red("Set chainId of mainnet" + + " to MAINNET_CHAIN_ID environment variable")); + console.log(chalk.red("Use 1 for Ethereum mainnet" + + " or 5 for Goerli")); + throw Error("Mainnet chainId is not set"); } private static async _versionFunctionExists () { diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index 6de9e55..c48bbe4 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -8,14 +8,14 @@ export abstract class Submitter { // Protected protected static _atomicityWarning () { - if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) { + if (process.env.ALLOW_NOT_ATOMIC_UPGRADE) { + console.log(chalk.yellow("Not atomic upgrade is performing")); + } else { console.log(chalk.red("The upgrade will consist" + " of multiple transactions and will not be atomic")); console.log(chalk.red("If not atomic upgrade is OK" + " set ALLOW_NOT_ATOMIC_UPGRADE environment variable")); process.exit(EXIT_CODES.NOT_ATOMIC_UPGRADE); - } else { - console.log(chalk.yellow("Not atomic upgrade is performing")); } } } From 6fd5b75fff2f3a4060a20b856ef627c62ca88e27 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 16:57:34 +0300 Subject: [PATCH 23/44] Stop using ternary operator --- .eslintrc.cjs | 5 +++-- src/gnosis-safe.ts | 12 +++--------- .../safe-ima-legacy-marionette-submitter.ts | 12 +++--------- src/submitters/safe-ima-marionette-submitter.ts | 12 +++--------- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3d2f234..0c0ed4c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -13,11 +13,14 @@ module.exports = { "plugins": ["@typescript-eslint"], "root": true, "rules": { + "@typescript-eslint/no-shadow": "error", "lines-around-comment": [ "error", {"allowBlockStart": true} ], "no-console": "off", + // Replaced with @typescript-eslint/no-shadow + "no-shadow": "off", "object-curly-spacing": "error", "one-var": [ "error", @@ -28,8 +31,6 @@ module.exports = { "never" ], - "no-shadow": "warn", - "no-ternary": "warn", "no-undefined": "warn", "no-underscore-dangle": "warn", "no-use-before-define": "warn", diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 43360d4..52fa179 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -100,15 +100,9 @@ const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ - "to": transaction.to - ? transaction.to - : ethers.constants.AddressZero, - "data": transaction.data - ? transaction.data.toString() - : "0x", - "value": transaction.value - ? transaction.value.toString() - : "0", + "to": transaction.to ?? ethers.constants.AddressZero, + "data": transaction.data?.toString() ?? "0x", + "value": transaction.value?.toString() ?? "0", "operation": 0 }); } diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 29ca59d..46f3a8a 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -49,15 +49,9 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { const transactionsToMarionette = (await Promise.all(transactions. map((transaction) => this.marionette.encodeFunctionCall( - transaction.to - ? transaction.to - : ethers.constants.AddressZero, - transaction.value - ? transaction.value - : zeroValue, - transaction.data - ? transaction.data - : "0x" + transaction.to ?? ethers.constants.AddressZero, + transaction.value ?? zeroValue, + transaction.data ?? "0x" ) as Promise)) ).map((data) => ({ data, diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index 5f5b3e4..13b70d7 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -52,15 +52,9 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { const zeroValue = 0; for (const transaction of transactions) { functionCalls.push({ - "receiver": transaction.to - ? transaction.to - : ethers.constants.AddressZero, - "value": transaction.value - ? transaction.value - : zeroValue, - "data": transaction.data - ? transaction.data - : "0x" + "data": transaction.data ?? "0x", + "receiver": transaction.to ?? ethers.constants.AddressZero, + "value": transaction.value ?? zeroValue }); } await super.submit([ From 465669caef57c876d77ffe87a2e9e855edbfbb5b Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:28:00 +0300 Subject: [PATCH 24/44] Stop using undefined value --- .eslintrc.cjs | 1 - src/contractFactory.ts | 4 ++-- src/deploy.ts | 2 +- src/submitters/safe-to-ima-submitter.ts | 2 +- src/upgrader.ts | 21 ++++++++++----------- src/version.ts | 2 +- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0c0ed4c..22befe7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,7 +31,6 @@ module.exports = { "never" ], - "no-undefined": "warn", "no-underscore-dangle": "warn", "no-use-before-define": "warn", "no-warning-comments": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts index 0d3c153..147e0bc 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -15,7 +15,7 @@ const getSkaleManifest = async () => { await getManifestFile(), "utf-8" )); - if (manifest.libraries === undefined) { + if (typeof manifest.libraries === "undefined") { manifest.libraries = {}; } return manifest as SkaleManifestData; @@ -119,7 +119,7 @@ const getLibrariesToUpgrade = async ( const librariesNames = getLibrariesNames(linkReferences); const byteCodes = await loadBytesCodes(librariesNames); for (const libraryName of librariesNames) { - if (manifest.libraries[libraryName] === undefined) { + if (typeof manifest.libraries[libraryName] === "undefined") { librariesToUpgrade.push(libraryName); } else if ( hashBytecode(byteCodes.get(libraryName) as string) === diff --git a/src/deploy.ts b/src/deploy.ts index 91fc8eb..af36a56 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -100,7 +100,7 @@ const updateManifest = async (libraryArtifacts: LibraryArtifacts) => { await getManifestFile(), "utf-8" )) as SkaleManifestData; - if (manifest.libraries === undefined) { + if (typeof manifest.libraries === "undefined") { Object.assign( manifest, {"libraries": libraryArtifacts} diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 66d5f75..73e4ef0 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -48,7 +48,7 @@ export class SafeToImaSubmitter extends SafeSubmitter { } private async _getMessageProxyForMainnet () { - if (this._messageProxyForMainnet === undefined) { + if (typeof this._messageProxyForMainnet === "undefined") { this._messageProxyForMainnet = await this.imaInstance.getContract("MessageProxyForMainnet"); } diff --git a/src/upgrader.ts b/src/upgrader.ts index 95115bc..dea962c 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -30,8 +30,8 @@ interface Target { contractNamesToUpgrade: string[] } -const withoutUndefined = (array: Array) => array. - filter((element) => element !== undefined) as Array; +const withoutNull = (array: Array) => array. + filter((element) => element !== null) as Array; export abstract class Upgrader { @@ -106,13 +106,13 @@ export abstract class Upgrader { // Private private async callInitialize () { - if (this.initialize !== undefined) { + if (typeof this.initialize !== "undefined") { await this.initialize(); } } private async callDeployNewContracts () { - if (this.deployNewContracts !== undefined) { + if (typeof this.deployNewContracts !== "undefined") { // Deploy new contracts await this.deployNewContracts(); } @@ -176,7 +176,7 @@ export abstract class Upgrader { private async deployNewImplementations () { const contracts = await Promise.all(this.contractNamesToUpgrade. map(this.deployNewImplementation)); - return withoutUndefined(contracts); + return withoutNull(contracts); } private async deployNewImplementation (contract: string) { @@ -186,11 +186,10 @@ export abstract class Upgrader { (await this.instance.getContract(contract)).address; console.log(`Prepare upgrade of ${contract}`); - const - currentImplementationAddress = await getImplementationAddress( - network.provider, - proxyAddress - ); + const currentImplementationAddress = await getImplementationAddress( + network.provider, + proxyAddress + ); const newImplementationAddress = await upgrades.prepareUpgrade( proxyAddress, contractFactory, @@ -207,7 +206,7 @@ export abstract class Upgrader { }; } console.log(chalk.gray(`Contract ${contract} is up to date`)); - return undefined; + return null; } private async getNormalizedDeployedVersion () { diff --git a/src/version.ts b/src/version.ts index bb03bd2..cc23402 100644 --- a/src/version.ts +++ b/src/version.ts @@ -8,7 +8,7 @@ const exec = util.promisify(asyncExec); class VersionNotFound extends Error {} const getVersionFilename = async (folder?: string): Promise => { - if (folder === undefined) { + if (typeof folder === "undefined") { return getVersionFilename(( await exec("git rev-parse --show-toplevel") ).stdout.trim()); From 4f9982bf69a9977d79230c85e313a054221c9f0e Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:30:42 +0300 Subject: [PATCH 25/44] Stop using underscore dangle --- .eslintrc.cjs | 1 - src/submitters/auto-submitter.ts | 16 ++++++++-------- src/submitters/eoa-submitter.ts | 2 +- .../safe-ima-legacy-marionette-submitter.ts | 2 +- src/submitters/safe-to-ima-submitter.ts | 14 +++++++------- src/submitters/submitter.ts | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 22befe7..1f5f80c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,7 +31,6 @@ module.exports = { "never" ], - "no-underscore-dangle": "warn", "no-use-before-define": "warn", "no-warning-comments": "warn", "prefer-destructuring": "warn", diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 96e772c..ad46a84 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -58,10 +58,10 @@ export class AutoSubmitter extends Submitter { ethers.utils.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); - const imaInstance = await AutoSubmitter._getImaInstance(); - const mainnetChainId = AutoSubmitter._getMainnetChainId(); - const safeAddress = AutoSubmitter._getSafeAddress(); - const schainHash = AutoSubmitter._getSchainHash(); + const imaInstance = await AutoSubmitter.getImaInstance(); + const mainnetChainId = AutoSubmitter.getMainnetChainId(); + const safeAddress = AutoSubmitter.getSafeAddress(); + const schainHash = AutoSubmitter.getSchainHash(); /* * TODO: after marionette has multiSend functionality @@ -104,7 +104,7 @@ export class AutoSubmitter extends Submitter { return new SafeSubmitter(owner); } - private static async _getImaInstance () { + private static async getImaInstance () { if (!process.env.IMA) { console.log(chalk.red("Set target IMA alias" + " to IMA environment variable")); @@ -116,7 +116,7 @@ export class AutoSubmitter extends Submitter { return await ima.getInstance(process.env.IMA); } - private static _getSafeAddress () { + private static getSafeAddress () { if (!process.env.SAFE_ADDRESS) { console.log(chalk.red("Set Gnosis Safe owner address" + " to SAFE_ADDRESS environment variable")); @@ -125,7 +125,7 @@ export class AutoSubmitter extends Submitter { return process.env.SAFE_ADDRESS; } - private static _getSchainHash () { + private static getSchainHash () { // Query Context to get schain hash if (process.env.SCHAIN_HASH) { return process.env.SCHAIN_HASH; @@ -143,7 +143,7 @@ export class AutoSubmitter extends Submitter { throw Error("Schain is not set"); } - private static _getMainnetChainId () { + private static getMainnetChainId () { if (process.env.MAINNET_CHAIN_ID) { return Number.parseInt(process.env.MAINNET_CHAIN_ID); } diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 64ce210..bb33216 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -6,7 +6,7 @@ export class EoaSubmitter extends Submitter { name = "EOA Submitter"; async submit (transactions: UnsignedTransaction[]) { - EoaSubmitter._atomicityWarning(); + EoaSubmitter.atomicityWarning(); const [deployer] = await ethers.getSigners(); const nonce = await deployer.getTransactionCount(); console.log(`Send transaction via ${this.name}`); diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 46f3a8a..07da91f 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -43,7 +43,7 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { async submit (transactions: UnsignedTransaction[]): Promise { const singleTransaction = 1; if (transactions.length > singleTransaction) { - SafeImaLegacyMarionetteSubmitter._atomicityWarning(); + SafeImaLegacyMarionetteSubmitter.atomicityWarning(); } const zeroValue = 0; const transactionsToMarionette = diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 73e4ef0..33db336 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -12,7 +12,7 @@ export class SafeToImaSubmitter extends SafeSubmitter { targetSchainHash: BytesLike; - private _messageProxyForMainnet: Contract | undefined; + private messageProxyForMainnet: Contract | undefined; constructor ( safeAddress: string, @@ -30,9 +30,9 @@ export class SafeToImaSubmitter extends SafeSubmitter { async submit (transactions: UnsignedTransaction[]): Promise { const singleTransaction = 1; if (transactions.length > singleTransaction) { - SafeToImaSubmitter._atomicityWarning(); + SafeToImaSubmitter.atomicityWarning(); } - const messageProxyForMainnet = await this._getMessageProxyForMainnet(); + const messageProxyForMainnet = await this.getMessageProxyForMainnet(); const transactionsToIma = transactions.map((transaction) => ({ "to": messageProxyForMainnet.address, "data": messageProxyForMainnet.interface.encodeFunctionData( @@ -47,11 +47,11 @@ export class SafeToImaSubmitter extends SafeSubmitter { await super.submit(transactionsToIma); } - private async _getMessageProxyForMainnet () { - if (typeof this._messageProxyForMainnet === "undefined") { - this._messageProxyForMainnet = + private async getMessageProxyForMainnet () { + if (typeof this.messageProxyForMainnet === "undefined") { + this.messageProxyForMainnet = await this.imaInstance.getContract("MessageProxyForMainnet"); } - return this._messageProxyForMainnet; + return this.messageProxyForMainnet; } } diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index c48bbe4..e5eb10d 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -7,7 +7,7 @@ export abstract class Submitter { // Protected - protected static _atomicityWarning () { + protected static atomicityWarning () { if (process.env.ALLOW_NOT_ATOMIC_UPGRADE) { console.log(chalk.yellow("Not atomic upgrade is performing")); } else { From 36832264e7da5843f8d685949f8754b372655771 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:34:20 +0300 Subject: [PATCH 26/44] Stop using functions before define --- .eslintrc.cjs | 1 - src/contractFactory.ts | 56 ++++++++-------- src/gnosis-safe.ts | 146 ++++++++++++++++++++--------------------- 3 files changed, 100 insertions(+), 103 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1f5f80c..742623f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,7 +31,6 @@ module.exports = { "never" ], - "no-use-before-define": "warn", "no-warning-comments": "warn", "prefer-destructuring": "warn", "radix": "warn", diff --git a/src/contractFactory.ts b/src/contractFactory.ts index 147e0bc..c7fffbb 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -73,34 +73,6 @@ const updateManifest = async ( ); }; -export const getContractFactoryAndUpdateManifest = async (contract: string) => { - const {linkReferences} = await artifacts.readArtifact(contract); - if (!Object.keys(linkReferences).length) { - return await ethers.getContractFactory(contract); - } - - const manifest = await getSkaleManifest(); - - const { - librariesToUpgrade, - oldLibraries - } = await getLibrariesToUpgrade( - manifest, - linkReferences - ); - const libraries = await deployLibraries(librariesToUpgrade); - await updateManifest( - manifest, - libraries, - oldLibraries - ); - return await getLinkedContractFactory( - contract, - libraries - ); -}; - - export const getLibrariesNames = (linkReferences: LinkReferences) => { const libraryNames = []; for (const libraryFile of Object.values(linkReferences)) { @@ -109,7 +81,6 @@ export const getLibrariesNames = (linkReferences: LinkReferences) => { return libraryNames; }; - const getLibrariesToUpgrade = async ( manifest: SkaleManifestData, linkReferences: LinkReferences @@ -136,3 +107,30 @@ const getLibrariesToUpgrade = async ( oldLibraries }; }; + +export const getContractFactoryAndUpdateManifest = async (contract: string) => { + const {linkReferences} = await artifacts.readArtifact(contract); + if (!Object.keys(linkReferences).length) { + return await ethers.getContractFactory(contract); + } + + const manifest = await getSkaleManifest(); + + const { + librariesToUpgrade, + oldLibraries + } = await getLibrariesToUpgrade( + manifest, + linkReferences + ); + const libraries = await deployLibraries(librariesToUpgrade); + await updateManifest( + manifest, + libraries, + oldLibraries + ); + return await getLinkedContractFactory( + contract, + libraries + ); +}; diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 52fa179..ffd43e6 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -47,53 +47,6 @@ const defaultOptions = { "refundReceiver": ethers.constants.AddressZero }; -// Public functions - -export const createMultiSendTransaction = async ( - safeAddress: string, - transactions: UnsignedTransaction[] -) => { - const safeTransactionData = getSafeTransactionData(transactions); - const safeService = await getSafeService(); - const nonce = await safeService.getNextNonce(safeAddress); - console.log( - "Will send tx to Gnosis with nonce", - nonce - ); - - const options = { - ...defaultOptions, - ...{ - - /* - * Nonce of the Safe, - * Transaction cannot be executed until - * Safe's nonce is not equal to this nonce - */ - nonce - } - }; - const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ - ethAdapter, - safeAddress - }); - const safeTransaction = await safeSdk.createTransaction({ - safeTransactionData, - options - }); - - await estimateSafeTransaction( - safeAddress, - safeTransactionData - ); - - await proposeTransaction( - safeAddress, - safeTransaction - ); -}; - // Private functions const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { @@ -109,6 +62,37 @@ const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { return safeTransactionData; }; +const getEthAdapter = async (): Promise => { + const + [safeOwner] = await ethers.getSigners(); + const ethAdapter = new EthersAdapter({ + ethers, + "signerOrProvider": safeOwner + }); + return ethAdapter; +}; + +const getSafeTransactionUrl = (chainId: number) => { + if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { + return URLS.safe_transaction[ + chainId as keyof typeof URLS.safe_transaction + ]; + } + throw Error("Can't get safe-transaction url" + + ` at network with chainId = ${chainId}`); +}; + +const getSafeService = async () => { + const + {chainId} = await ethers.provider.getNetwork(); + const ethAdapter: EthersAdapter = await getEthAdapter(); + const safeService = new SafeApiKit({ + "txServiceUrl": getSafeTransactionUrl(chainId), + ethAdapter + }); + return safeService; +}; + const estimateSafeTransaction = async ( safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[] @@ -154,33 +138,49 @@ const proposeTransaction = async ( }); }; -const getEthAdapter = async (): Promise => { - const - [safeOwner] = await ethers.getSigners(); - const ethAdapter = new EthersAdapter({ - ethers, - "signerOrProvider": safeOwner - }); - return ethAdapter; -}; +// Public functions -const getSafeService = async () => { - const - {chainId} = await ethers.provider.getNetwork(); - const ethAdapter: EthersAdapter = await getEthAdapter(); - const safeService = new SafeApiKit({ - "txServiceUrl": getSafeTransactionUrl(chainId), - ethAdapter +export const createMultiSendTransaction = async ( + safeAddress: string, + transactions: UnsignedTransaction[] +) => { + const safeTransactionData = getSafeTransactionData(transactions); + const safeService = await getSafeService(); + const nonce = await safeService.getNextNonce(safeAddress); + console.log( + "Will send tx to Gnosis with nonce", + nonce + ); + + const options = { + ...defaultOptions, + ...{ + + /* + * Nonce of the Safe, + * Transaction cannot be executed until + * Safe's nonce is not equal to this nonce + */ + nonce + } + }; + const ethAdapter = await getEthAdapter(); + const safeSdk = await Safe.create({ + ethAdapter, + safeAddress + }); + const safeTransaction = await safeSdk.createTransaction({ + safeTransactionData, + options }); - return safeService; -}; -const getSafeTransactionUrl = (chainId: number) => { - if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { - return URLS.safe_transaction[ - chainId as keyof typeof URLS.safe_transaction - ]; - } - throw Error("Can't get safe-transaction url" + - ` at network with chainId = ${chainId}`); + await estimateSafeTransaction( + safeAddress, + safeTransactionData + ); + + await proposeTransaction( + safeAddress, + safeTransaction + ); }; From 88ef07f740b6d162fd0c19ae37bb803e046b100a Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:40:56 +0300 Subject: [PATCH 27/44] Set radix --- .eslintrc.cjs | 4 +--- src/submitters/auto-submitter.ts | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 742623f..133f2fb 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -21,6 +21,7 @@ module.exports = { "no-console": "off", // Replaced with @typescript-eslint/no-shadow "no-shadow": "off", + "no-warning-comments": "warn", "object-curly-spacing": "error", "one-var": [ "error", @@ -31,9 +32,6 @@ module.exports = { "never" ], - "no-warning-comments": "warn", - "prefer-destructuring": "warn", - "radix": "warn", "sort-imports": "warn", "sort-keys": "warn" } diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index ad46a84..f527875 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -144,8 +144,12 @@ export class AutoSubmitter extends Submitter { } private static getMainnetChainId () { + const CHAIN_ID_RADIX = 10; if (process.env.MAINNET_CHAIN_ID) { - return Number.parseInt(process.env.MAINNET_CHAIN_ID); + return Number.parseInt( + process.env.MAINNET_CHAIN_ID, + CHAIN_ID_RADIX + ); } console.log(chalk.red("Set chainId of mainnet" + " to MAINNET_CHAIN_ID environment variable")); From 22240bf94f22c7f9c6f031a319c5eeb64418f777 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:50:04 +0300 Subject: [PATCH 28/44] Sort imports --- .eslintrc.cjs | 1 - hardhat.config.ts | 3 ++- src/contractFactory.ts | 8 ++++---- src/deploy.ts | 7 ++++--- src/gnosis-safe.ts | 10 +++++----- src/multiSend.ts | 3 ++- src/submitters/auto-submitter.ts | 17 +++++++++-------- src/submitters/eoa-submitter.ts | 5 +++-- .../safe-ima-legacy-marionette-submitter.ts | 5 +++-- .../safe-ima-marionette-submitter.ts | 5 +++-- src/submitters/safe-submitter.ts | 5 +++-- src/submitters/safe-to-ima-submitter.ts | 3 ++- src/submitters/submitter.ts | 3 ++- src/upgrader.ts | 18 +++++++++--------- src/version.ts | 2 +- 15 files changed, 52 insertions(+), 43 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 133f2fb..05fdc8f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -32,7 +32,6 @@ module.exports = { "never" ], - "sort-imports": "warn", "sort-keys": "warn" } }; diff --git a/hardhat.config.ts b/hardhat.config.ts index 9db4014..2bad9de 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,7 +1,8 @@ -import {HardhatUserConfig} from "hardhat/config"; import "@typechain/hardhat"; import "@nomiclabs/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; +import {HardhatUserConfig} from "hardhat/config"; + const coreArtifacts = "node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json"; diff --git a/src/contractFactory.ts b/src/contractFactory.ts index c7fffbb..90ca4f5 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -1,13 +1,13 @@ import {artifacts, ethers} from "hardhat"; -import {promises as fs} from "fs"; -import {hashBytecode} from "@openzeppelin/upgrades-core"; -import {LinkReferences} from "hardhat/types"; -import {SkaleManifestData} from "./types/SkaleManifestData"; import { deployLibraries, getLinkedContractFactory, getManifestFile } from "./deploy"; +import {LinkReferences} from "hardhat/types"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {promises as fs} from "fs"; +import {hashBytecode} from "@openzeppelin/upgrades-core"; const getSkaleManifest = async () => { diff --git a/src/deploy.ts b/src/deploy.ts index af36a56..21ac93e 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,11 +1,12 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; -import {promises as fs} from "fs"; -import {SkaleManifestData} from "./types/SkaleManifestData"; +import {hexConcat, hexDataSlice} from "ethers/lib/utils"; import {Artifact} from "hardhat/types"; -import {hexDataSlice, hexConcat} from "ethers/lib/utils"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {promises as fs} from "fs"; import {getLibrariesNames} from "./contractFactory"; + interface LibraryArtifacts { [key: string]: unknown } diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index ffd43e6..a8d13cd 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -1,14 +1,14 @@ -import chalk from "chalk"; -import {ethers} from "hardhat"; -import {UnsignedTransaction} from "ethers"; -import SafeApiKit from "@safe-global/api-kit"; -import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; import { MetaTransactionData, OperationType, SafeTransaction, SafeTransactionDataPartial } from "@safe-global/safe-core-sdk-types"; +import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; +import SafeApiKit from "@safe-global/api-kit"; +import {UnsignedTransaction} from "ethers"; +import chalk from "chalk"; +import {ethers} from "hardhat"; import {getNetwork} from "@ethersproject/networks"; diff --git a/src/multiSend.ts b/src/multiSend.ts index 54b41ca..9a04e71 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,4 +1,3 @@ -import {OperationType} from "@safe-global/safe-core-sdk-types"; import {BigNumberish, BytesLike} from "ethers"; import { hexConcat, @@ -7,6 +6,8 @@ import { hexZeroPad, hexlify } from "ethers/lib/utils"; +import {OperationType} from "@safe-global/safe-core-sdk-types"; + interface Transaction { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index f527875..fb6ff32 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -1,17 +1,18 @@ -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; -import {Transaction} from "ethers"; -import {ProxyAdmin} from "../../typechain-types"; -import {Submitter} from "./submitter"; import hre, {ethers} from "hardhat"; +import {EXIT_CODES} from "../exitCodes"; import {EoaSubmitter} from "./eoa-submitter"; -import {SafeSubmitter} from "./safe-submitter"; -import chalk from "chalk"; +import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {ProxyAdmin} from "../../typechain-types"; import { SafeImaLegacyMarionetteSubmitter } from "./safe-ima-legacy-marionette-submitter"; -import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {SafeSubmitter} from "./safe-submitter"; +import {Submitter} from "./submitter"; +import {Transaction} from "ethers"; +import chalk from "chalk"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; -import {EXIT_CODES} from "../exitCodes"; + export class AutoSubmitter extends Submitter { name = "Auto Submitter"; diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index bb33216..117d997 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -1,6 +1,7 @@ -import {ethers} from "hardhat"; -import {UnsignedTransaction} from "ethers"; import {Submitter} from "./submitter"; +import {UnsignedTransaction} from "ethers"; +import {ethers} from "hardhat"; + export class EoaSubmitter extends Submitter { name = "EOA Submitter"; diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 07da91f..3cd4758 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -1,7 +1,8 @@ import {BytesLike, UnsignedTransaction} from "ethers"; -import {ethers} from "hardhat"; -import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; +import {ethers} from "hardhat"; + export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index 13b70d7..fd076c1 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -1,7 +1,8 @@ +import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; import {UnsignedTransaction} from "ethers"; import {ethers} from "hardhat"; -import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; -import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; + export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( diff --git a/src/submitters/safe-submitter.ts b/src/submitters/safe-submitter.ts index 67f41c3..7ecc3d9 100644 --- a/src/submitters/safe-submitter.ts +++ b/src/submitters/safe-submitter.ts @@ -1,7 +1,8 @@ +import {Submitter} from "./submitter"; import {UnsignedTransaction} from "ethers"; -import {ethers} from "hardhat"; import {createMultiSendTransaction} from "../gnosis-safe"; -import {Submitter} from "./submitter"; +import {ethers} from "hardhat"; + export class SafeSubmitter extends Submitter { safeAddress: string; diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 33db336..5417f0f 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -1,6 +1,7 @@ import {BytesLike, Contract, UnsignedTransaction} from "ethers"; -import {SafeSubmitter} from "./safe-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {SafeSubmitter} from "./safe-submitter"; + interface Network { targetSchainHash: BytesLike, diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index e5eb10d..25bb29b 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -1,6 +1,7 @@ +import {EXIT_CODES} from "../exitCodes"; import {UnsignedTransaction} from "ethers"; import chalk from "chalk"; -import {EXIT_CODES} from "../exitCodes"; + export abstract class Submitter { abstract submit(transactions: UnsignedTransaction[]): Promise; diff --git a/src/upgrader.ts b/src/upgrader.ts index dea962c..083dd7e 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,17 +1,17 @@ import hre, {network, upgrades} from "hardhat"; -import chalk from "chalk"; +import {AutoSubmitter} from "./submitters/auto-submitter"; +import {EXIT_CODES} from "./exitCodes"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; import {ProxyAdmin} from "../typechain-types"; -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; -import {getVersion} from "./version"; -import {promises as fs} from "fs"; +import {Submitter} from "./submitters/submitter"; import {UnsignedTransaction} from "ethers"; +import chalk from "chalk"; +import {promises as fs} from "fs"; +import {getContractFactoryAndUpdateManifest} from "./contractFactory"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; +import {getVersion} from "./version"; import {verify} from "./verification"; -import {Submitter} from "./submitters/submitter"; -import {AutoSubmitter} from "./submitters/auto-submitter"; -import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; -import {getContractFactoryAndUpdateManifest} from "./contractFactory"; -import {EXIT_CODES} from "./exitCodes"; interface ContractToUpgrade { diff --git a/src/version.ts b/src/version.ts index cc23402..455a167 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,5 +1,5 @@ -import {exec as asyncExec} from "child_process"; import {existsSync, promises as fs} from "fs"; +import {exec as asyncExec} from "child_process"; import util from "util"; From 97843665cfb7d7776bac22def71b25c67e5c96a1 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 19:19:27 +0300 Subject: [PATCH 29/44] Sort keys --- .eslintrc.cjs | 4 +--- hardhat.config.ts | 4 ++-- src/gnosis-safe.ts | 21 ++++++++++--------- src/submitters/eoa-submitter.ts | 6 +++--- .../safe-ima-marionette-submitter.ts | 5 +++-- src/submitters/safe-to-ima-submitter.ts | 4 ++-- src/upgrader.ts | 8 +++---- src/verification.ts | 4 ++-- src/version.ts | 4 ++-- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 05fdc8f..e511fb6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -30,8 +30,6 @@ module.exports = { "padded-blocks": [ "error", "never" - ], - - "sort-keys": "warn" + ] } }; diff --git a/hardhat.config.ts b/hardhat.config.ts index 2bad9de..15489b4 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -9,8 +9,8 @@ const coreArtifacts = const config: HardhatUserConfig = { "typechain": { - "target": "ethers-v5", - "externalArtifacts": [coreArtifacts] + "externalArtifacts": [coreArtifacts], + "target": "ethers-v5" } }; diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index a8d13cd..2b96ec4 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -24,8 +24,6 @@ const URLS = { }; const defaultOptions = { - // Max gas to use in the transaction - "safeTxGas": "0", /* * Gas costs not related to the transaction execution @@ -44,7 +42,10 @@ const defaultOptions = { "gasToken": ethers.constants.AddressZero, // Address of receiver of gas payment (or `null` if tx.origin) - "refundReceiver": ethers.constants.AddressZero + "refundReceiver": ethers.constants.AddressZero, + + // Max gas to use in the transaction + "safeTxGas": "0" }; // Private functions @@ -53,10 +54,10 @@ const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ - "to": transaction.to ?? ethers.constants.AddressZero, "data": transaction.data?.toString() ?? "0x", - "value": transaction.value?.toString() ?? "0", - "operation": 0 + "operation": OperationType.Call, + "to": transaction.to ?? ethers.constants.AddressZero, + "value": transaction.value?.toString() ?? "0" }); } return safeTransactionData; @@ -87,8 +88,8 @@ const getSafeService = async () => { {chainId} = await ethers.provider.getNetwork(); const ethAdapter: EthersAdapter = await getEthAdapter(); const safeService = new SafeApiKit({ - "txServiceUrl": getSafeTransactionUrl(chainId), - ethAdapter + ethAdapter, + "txServiceUrl": getSafeTransactionUrl(chainId) }); return safeService; }; @@ -170,8 +171,8 @@ export const createMultiSendTransaction = async ( safeAddress }); const safeTransaction = await safeSdk.createTransaction({ - safeTransactionData, - options + options, + safeTransactionData }); await estimateSafeTransaction( diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 117d997..6d9c163 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -14,10 +14,10 @@ export class EoaSubmitter extends Submitter { const responses = await Promise.all(transactions. map((transaction, index) => deployer.sendTransaction({ - "to": transaction.to, - "value": transaction.value, "data": transaction.data, - "nonce": nonce + index + "nonce": nonce + index, + "to": transaction.to, + "value": transaction.value }))); console.log("Waiting for transactions"); diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index fd076c1..a3a2101 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -60,8 +60,9 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { } await super.submit([ { - "to": this.marionette.address, - "data": await this.marionette.encodeFunctionCalls(functionCalls) + "data": await this.marionette. + encodeFunctionCalls(functionCalls), + "to": this.marionette.address } ]); } diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 5417f0f..ce555f1 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -35,7 +35,6 @@ export class SafeToImaSubmitter extends SafeSubmitter { } const messageProxyForMainnet = await this.getMessageProxyForMainnet(); const transactionsToIma = transactions.map((transaction) => ({ - "to": messageProxyForMainnet.address, "data": messageProxyForMainnet.interface.encodeFunctionData( "postOutgoingMessage", [ @@ -43,7 +42,8 @@ export class SafeToImaSubmitter extends SafeSubmitter { transaction.to, transaction.data ] - ) + ), + "to": messageProxyForMainnet.address })); await super.submit(transactionsToIma); } diff --git a/src/upgrader.ts b/src/upgrader.ts index 083dd7e..3b151e6 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -161,14 +161,14 @@ export abstract class Upgrader { ` to ${contract.implementationAddress}`; console.log(chalk.yellowBright(infoMessage)); this.transactions.push({ - "to": proxyAdmin.address, "data": proxyAdmin.interface.encodeFunctionData( "upgrade", [ contract.proxyAddress, contract.implementationAddress ] - ) + ), + "to": proxyAdmin.address }); } } @@ -200,9 +200,9 @@ export abstract class Upgrader { ) as string; if (newImplementationAddress !== currentImplementationAddress) { return { - proxyAddress, "implementationAddress": newImplementationAddress, - "name": contract + "name": contract, + proxyAddress }; } console.log(chalk.gray(`Contract ${contract} is up to date`)); diff --git a/src/verification.ts b/src/verification.ts index 5d36721..703521a 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -89,9 +89,9 @@ export const verify = async ( } await verifyWithRetry( { - contractName, + constructorArguments, contractAddress, - constructorArguments + contractName }, RETRIES_AMOUNT ); diff --git a/src/version.ts b/src/version.ts index 455a167..7537009 100644 --- a/src/version.ts +++ b/src/version.ts @@ -21,8 +21,8 @@ const getVersionFilename = async (folder?: string): Promise => { for (const entry of await fs.readdir( folder, { - "withFileTypes": true, - "recursive": true + "recursive": true, + "withFileTypes": true } )) { if (entry.isFile() && entry.name === VERSION_FILENAME) { From b689987a4c7272c4e181d716ea55e51d7407e5cd Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Tue, 19 Sep 2023 17:56:11 +0300 Subject: [PATCH 30/44] Replace getLinkedContractFactory with ethers implementation --- src/contractFactory.ts | 5 ++-- src/deploy.ts | 56 ++---------------------------------------- 2 files changed, 4 insertions(+), 57 deletions(-) diff --git a/src/contractFactory.ts b/src/contractFactory.ts index 90ca4f5..6d30267 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -1,7 +1,6 @@ import {artifacts, ethers} from "hardhat"; import { deployLibraries, - getLinkedContractFactory, getManifestFile } from "./deploy"; import {LinkReferences} from "hardhat/types"; @@ -129,8 +128,8 @@ export const getContractFactoryAndUpdateManifest = async (contract: string) => { libraries, oldLibraries ); - return await getLinkedContractFactory( + return await ethers.getContractFactory( contract, - libraries + {"libraries": Object.fromEntries(libraries)} ); }; diff --git a/src/deploy.ts b/src/deploy.ts index 21ac93e..fd99032 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,7 +1,5 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; -import {hexConcat, hexDataSlice} from "ethers/lib/utils"; -import {Artifact} from "hardhat/types"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {promises as fs} from "fs"; import {getLibrariesNames} from "./contractFactory"; @@ -42,56 +40,6 @@ export const deployLibraries = async (libraryNames: string[]) => { return libraries; }; -const firstByteIndex = 0; - -const linkBytecode = (artifact: Artifact, libraries: Map) => { - let {bytecode} = artifact; - for (const [, fileReferences] of Object.entries(artifact.linkReferences)) { - for (const [ - libName, - fixups - ] of Object.entries(fileReferences)) { - const libAddress = libraries.get(libName); - if (typeof libAddress !== "undefined") { - for (const fixup of fixups) { - const bytecodeBefore = hexDataSlice( - bytecode, - firstByteIndex, - fixup.start - ); - const bytecodeAfter = hexDataSlice( - bytecode, - fixup.start + fixup.length - ); - bytecode = hexConcat([ - bytecodeBefore, - libAddress, - bytecodeAfter - ]); - } - } - } - } - return bytecode; -}; - -export const getLinkedContractFactory = async ( - contractName: string, - libraries: Map -) => { - const - cArtifact = await artifacts.readArtifact(contractName); - const linkedBytecode = linkBytecode( - cArtifact, - libraries - ); - const ContractFactory = await ethers.getContractFactory( - cArtifact.abi, - linkedBytecode - ); - return ContractFactory; -}; - export const getManifestFile = async function getManifestFile () { return (await Manifest.forNetwork(ethers.provider)).file; }; @@ -167,8 +115,8 @@ export const getContractFactory = async (contract: string) => { await updateManifest(libraryArtifacts); - return await getLinkedContractFactory( + return await ethers.getContractFactory( contract, - libraries + {"libraries": Object.fromEntries(libraries)} ); }; From ddada389cfabe2e2e84a7d9e034fef01917c4eab Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 20 Sep 2023 17:24:21 +0300 Subject: [PATCH 31/44] Simplify Upgrader interface --- src/upgrader.ts | 12 ++++-------- tsconfig.json | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index 3b151e6..45319af 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -23,9 +23,6 @@ interface ContractToUpgrade { interface Project { name: string; instance: Instance; -} - -interface Target { version: string; contractNamesToUpgrade: string[] } @@ -49,15 +46,14 @@ export abstract class Upgrader { constructor ( project: Project, - target: Target, submitter: Submitter = new AutoSubmitter() ) { - this.targetVersion = target.version; - if (!target.version.includes("-")) { - this.targetVersion = `${target.version}-stable.0`; + this.targetVersion = project.version; + if (!project.version.includes("-")) { + this.targetVersion = `${project.version}-stable.0`; } this.instance = project.instance; - this.contractNamesToUpgrade = target.contractNamesToUpgrade; + this.contractNamesToUpgrade = project.contractNamesToUpgrade; this.projectName = project.name; this.transactions = []; this.submitter = submitter; diff --git a/tsconfig.json b/tsconfig.json index df8a32e..26eb725 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,10 @@ "extends": "@tsconfig/recommended/tsconfig.json", "compilerOptions": { - "target": "ES2020", - "outDir": "./dist", "declaration": true, + "outDir": "./dist", + "sourceMap": true, + "target": "ES2020" }, "include": ["./src", "./typechain-types"], "exclude": ["node_modules", "dist"], From 4edf07535df4dfe669efe432a36566a1eb22a6a2 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 20 Sep 2023 19:28:16 +0300 Subject: [PATCH 32/44] Fix issue with this --- src/upgrader.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index 45319af..6ad03c2 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -171,7 +171,10 @@ export abstract class Upgrader { private async deployNewImplementations () { const contracts = await Promise.all(this.contractNamesToUpgrade. - map(this.deployNewImplementation)); + map( + this.deployNewImplementation, + this + )); return withoutNull(contracts); } From 3a9281c7060fa88b43b8c6849267a4b874255a78 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 21 Sep 2023 17:04:51 +0300 Subject: [PATCH 33/44] Add NonceProvider --- src/deploy.ts | 21 +++++++++++++++------ src/nonceProvider.ts | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 src/nonceProvider.ts diff --git a/src/deploy.ts b/src/deploy.ts index fd99032..fc2dc26 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,5 +1,6 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; +import {NonceProvider} from "./nonceProvider"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {promises as fs} from "fs"; import {getLibrariesNames} from "./contractFactory"; @@ -9,23 +10,31 @@ interface LibraryArtifacts { [key: string]: unknown } -const deployLibrary = async (libraryName: string, nonce: number) => { +const deployLibrary = async ( + libraryName: string, + nonceProvider: NonceProvider +) => { const Library = await ethers.getContractFactory(libraryName); - const library = await Library.deploy({nonce}); + const library = await Library. + deploy({"nonce": nonceProvider.reserveNonce()}); await library.deployed(); return library.address; }; -export const deployLibraries = async (libraryNames: string[]) => { +export const deployLibraries = async ( + libraryNames: string[], + nonceProvider?: NonceProvider +) => { const [deployer] = await ethers.getSigners(); - const nonce = await deployer.getTransactionCount(); + const initializedNonceProvider = nonceProvider ?? + await NonceProvider.createForWallet(deployer); const libraries = new Map(); - (await Promise.all(libraryNames.map((libraryName, index) => (async () => [ + (await Promise.all(libraryNames.map((libraryName) => (async () => [ libraryName, await deployLibrary( libraryName, - nonce + index + initializedNonceProvider ) ])()))).forEach(([ libraryName, diff --git a/src/nonceProvider.ts b/src/nonceProvider.ts new file mode 100644 index 0000000..b0aba1a --- /dev/null +++ b/src/nonceProvider.ts @@ -0,0 +1,19 @@ +import {Signer} from "ethers"; + +export class NonceProvider { + currentNonce: number; + + constructor (nonce: number) { + this.currentNonce = nonce; + } + + static async createForWallet (signer: Signer) { + return new NonceProvider(await signer.getTransactionCount()); + } + + reserveNonce () { + const nonce = this.currentNonce; + this.currentNonce += 1; + return nonce; + } +} From 942793538eb08c83d70a9fdf7dcc245c28703901 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 21 Sep 2023 19:14:57 +0300 Subject: [PATCH 34/44] Set nonce prepareUpgrade --- src/contractFactory.ts | 11 +++++++++-- src/upgrader.ts | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/contractFactory.ts b/src/contractFactory.ts index 6d30267..452bafb 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -4,6 +4,7 @@ import { getManifestFile } from "./deploy"; import {LinkReferences} from "hardhat/types"; +import {NonceProvider} from "./nonceProvider"; import {SkaleManifestData} from "./types/SkaleManifestData"; import {promises as fs} from "fs"; import {hashBytecode} from "@openzeppelin/upgrades-core"; @@ -107,7 +108,10 @@ const getLibrariesToUpgrade = async ( }; }; -export const getContractFactoryAndUpdateManifest = async (contract: string) => { +export const getContractFactoryAndUpdateManifest = async ( + contract: string, + nonceProvider?: NonceProvider +) => { const {linkReferences} = await artifacts.readArtifact(contract); if (!Object.keys(linkReferences).length) { return await ethers.getContractFactory(contract); @@ -122,7 +126,10 @@ export const getContractFactoryAndUpdateManifest = async (contract: string) => { manifest, linkReferences ); - const libraries = await deployLibraries(librariesToUpgrade); + const libraries = await deployLibraries( + librariesToUpgrade, + nonceProvider + ); await updateManifest( manifest, libraries, diff --git a/src/upgrader.ts b/src/upgrader.ts index 6ad03c2..1c7d7be 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,7 +1,8 @@ -import hre, {network, upgrades} from "hardhat"; +import hre, {ethers, network, upgrades} from "hardhat"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {EXIT_CODES} from "./exitCodes"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {NonceProvider} from "./nonceProvider"; import {ProxyAdmin} from "../typechain-types"; import {Submitter} from "./submitters/submitter"; import {UnsignedTransaction} from "ethers"; @@ -44,6 +45,8 @@ export abstract class Upgrader { submitter: Submitter; + nonceProvider?: NonceProvider; + constructor ( project: Project, submitter: Submitter = new AutoSubmitter() @@ -170,6 +173,8 @@ export abstract class Upgrader { } private async deployNewImplementations () { + const [deployer] = await ethers.getSigners(); + this.nonceProvider ??= await NonceProvider.createForWallet(deployer); const contracts = await Promise.all(this.contractNamesToUpgrade. map( this.deployNewImplementation, @@ -179,8 +184,10 @@ export abstract class Upgrader { } private async deployNewImplementation (contract: string) { - const contractFactory = - await getContractFactoryAndUpdateManifest(contract); + const contractFactory = await getContractFactoryAndUpdateManifest( + contract, + this.nonceProvider + ); const proxyAddress = (await this.instance.getContract(contract)).address; @@ -193,6 +200,11 @@ export abstract class Upgrader { proxyAddress, contractFactory, { + "constructorArgs": [ + { + "nonce": this.nonceProvider?.reserveNonce() + } + ], "unsafeAllowLinkedLibraries": true, "unsafeAllowRenames": true } From aede3cfe943241a9ac7cd84db77a38c4f19b8bab Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 25 Sep 2023 17:41:26 +0300 Subject: [PATCH 35/44] Deploy implementations sequentially --- src/upgrader.ts | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index 1c7d7be..b529d33 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -175,11 +175,27 @@ export abstract class Upgrader { private async deployNewImplementations () { const [deployer] = await ethers.getSigners(); this.nonceProvider ??= await NonceProvider.createForWallet(deployer); - const contracts = await Promise.all(this.contractNamesToUpgrade. - map( - this.deployNewImplementation, - this - )); + + /* + * TODO: + * 1. add explicit nonce in deployNewImplementation + * 2. replace for loop with Promise.all + * + * Const contracts = await Promise.all(this.contractNamesToUpgrade. + * map( + * this.deployNewImplementation, + * this + * )); + */ + const contracts = []; + for (const contract of this.contractNamesToUpgrade) { + // eslint-disable-next-line no-await-in-loop + contracts.push(await this.deployNewImplementation(contract)); + } + + /* + * TODO: End of TODO + */ return withoutNull(contracts); } @@ -200,11 +216,16 @@ export abstract class Upgrader { proxyAddress, contractFactory, { - "constructorArgs": [ - { - "nonce": this.nonceProvider?.reserveNonce() - } - ], + + /* + * TODO: Add txOverride to explicitly set nonce + * after updating of @openzeppelin/hardhat-upgrades + * to version 2.1.0 or newer. + * + * "txOverrides": { + * "nonce": this.nonceProvider?.reserveNonce() + * }, + */ "unsafeAllowLinkedLibraries": true, "unsafeAllowRenames": true } From 6b7b9ecb7ed7e1f4c4dcbb061c3c859a56956b58 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 25 Sep 2023 19:00:48 +0300 Subject: [PATCH 36/44] Fix nonce issue --- src/upgrader.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index b529d33..d5e7c60 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,4 +1,4 @@ -import hre, {ethers, network, upgrades} from "hardhat"; +import hre, {network, upgrades} from "hardhat"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {EXIT_CODES} from "./exitCodes"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; @@ -173,15 +173,14 @@ export abstract class Upgrader { } private async deployNewImplementations () { - const [deployer] = await ethers.getSigners(); - this.nonceProvider ??= await NonceProvider.createForWallet(deployer); - + // TODO: /* - * TODO: * 1. add explicit nonce in deployNewImplementation * 2. replace for loop with Promise.all * - * Const contracts = await Promise.all(this.contractNamesToUpgrade. + * const [deployer] = await ethers.getSigners(); + * this.nonceProvider ??= await NonceProvider.createForWallet(deployer); + * const contracts = await Promise.all(this.contractNamesToUpgrade. * map( * this.deployNewImplementation, * this From 0c65c7dc29aab31e9df792afdcb4c892596502fd Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 12 Oct 2023 17:30:48 +0300 Subject: [PATCH 37/44] Update skale-contracts --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index da1f7f2..b2fccbf 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@safe-global/api-kit": "^1.3.0", "@safe-global/protocol-kit": "^1.2.0", "@safe-global/safe-core-sdk-types": "^2.2.0", - "@skalenetwork/skale-contracts-ethers-v5": "0.1.0-develop.0", + "@skalenetwork/skale-contracts-ethers-v5": "^1.0.1-develop.0", "axios": "^1.4.0", "ethereumjs-util": "^7.1.4" }, diff --git a/yarn.lock b/yarn.lock index 2b664a7..b940481 100644 --- a/yarn.lock +++ b/yarn.lock @@ -884,18 +884,18 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@skalenetwork/skale-contracts-ethers-v5@0.1.0-develop.0": - version "0.1.0-develop.0" - resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts-ethers-v5/-/skale-contracts-ethers-v5-0.1.0-develop.0.tgz#fd1ab452c7851cdfc089c49d19a744a5f735dbd8" - integrity sha512-ckKbW4J1rFOfGGFaKtapbFvSJQQrEaamLnjbGOvjLNTqWOH7Vr/marqoHWANARvZUGpPUt5EzswzLpSfbNCF8A== +"@skalenetwork/skale-contracts-ethers-v5@^1.0.1-develop.0": + version "1.0.1-develop.0" + resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts-ethers-v5/-/skale-contracts-ethers-v5-1.0.1-develop.0.tgz#868ad040b20033a06270d75491d26f486c709d04" + integrity sha512-A0R7LjX2vsCqQ6u/4ujZetAA5EY7Czq3vKv8NIhoDjpwn6LKZrI6dwywmsgw3DZUNE+31md1TiQEIjiHWscibA== dependencies: - "@skalenetwork/skale-contracts" "0.1.0-develop.0" + "@skalenetwork/skale-contracts" "1.0.1-develop.0" ethers "^5.7.2" -"@skalenetwork/skale-contracts@0.1.0-develop.0": - version "0.1.0-develop.0" - resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts/-/skale-contracts-0.1.0-develop.0.tgz#c683da89c327f4299435c84e22751f2477d745aa" - integrity sha512-9LEYKC7hoaehqLukoU0qrgC3zxjWAbLGDRnjbZPdmAM19xOPTO6Gq0uzCCA7GNbe5EKI9hTLyiJVv0jouppUvQ== +"@skalenetwork/skale-contracts@1.0.1-develop.0": + version "1.0.1-develop.0" + resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts/-/skale-contracts-1.0.1-develop.0.tgz#4407ec4667cec27889263011f89badfd35d6ebf9" + integrity sha512-2IiRdso3ik4mOi6rX5mSMaKe3zgm13bMaUeez7ykN70xNDQteTCh0wSAE75ZK0g/dE5AGlfylW5H6lWeu3VMKQ== dependencies: axios "^1.4.0" From 34f964b859dc17e9cb05591849a3e624ed303327 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Fri, 21 Jun 2024 17:49:56 +0300 Subject: [PATCH 38/44] Move to ethers v6 --- hardhat.config.ts | 4 +- package.json | 22 +- src/abi.ts | 4 +- src/deploy.ts | 4 +- src/gnosis-safe.ts | 93 +- src/index.ts | 1 - src/multiSend.ts | 63 - src/nonceProvider.ts | 2 +- src/submitters/auto-submitter.ts | 28 +- src/submitters/eoa-submitter.ts | 6 +- .../safe-ima-legacy-marionette-submitter.ts | 28 +- .../safe-ima-marionette-submitter.ts | 26 +- src/submitters/safe-submitter.ts | 8 +- src/submitters/safe-to-ima-submitter.ts | 15 +- src/submitters/submitter.ts | 4 +- src/submitters/types/marionette.ts | 11 +- src/upgrader.ts | 80 +- src/verification.ts | 2 +- yarn.lock | 2548 +---------------- 19 files changed, 293 insertions(+), 2656 deletions(-) delete mode 100644 src/multiSend.ts diff --git a/hardhat.config.ts b/hardhat.config.ts index 15489b4..cdcd122 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,5 +1,5 @@ import "@typechain/hardhat"; -import "@nomiclabs/hardhat-ethers"; +import "@nomicfoundation/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; import {HardhatUserConfig} from "hardhat/config"; @@ -10,7 +10,7 @@ const coreArtifacts = const config: HardhatUserConfig = { "typechain": { "externalArtifacts": [coreArtifacts], - "target": "ethers-v5" + "target": "ethers-v6" } }; diff --git a/package.json b/package.json index 122f169..4ed4103 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "devDependencies": { "@openzeppelin/contracts-upgradeable": "^4.4.2", "@tsconfig/recommended": "^1.0.2", - "@typechain/ethers-v5": "^9.0.0", - "@typechain/hardhat": "^8.0.0", + "@typechain/ethers-v6": "^0.5.1", + "@typechain/hardhat": "^9.1.0", "@types/node": "^20.6.0", "@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/parser": "^6.6.0", @@ -34,24 +34,24 @@ "eslint": "^8.15.0", "install-peers-cli": "^2.2.0", "ts-node": "^10.5.0", - "typechain": "^8.2.0", + "typechain": "^8.3.2", "typescript": "^5.1.6" }, "dependencies": { - "@safe-global/api-kit": "^1.3.0", - "@safe-global/protocol-kit": "^1.2.0", - "@safe-global/safe-core-sdk-types": "^2.2.0", - "@skalenetwork/skale-contracts-ethers-v5": "^1.0.1-develop.0", + "@safe-global/api-kit": "^2.4.1", + "@safe-global/protocol-kit": "^4.0.1", + "@safe-global/safe-core-sdk-types": "^5.0.1", + "@skalenetwork/skale-contracts-ethers-v6": "^1.0.0", "axios": "^1.4.0", "ethereumjs-util": "^7.1.4" }, "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.0", "@nomicfoundation/hardhat-verify": "^1.1.1", - "@nomiclabs/hardhat-ethers": "^2.0.4", - "@openzeppelin/hardhat-upgrades": "^1.14.0", + "@openzeppelin/hardhat-upgrades": "^3.1.1", "@openzeppelin/upgrades-core": "^1.27.1", "@types/mocha": "^9.1.0", - "ethers": "^5.7.2", - "hardhat": "^2.16.1" + "ethers": "^6.1.0", + "hardhat": "^2.9.9" } } diff --git a/src/abi.ts b/src/abi.ts index f2f6b50..3349ca3 100644 --- a/src/abi.ts +++ b/src/abi.ts @@ -1,7 +1,7 @@ -import {Interface} from "ethers/lib/utils"; +import {Interface} from "ethers"; export const getAbi = (contractInterface: Interface) => { - const abi = JSON.parse(contractInterface.format("json") as string) as []; + const abi = JSON.parse(contractInterface.formatJson()) as []; abi.forEach((obj: {type: string}) => { if (obj.type === "function") { diff --git a/src/deploy.ts b/src/deploy.ts index fc2dc26..5c58fa3 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -17,8 +17,8 @@ const deployLibrary = async ( const Library = await ethers.getContractFactory(libraryName); const library = await Library. deploy({"nonce": nonceProvider.reserveNonce()}); - await library.deployed(); - return library.address; + await library.waitForDeployment() + return await library.getAddress(); }; export const deployLibraries = async ( diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 2b96ec4..cdf18f8 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -4,22 +4,52 @@ import { SafeTransaction, SafeTransactionDataPartial } from "@safe-global/safe-core-sdk-types"; -import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; +import {Network, Transaction} from "ethers"; +import {ethers, network} from "hardhat"; +import Safe from "@safe-global/protocol-kit"; import SafeApiKit from "@safe-global/api-kit"; -import {UnsignedTransaction} from "ethers"; import chalk from "chalk"; -import {ethers} from "hardhat"; -import {getNetwork} from "@ethersproject/networks"; + +// Cspell:words arbitrum celo sepolia xdai // Constants const URLS = { "safe_transaction": { - [getNetwork("mainnet").chainId]: + [Network.from("mainnet").chainId.toString()]: "https://safe-transaction-mainnet.safe.global", - [getNetwork("goerli").chainId]: - "https://safe-transaction-goerli.safe.global" + [Network.from("arbitrum").chainId.toString()]: + "https://safe-transaction-arbitrum.safe.global", + [Network.from("aurora").chainId.toString()]: + "https://safe-transaction-aurora.safe.global", + [Network.from("avalanche").chainId.toString()]: + "https://safe-transaction-avalanche.safe.global", + [Network.from("base").chainId.toString()]: + "https://safe-transaction-base.safe.global", + [Network.from("base-sepolia").chainId.toString()]: + "https://safe-transaction-base-sepolia.safe.global", + [Network.from("bnb").chainId.toString()]: + "https://safe-transaction-bsc.safe.global", + [Network.from("celo").chainId.toString()]: + "https://safe-transaction-celo.safe.global", + [Network.from("xdai").chainId.toString()]: + "https://safe-transaction-gnosis-chain.safe.global", + [Network.from("optimism").chainId.toString()]: + "https://safe-transaction-optimism.safe.global", + [Network.from("matic").chainId.toString()]: + "https://safe-transaction-polygon.safe.global", + // Polygon zkEVM + "1101": + "https://safe-transaction-zkevm.safe.global", + // ZkSync Era Mainnet + "324": + "https://safe-transaction-zksync.safe.global", + // Scroll + "534352": + "https://safe-transaction-scroll.safe.global", + [Network.from("sepolia").chainId.toString()]: + "https://safe-transaction-sepolia.safe.global", } }; @@ -39,10 +69,10 @@ const defaultOptions = { * to be used as a refund to the sender, * if `null` is Ether */ - "gasToken": ethers.constants.AddressZero, + "gasToken": ethers.ZeroAddress, // Address of receiver of gas payment (or `null` if tx.origin) - "refundReceiver": ethers.constants.AddressZero, + "refundReceiver": ethers.ZeroAddress, // Max gas to use in the transaction "safeTxGas": "0" @@ -50,45 +80,34 @@ const defaultOptions = { // Private functions -const getSafeTransactionData = (transactions: UnsignedTransaction[]) => { +const getSafeTransactionData = (transactions: Transaction[]) => { const safeTransactionData: MetaTransactionData[] = []; for (const transaction of transactions) { safeTransactionData.push({ - "data": transaction.data?.toString() ?? "0x", + "data": transaction.data, "operation": OperationType.Call, - "to": transaction.to ?? ethers.constants.AddressZero, - "value": transaction.value?.toString() ?? "0" + "to": transaction.to ?? ethers.ZeroAddress, + "value": transaction.value.toString() }); } return safeTransactionData; }; -const getEthAdapter = async (): Promise => { - const - [safeOwner] = await ethers.getSigners(); - const ethAdapter = new EthersAdapter({ - ethers, - "signerOrProvider": safeOwner - }); - return ethAdapter; -}; - -const getSafeTransactionUrl = (chainId: number) => { +const getSafeTransactionUrl = (chainId: bigint) => { if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) { return URLS.safe_transaction[ - chainId as keyof typeof URLS.safe_transaction + Number(chainId) as keyof typeof URLS.safe_transaction ]; } - throw Error("Can't get safe-transaction url" + + throw Error("Can't get Safe Transaction Service url" + ` at network with chainId = ${chainId}`); }; const getSafeService = async () => { const {chainId} = await ethers.provider.getNetwork(); - const ethAdapter: EthersAdapter = await getEthAdapter(); const safeService = new SafeApiKit({ - ethAdapter, + chainId, "txServiceUrl": getSafeTransactionUrl(chainId) }); return safeService; @@ -122,13 +141,10 @@ const proposeTransaction = async ( safeAddress: string, safeTransaction: SafeTransaction ) => { - const - [safeOwner] = await ethers.getSigners(); - const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ethAdapter, - safeAddress}); + const [safeOwner] = await ethers.getSigners(); + const safeSdk = await Safe.init({provider: network.provider, safeAddress}); const safeTxHash = await safeSdk.getTransactionHash(safeTransaction); - const senderSignature = await safeSdk.signTransactionHash(safeTxHash); + const senderSignature = await safeSdk.signHash(safeTxHash); const safeService = await getSafeService(); await safeService.proposeTransaction({ safeAddress, @@ -143,7 +159,7 @@ const proposeTransaction = async ( export const createMultiSendTransaction = async ( safeAddress: string, - transactions: UnsignedTransaction[] + transactions: Transaction[] ) => { const safeTransactionData = getSafeTransactionData(transactions); const safeService = await getSafeService(); @@ -165,14 +181,13 @@ export const createMultiSendTransaction = async ( nonce } }; - const ethAdapter = await getEthAdapter(); - const safeSdk = await Safe.create({ - ethAdapter, + const safeSdk = await Safe.init({ + provider: network.provider, safeAddress }); const safeTransaction = await safeSdk.createTransaction({ options, - safeTransactionData + transactions: safeTransactionData }); await estimateSafeTransaction( diff --git a/src/index.ts b/src/index.ts index 8716239..3f9c67d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ export * from "./abi"; export * from "./deploy"; export * from "./gnosis-safe"; -export * from "./multiSend"; export * from "./submitters"; export * from "./verification"; export * from "./version"; diff --git a/src/multiSend.ts b/src/multiSend.ts deleted file mode 100644 index 9a04e71..0000000 --- a/src/multiSend.ts +++ /dev/null @@ -1,63 +0,0 @@ -import {BigNumberish, BytesLike} from "ethers"; -import { - hexConcat, - hexDataLength, - hexValue, - hexZeroPad, - hexlify -} from "ethers/lib/utils"; -import {OperationType} from "@safe-global/safe-core-sdk-types"; - - -interface Transaction { - - /* - * Operation as a uint8 with 0 for a call - * or 1 for a delegatecall (=> 1 byte) - */ - operation: OperationType, - - // To as a address (=> 20 bytes) - to: string, - - // Value as a uint256 (=> 32 bytes) - value: BigNumberish, - - // Data as bytes. - data: BytesLike -} - -const OPERATION_BYTES = 1; -const ADDRESS_BYTES = 20; -const UINT256_BYTES = 32; -const TO_BYTES = ADDRESS_BYTES; -const VALUE_BYTES = UINT256_BYTES; -const DATA_LENGTH_BYTES = UINT256_BYTES; - -export const encodeTransaction = (transaction: Transaction) => { - const operation = hexZeroPad( - hexValue(transaction.operation), - OPERATION_BYTES - ); - const to = hexZeroPad( - hexValue(transaction.to), - TO_BYTES - ); - const value = hexZeroPad( - hexValue(transaction.value), - VALUE_BYTES - ); - const data = hexlify(transaction.data); - const dataLength = hexZeroPad( - hexValue(hexDataLength(data)), - DATA_LENGTH_BYTES - ); - - return hexConcat([ - operation, - to, - value, - dataLength, - data - ]); -}; diff --git a/src/nonceProvider.ts b/src/nonceProvider.ts index b0aba1a..3aa7a5b 100644 --- a/src/nonceProvider.ts +++ b/src/nonceProvider.ts @@ -8,7 +8,7 @@ export class NonceProvider { } static async createForWallet (signer: Signer) { - return new NonceProvider(await signer.getTransactionCount()); + return new NonceProvider(await signer.getNonce()); } reserveNonce () { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index fb6ff32..3d097e7 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -2,16 +2,15 @@ import hre, {ethers} from "hardhat"; import {EXIT_CODES} from "../exitCodes"; import {EoaSubmitter} from "./eoa-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; -import {ProxyAdmin} from "../../typechain-types"; import { SafeImaLegacyMarionetteSubmitter } from "./safe-ima-legacy-marionette-submitter"; import {SafeSubmitter} from "./safe-submitter"; import {Submitter} from "./submitter"; import {Transaction} from "ethers"; +import {Upgrader} from "../upgrader"; import chalk from "chalk"; -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; -import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; +import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v6"; export class AutoSubmitter extends Submitter { @@ -42,8 +41,7 @@ export class AutoSubmitter extends Submitter { // Private private static async getSubmitter () { - // TODO: remove unknown when move everything to ethers 6 - const proxyAdmin = await getManifestAdmin(hre) as unknown as ProxyAdmin; + const proxyAdmin = await Upgrader.getProxyAdmin(); const owner = await proxyAdmin.owner(); if (await hre.ethers.provider.getCode(owner) === "0x") { console.log("Owner is not a contract"); @@ -55,8 +53,8 @@ export class AutoSubmitter extends Submitter { } private static async getSubmitterForContractOwner (owner: string) { - if (ethers.utils.getAddress(owner) === - ethers.utils.getAddress(MARIONETTE_ADDRESS)) { + if (ethers.getAddress(owner) === + ethers.getAddress(MARIONETTE_ADDRESS)) { console.log("Marionette owner is detected"); const imaInstance = await AutoSubmitter.getImaInstance(); @@ -111,9 +109,9 @@ export class AutoSubmitter extends Submitter { " to IMA environment variable")); process.exit(EXIT_CODES.UNKNOWN_IMA); } - const network = + const contractsNetwork = await skaleContracts.getNetworkByProvider(ethers.provider); - const ima = await network.getProject("ima"); + const ima = await contractsNetwork.getProject("ima"); return await ima.getInstance(process.env.IMA); } @@ -132,7 +130,7 @@ export class AutoSubmitter extends Submitter { return process.env.SCHAIN_HASH; } if (process.env.SCHAIN_NAME) { - return ethers.utils.solidityKeccak256( + return ethers.solidityPackedKeccak256( ["string"], [process.env.SCHAIN_NAME] ); @@ -145,12 +143,8 @@ export class AutoSubmitter extends Submitter { } private static getMainnetChainId () { - const CHAIN_ID_RADIX = 10; if (process.env.MAINNET_CHAIN_ID) { - return Number.parseInt( - process.env.MAINNET_CHAIN_ID, - CHAIN_ID_RADIX - ); + return BigInt(process.env.MAINNET_CHAIN_ID); } console.log(chalk.red("Set chainId of mainnet" + " to MAINNET_CHAIN_ID environment variable")); @@ -168,7 +162,7 @@ export class AutoSubmitter extends Submitter { * If the bytecode doesn't include the function selector version() * is definitely not present */ - if (!bytecode.includes(ethers.utils.id("version()").slice( + if (!bytecode.includes(ethers.id("version()").slice( hexPrefixLength, selectorLength ))) { @@ -186,7 +180,7 @@ export class AutoSubmitter extends Submitter { * given the provided function selector */ try { - await marionette.estimateGas.version(); + await marionette.version.estimateGas(); return true; } catch { /* diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index 6d9c163..534ea7e 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -1,15 +1,15 @@ import {Submitter} from "./submitter"; -import {UnsignedTransaction} from "ethers"; +import {Transaction} from "ethers"; import {ethers} from "hardhat"; export class EoaSubmitter extends Submitter { name = "EOA Submitter"; - async submit (transactions: UnsignedTransaction[]) { + async submit (transactions: Transaction[]) { EoaSubmitter.atomicityWarning(); const [deployer] = await ethers.getSigners(); - const nonce = await deployer.getTransactionCount(); + const nonce = await deployer.getNonce(); console.log(`Send transaction via ${this.name}`); const responses = await Promise.all(transactions. diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 3cd4758..5afac0d 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -1,13 +1,13 @@ -import {BytesLike, UnsignedTransaction} from "ethers"; -import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {LegacyMarionette, MARIONETTE_ADDRESS} from "./types/marionette"; import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; +import {Transaction} from "ethers"; import {ethers} from "hardhat"; export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { - marionette = new ethers.Contract( + marionette = new ethers.BaseContract( MARIONETTE_ADDRESS, - new ethers.utils.Interface([ + new ethers.Interface([ { "inputs": [ { @@ -39,24 +39,24 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { } ]), ethers.provider - ); + ) as LegacyMarionette; - async submit (transactions: UnsignedTransaction[]): Promise { + async submit (transactions: Transaction[]): Promise { const singleTransaction = 1; if (transactions.length > singleTransaction) { SafeImaLegacyMarionetteSubmitter.atomicityWarning(); } - const zeroValue = 0; + const marionetteAddress = await this.marionette.getAddress(); const transactionsToMarionette = (await Promise.all(transactions. map((transaction) => this.marionette.encodeFunctionCall( - transaction.to ?? ethers.constants.AddressZero, - transaction.value ?? zeroValue, - transaction.data ?? "0x" - ) as Promise)) - ).map((data) => ({ - data, - "to": this.marionette.address + transaction.to ?? ethers.ZeroAddress, + transaction.value , + transaction.data + ))) + ).map((data) => Transaction.from({ + "data": ethers.hexlify(data), + "to": marionetteAddress })); await super.submit(transactionsToMarionette); diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index a3a2101..21cb31a 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -1,13 +1,13 @@ import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; -import {UnsignedTransaction} from "ethers"; +import {Transaction} from "ethers"; import {ethers} from "hardhat"; export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { - marionette = new ethers.Contract( + marionette = new ethers.BaseContract( MARIONETTE_ADDRESS, - new ethers.utils.Interface([ + new ethers.Interface([ { "inputs": [ { @@ -48,22 +48,20 @@ export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { ethers.provider ) as Marionette; - async submit (transactions: UnsignedTransaction[]): Promise { + async submit (transactions: Transaction[]): Promise { const functionCalls = []; - const zeroValue = 0; for (const transaction of transactions) { functionCalls.push({ - "data": transaction.data ?? "0x", - "receiver": transaction.to ?? ethers.constants.AddressZero, - "value": transaction.value ?? zeroValue + "data": transaction.data, + "receiver": transaction.to ?? ethers.ZeroAddress, + "value": transaction.value }); } - await super.submit([ - { - "data": await this.marionette. - encodeFunctionCalls(functionCalls), - "to": this.marionette.address - } + await super.submit([Transaction.from({ + "data": ethers.hexlify(await this.marionette. + encodeFunctionCalls(functionCalls)), + "to": await this.marionette.getAddress() + }) ]); } } diff --git a/src/submitters/safe-submitter.ts b/src/submitters/safe-submitter.ts index 7ecc3d9..29467a4 100644 --- a/src/submitters/safe-submitter.ts +++ b/src/submitters/safe-submitter.ts @@ -1,5 +1,5 @@ import {Submitter} from "./submitter"; -import {UnsignedTransaction} from "ethers"; +import {Transaction} from "ethers"; import {createMultiSendTransaction} from "../gnosis-safe"; import {ethers} from "hardhat"; @@ -7,15 +7,15 @@ import {ethers} from "hardhat"; export class SafeSubmitter extends Submitter { safeAddress: string; - chainId: number | undefined; + chainId: bigint | undefined; - constructor (safeAddress: string, chainId?: number) { + constructor (safeAddress: string, chainId?: bigint) { super(); this.safeAddress = safeAddress; this.chainId = chainId; } - async submit (transactions: UnsignedTransaction[]): Promise { + async submit (transactions: Transaction[]): Promise { if (!this.chainId) { this.chainId = (await ethers.provider.getNetwork()).chainId; } diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index ce555f1..8663133 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -1,11 +1,11 @@ -import {BytesLike, Contract, UnsignedTransaction} from "ethers"; -import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {BaseContract, BytesLike, Transaction} from "ethers"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v6"; import {SafeSubmitter} from "./safe-submitter"; interface Network { targetSchainHash: BytesLike, - mainnetChainId?: number + mainnetChainId?: bigint } export class SafeToImaSubmitter extends SafeSubmitter { @@ -13,7 +13,7 @@ export class SafeToImaSubmitter extends SafeSubmitter { targetSchainHash: BytesLike; - private messageProxyForMainnet: Contract | undefined; + private messageProxyForMainnet: BaseContract | undefined; constructor ( safeAddress: string, @@ -28,13 +28,14 @@ export class SafeToImaSubmitter extends SafeSubmitter { this.targetSchainHash = network.targetSchainHash; } - async submit (transactions: UnsignedTransaction[]): Promise { + async submit (transactions: Transaction[]): Promise { const singleTransaction = 1; if (transactions.length > singleTransaction) { SafeToImaSubmitter.atomicityWarning(); } const messageProxyForMainnet = await this.getMessageProxyForMainnet(); - const transactionsToIma = transactions.map((transaction) => ({ + const messageProxyForMainnetAddress = await messageProxyForMainnet.getAddress(); + const transactionsToIma = transactions.map((transaction) => Transaction.from({ "data": messageProxyForMainnet.interface.encodeFunctionData( "postOutgoingMessage", [ @@ -43,7 +44,7 @@ export class SafeToImaSubmitter extends SafeSubmitter { transaction.data ] ), - "to": messageProxyForMainnet.address + "to": messageProxyForMainnetAddress })); await super.submit(transactionsToIma); } diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index 25bb29b..9523a94 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -1,10 +1,10 @@ import {EXIT_CODES} from "../exitCodes"; -import {UnsignedTransaction} from "ethers"; +import {Transaction} from "ethers"; import chalk from "chalk"; export abstract class Submitter { - abstract submit(transactions: UnsignedTransaction[]): Promise; + abstract submit(transactions: Transaction[]): Promise; // Protected diff --git a/src/submitters/types/marionette.ts b/src/submitters/types/marionette.ts index 4cf00d4..e08449d 100644 --- a/src/submitters/types/marionette.ts +++ b/src/submitters/types/marionette.ts @@ -9,7 +9,16 @@ type FunctionCallStruct = { data: BytesLike; }; -export interface Marionette extends RawEthers.Contract { +export interface LegacyMarionette extends RawEthers.BaseContract { + encodeFunctionCall( + receiver: string, + value: BigNumberish, + data: BytesLike + ): Promise + version(): Promise; +} + +export interface Marionette extends RawEthers.BaseContract { encodeFunctionCalls( functionCalls: FunctionCallStruct[] ): Promise diff --git a/src/upgrader.ts b/src/upgrader.ts index d5e7c60..e70f194 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,16 +1,15 @@ -import hre, {network, upgrades} from "hardhat"; +import {Manifest, getImplementationAddress} from "@openzeppelin/upgrades-core"; +import {ethers, network, upgrades} from "hardhat"; import {AutoSubmitter} from "./submitters/auto-submitter"; import {EXIT_CODES} from "./exitCodes"; -import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v6"; import {NonceProvider} from "./nonceProvider"; import {ProxyAdmin} from "../typechain-types"; import {Submitter} from "./submitters/submitter"; -import {UnsignedTransaction} from "ethers"; +import {Transaction} from "ethers"; import chalk from "chalk"; import {promises as fs} from "fs"; import {getContractFactoryAndUpdateManifest} from "./contractFactory"; -import {getImplementationAddress} from "@openzeppelin/upgrades-core"; -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {getVersion} from "./version"; import {verify} from "./verification"; @@ -41,7 +40,7 @@ export abstract class Upgrader { projectName: string; - transactions: UnsignedTransaction[]; + transactions: Transaction[]; submitter: Submitter; @@ -83,9 +82,9 @@ export abstract class Upgrader { const contractsToUpgrade = await this.deployNewImplementations(); - this.switchToNewImplementations( + await this.switchToNewImplementations( contractsToUpgrade, - await getManifestAdmin(hre) as unknown as ProxyAdmin + await Upgrader.getProxyAdmin() ); await this.callInitialize(); @@ -102,6 +101,16 @@ export abstract class Upgrader { console.log("Done"); } + static async getProxyAdmin() { + const manifest = await Manifest.forNetwork(network.provider); + const adminDeployment = await manifest.getAdmin(); + if (!adminDeployment) { + throw new Error("Can't load ProxyAdmin address"); + } + const factory = await ethers.getContractFactory("ProxyAdmin"); + return factory.attach(adminDeployment.address) as ProxyAdmin; + } + // Private private async callInitialize () { @@ -149,17 +158,18 @@ export abstract class Upgrader { } } - private switchToNewImplementations ( + private async switchToNewImplementations ( contractsToUpgrade: ContractToUpgrade[], proxyAdmin: ProxyAdmin ) { + const proxyAdminAddress = await proxyAdmin.getAddress(); for (const contract of contractsToUpgrade) { const infoMessage = `Prepare transaction to upgrade ${contract.name}` + ` at ${contract.proxyAddress}` + ` to ${contract.implementationAddress}`; console.log(chalk.yellowBright(infoMessage)); - this.transactions.push({ + this.transactions.push(Transaction.from({ "data": proxyAdmin.interface.encodeFunctionData( "upgrade", [ @@ -167,34 +177,19 @@ export abstract class Upgrader { contract.implementationAddress ] ), - "to": proxyAdmin.address - }); + "to": proxyAdminAddress + })); } } private async deployNewImplementations () { - // TODO: - /* - * 1. add explicit nonce in deployNewImplementation - * 2. replace for loop with Promise.all - * - * const [deployer] = await ethers.getSigners(); - * this.nonceProvider ??= await NonceProvider.createForWallet(deployer); - * const contracts = await Promise.all(this.contractNamesToUpgrade. - * map( - * this.deployNewImplementation, - * this - * )); - */ - const contracts = []; - for (const contract of this.contractNamesToUpgrade) { - // eslint-disable-next-line no-await-in-loop - contracts.push(await this.deployNewImplementation(contract)); - } - - /* - * TODO: End of TODO - */ + const [deployer] = await ethers.getSigners(); + this.nonceProvider ??= await NonceProvider.createForWallet(deployer); + const contracts = await Promise.all(this.contractNamesToUpgrade. + map( + this.deployNewImplementation, + this + )); return withoutNull(contracts); } @@ -203,8 +198,8 @@ export abstract class Upgrader { contract, this.nonceProvider ); - const proxyAddress = - (await this.instance.getContract(contract)).address; + const proxyAddress = await + (await this.instance.getContract(contract)).getAddress(); console.log(`Prepare upgrade of ${contract}`); const currentImplementationAddress = await getImplementationAddress( @@ -215,16 +210,9 @@ export abstract class Upgrader { proxyAddress, contractFactory, { - - /* - * TODO: Add txOverride to explicitly set nonce - * after updating of @openzeppelin/hardhat-upgrades - * to version 2.1.0 or newer. - * - * "txOverrides": { - * "nonce": this.nonceProvider?.reserveNonce() - * }, - */ + "txOverrides": { + "nonce": this.nonceProvider?.reserveNonce() + }, "unsafeAllowLinkedLibraries": true, "unsafeAllowRenames": true } diff --git a/src/verification.ts b/src/verification.ts index 703521a..8f1e1e6 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -82,7 +82,7 @@ export const verify = async ( constructorArguments: object ) => { const {chainId} = await ethers.provider.getNetwork(); - if (!builtinChains.map((chain) => chain.chainId).includes(chainId)) { + if (!builtinChains.map((chain) => chain.chainId).includes(Number(chainId))) { const errorMessage = "Verification on this network is not supported"; console.log(chalk.grey(errorMessage)); return; diff --git a/yarn.lock b/yarn.lock index 5f7196c..dda6473 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@adraffy/ens-normalize@1.10.1": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== + "@cspell/cspell-bundled-dicts@8.8.3": version "8.8.3" resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.3.tgz#829f9dfeb019bbf23b84c985e139985b3267d423" @@ -412,372 +417,6 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== -"@ethereumjs/common@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.5.0.tgz#ec61551b31bef7a69d1dc634d8932468866a4268" - integrity sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.1" - -"@ethereumjs/common@^2.5.0": - version "2.6.5" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" - integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.5" - -"@ethereumjs/tx@3.3.2": - version "3.3.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.3.2.tgz#348d4624bf248aaab6c44fec2ae67265efe3db00" - integrity sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog== - dependencies: - "@ethereumjs/common" "^2.5.0" - ethereumjs-util "^7.1.2" - -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/abstract-provider@5.7.0", "@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== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - -"@ethersproject/abstract-signer@5.7.0", "@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== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/address@5.7.0", "@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== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/base64@5.7.0", "@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/basex@5.7.0", "@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.7.0", "@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== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@5.7.0", "@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.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/contracts@5.7.0", "@ethersproject/contracts@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" - integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== - dependencies: - "@ethersproject/abi" "^5.7.0" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - -"@ethersproject/hash@5.7.0", "@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== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/hdnode@5.7.0", "@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.7.0", "@ethersproject/json-wallets@^5.7.0": - 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.7.0", "@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== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@5.7.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.1", "@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/pbkdf2@5.7.0", "@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.7.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/providers@5.7.2": - version "5.7.2" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" - integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/random@5.7.0", "@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.7.0", "@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== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/sha2@5.7.0", "@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.7.0", "@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== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - bn.js "^5.2.1" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" - integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/strings@5.7.0", "@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== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/transactions@5.7.0", "@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== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/web@5.7.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== - dependencies: - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/wordlists@5.7.0", "@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" - "@humanwhocodes/config-array@^0.11.14": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" @@ -815,6 +454,23 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@noble/curves@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + +"@noble/hashes@^1.3.3": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -841,82 +497,58 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz#ff17a80fb945f5102571f8efecb5ce5915cc4811" integrity sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A== -"@safe-global/api-kit@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@safe-global/api-kit/-/api-kit-1.3.0.tgz#3606aa52a3d5d0d46817fafc38572be7be1eaf31" - integrity sha512-3fdvoBtgufzmqmoBHir7vbS5N2t9Yc4kTeIJmAgmAGl8rHAy3z1bSv5uoEHYSMow34q1Am1aUar6vVAwwkIXhg== +"@safe-global/api-kit@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@safe-global/api-kit/-/api-kit-2.4.1.tgz#5f8b9825e6654dea2e96902a6047c25841d515a4" + integrity sha512-VLCJwBzspIGJSMwnj/1e9RAaIb0cXfp4qEVOsYqXFhMkpc5P8bZ4jGIbTRaEykELNIGJXpegdZkqlYyzABaERw== dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@safe-global/safe-core-sdk-types" "^2.2.0" - node-fetch "^2.6.6" + "@safe-global/protocol-kit" "^4.0.1" + "@safe-global/safe-core-sdk-types" "^5.0.1" + ethers "^6.12.1" + node-fetch "^2.7.0" -"@safe-global/protocol-kit@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@safe-global/protocol-kit/-/protocol-kit-1.2.0.tgz#5501fa0e2a1b4ad03cd5a4ee12bb9e799e1dd5a7" - integrity sha512-drU2uK30AZ4tqI/9ER7PGMD/lZp/5B9T02t+noTk7WF9Xb7HxskJd8GNU01KE55oyH31Y0AfXaE68H/f9lYa4A== +"@safe-global/protocol-kit@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@safe-global/protocol-kit/-/protocol-kit-4.0.1.tgz#88622f7909d93817ef8490e98a940e1c44c94934" + integrity sha512-dD3dJF33VbCeqH8B4RTSP2aupxO6rQbmtTr3mzKdsD05JHUoMHVty37fihQLCyxn23UUxTyuptFPBnczEsvPJw== dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/solidity" "^5.7.0" - "@safe-global/safe-deployments" "^1.26.0" + "@noble/hashes" "^1.3.3" + "@safe-global/safe-core-sdk-types" "^5.0.1" + "@safe-global/safe-deployments" "^1.36.0" + abitype "^1.0.2" ethereumjs-util "^7.1.5" - semver "^7.5.4" - web3 "^1.8.1" - web3-core "^1.8.1" - web3-utils "^1.8.1" + ethers "^6.12.1" + semver "^7.6.1" -"@safe-global/safe-core-sdk-types@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-2.2.0.tgz#2e34a5089035719e9a92a0bc6aa181c2edb0f108" - integrity sha512-vVG9qQnUYx+Xwsbuqraq25MPJX1I1aV1P81ZnHZa1lEMU7stqYWAmykUm/mvqsm8+AsvEB/wBKlFjbFJ/duzoA== +"@safe-global/safe-core-sdk-types@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-5.0.1.tgz#0ccfb83b37e18b2683901f6879d0d25fcf676346" + integrity sha512-xIlHZ9kaAIwEhR0OY0i2scdcQyrc0tDJ+eZZ04lhvg81cgYLY1Z5wfJQqazR2plPT1Hz0A9C79jYdUVvzoF/tw== dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/contracts" "^5.7.0" - "@safe-global/safe-deployments" "^1.26.0" - web3-core "^1.8.1" - web3-utils "^1.8.1" + abitype "^1.0.2" -"@safe-global/safe-deployments@^1.26.0": - version "1.26.0" - resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.26.0.tgz#b83615b3b5a66e736e08f8ecf2801ed988e9e007" - integrity sha512-Tw89O4/paT19ieMoiWQbqRApb0Bef/DxweS9rxodXAM5EQModkbyFXGZca+YxXE67sLvWjLr2jJUOxwze8mhGw== +"@safe-global/safe-deployments@^1.36.0": + version "1.37.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.37.0.tgz#3fc33fe03abcf404e261f3d5988791dd0a979558" + integrity sha512-OInLNWC9EPem/eOsvPdlq4Gt/08Nfhslm9z6T92Jvjmcu6hs85vjfnDP1NrzwcOmsCarATU5NH2bTITd9VNCPw== dependencies: - semver "^7.3.7" + semver "^7.6.0" -"@sindresorhus/is@^4.0.0", "@sindresorhus/is@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" - integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== - -"@skalenetwork/skale-contracts-ethers-v5@^1.0.1-develop.0": - version "1.0.1-develop.0" - resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts-ethers-v5/-/skale-contracts-ethers-v5-1.0.1-develop.0.tgz#868ad040b20033a06270d75491d26f486c709d04" - integrity sha512-A0R7LjX2vsCqQ6u/4ujZetAA5EY7Czq3vKv8NIhoDjpwn6LKZrI6dwywmsgw3DZUNE+31md1TiQEIjiHWscibA== +"@skalenetwork/skale-contracts-ethers-v6@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts-ethers-v6/-/skale-contracts-ethers-v6-1.0.0.tgz#2ec9e1e6113c0b0e0e7abaa492702baa9d647148" + integrity sha512-V9sttSFsntgQiQouxnL/Mr2pLQWX7hXy4fmM8d9x2UFfSbLCVXJth/n0YzEGSxEzjSN5IPvOBRJ4kdxyGauTUg== dependencies: - "@skalenetwork/skale-contracts" "1.0.1-develop.0" - ethers "^5.7.2" + "@skalenetwork/skale-contracts" "1.0.0" + ethers "^6.7.1" -"@skalenetwork/skale-contracts@1.0.1-develop.0": - version "1.0.1-develop.0" - resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts/-/skale-contracts-1.0.1-develop.0.tgz#4407ec4667cec27889263011f89badfd35d6ebf9" - integrity sha512-2IiRdso3ik4mOi6rX5mSMaKe3zgm13bMaUeez7ykN70xNDQteTCh0wSAE75ZK0g/dE5AGlfylW5H6lWeu3VMKQ== +"@skalenetwork/skale-contracts@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@skalenetwork/skale-contracts/-/skale-contracts-1.0.0.tgz#0135e67086714eebd7f936100714c3bcc89384df" + integrity sha512-uTvjAlfFL6XRa9p0ogcXO3k9w6bm1UCHRbtKsfb5VrnqQKcCsJoJ9sX55Rcj1YNVy4Dy2E5H8NFVhGUUp0rwtQ== dependencies: axios "^1.4.0" -"@szmarczak/http-timer@^4.0.5": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" - integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== - dependencies: - defer-to-connect "^2.0.0" - -"@szmarczak/http-timer@^5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" - integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== - dependencies: - defer-to-connect "^2.0.1" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -942,18 +574,18 @@ resolved "https://registry.yarnpkg.com/@tsconfig/recommended/-/recommended-1.0.2.tgz#1e198237225933e319718f082e78366e9f159d71" integrity sha512-dbHBtbWBOjq0/otpopAE02NT2Cm05Qe2JsEKeCf/wjSYbI2hz8nCqnpnOJWHATgjDz4fd3dchs3Wy1gQGjfN6w== -"@typechain/ethers-v5@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-9.0.0.tgz#6aa93bea7425c0463bd8a61eea3643540ef851bd" - integrity sha512-bAanuPl1L2itaUdMvor/QvwnIH+TM/CmG00q17Ilv3ZZMeJ2j8HcarhgJUZ9pBY1teBb85P8cC03dz3mSSx+tQ== +"@typechain/ethers-v6@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz#42fe214a19a8b687086c93189b301e2b878797ea" + integrity sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA== dependencies: lodash "^4.17.15" ts-essentials "^7.0.1" -"@typechain/hardhat@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-8.0.0.tgz#60568b7a2d0260cc741fb0830a8caee8eb06ac64" - integrity sha512-XUVbqlMx8tJTOmzZCD/r196CidtNWAnTBZRcYxjLTKgcJMvc/kHQpWBnVMMB5QHxVKpYpCiz8g07FYCpG8rrjA== +"@typechain/hardhat@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-9.1.0.tgz#6985015f01dfb37ef2ca8a29c742d05890351ddc" + integrity sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA== dependencies: fs-extra "^9.1.0" @@ -964,40 +596,11 @@ dependencies: "@types/node" "*" -"@types/bn.js@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== - dependencies: - "@types/node" "*" - -"@types/cacheable-request@^6.0.1", "@types/cacheable-request@^6.0.2": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" - integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "^3.1.4" - "@types/node" "*" - "@types/responselike" "^1.0.0" - -"@types/http-cache-semantics@*": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" - integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== - "@types/json-schema@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== -"@types/keyv@^3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" - integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== - dependencies: - "@types/node" "*" - "@types/node@*", "@types/node@^20.6.0": version "20.14.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.2.tgz#a5f4d2bcb4b6a87bffcaa717718c5a0f208f4a18" @@ -1005,10 +608,10 @@ dependencies: undici-types "~5.26.4" -"@types/node@^12.12.6": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -1022,13 +625,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== -"@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - "@types/secp256k1@^4.0.1": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" @@ -1131,18 +727,10 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -abortcontroller-polyfill@^1.7.3: - version "1.7.5" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" - integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== - -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" +abitype@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.3.tgz#a4b8c4ee97a14ba49eb3f9d1e7d83467966e5ac4" + integrity sha512-8EyPgBBHMtW56OslHWHJ4HEjU+2snjxibmwNjV2aBJp4oDfx1DcxO8sQ4jkxo/Iu6oQ79c6/ihsrBE2nBMlURg== acorn-jsx@^5.3.2: version "5.3.2" @@ -1159,12 +747,12 @@ acorn@^8.4.1, acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -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" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== -ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1218,11 +806,6 @@ array-back@^4.0.1, array-back@^4.0.2: resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== - array-timsort@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" @@ -1233,23 +816,6 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1260,21 +826,6 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" - integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== - axios@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" @@ -1289,51 +840,19 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-x@^3.0.2, base-x@^3.0.8: +base-x@^3.0.2: version "3.0.9" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== dependencies: safe-buffer "^5.0.1" -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - -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== - -bignumber.js@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== - blakejs@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== -bluebird@^3.5.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -bn.js@4.11.6: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== - -bn.js@^4.11.6, bn.js@^4.11.9: +bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -1343,47 +862,6 @@ bn.js@^5.1.2, bn.js@^5.2.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - -body-parser@^1.16.0: - version "1.20.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" - integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== - 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.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.2" - type-is "~1.6.18" - unpipe "1.0.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1439,77 +917,16 @@ bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" -buffer-to-arraybuffer@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ== - buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@^5.0.5, buffer@^5.5.0, buffer@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -bufferutil@^4.0.1: - version "4.0.7" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" - integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== - dependencies: - node-gyp-build "^4.3.0" - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - -cacheable-lookup@^6.0.4: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz#0330a543471c61faa4e9035db583aad753b36385" - integrity sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww== - -cacheable-request@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" - integrity sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg== - 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" - -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - callsites@^3.0.0, callsites@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== - chalk-template@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/chalk-template/-/chalk-template-1.1.0.tgz#ffc55db6dd745e9394b85327c8ac8466edb7a7b1" @@ -1539,22 +956,6 @@ chalk@^5.2.0, chalk@^5.3.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== -chownr@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -cids@^0.7.1: - version "0.7.5" - resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" - integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== - dependencies: - buffer "^5.5.0" - class-is "^1.1.0" - multibase "~0.6.0" - multicodec "^1.0.0" - multihashes "~0.4.15" - cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -1563,11 +964,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -class-is@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" - integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== - clear-module@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/clear-module/-/clear-module-4.1.2.tgz#5a58a5c9f8dccf363545ad7284cad3c887352a80" @@ -1576,13 +972,6 @@ clear-module@^4.1.2: parent-module "^2.0.0" resolve-from "^5.0.0" -clone-response@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" - integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== - dependencies: - mimic-response "^1.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1607,7 +996,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -1660,60 +1049,11 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-hash@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" - integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== - dependencies: - cids "^0.7.1" - multicodec "^0.5.5" - multihashes "^0.4.15" - -content-type@~1.0.4, content-type@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" - integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - core-util-is@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cors@^2.8.1: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -crc-32@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" - integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== - create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -1742,13 +1082,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@^3.1.4: - version "3.1.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" - integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== - dependencies: - node-fetch "2.6.7" - cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1869,28 +1202,6 @@ cspell@^8.8.3: strip-ansi "^7.1.0" vscode-uri "^3.0.8" -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - -debug@2.6.9, debug@^2.2.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1898,25 +1209,6 @@ debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: dependencies: ms "2.1.2" -decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== - -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== - dependencies: - mimic-response "^1.0.0" - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -1927,26 +1219,11 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -1966,25 +1243,7 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-walk@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" - integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.4: +elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -1997,59 +1256,11 @@ elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - env-paths@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-3.0.0.tgz#2f1e89c2f6dbd3408e1b1711dd82d62e317f58da" integrity sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A== -es5-ext@^0.10.35, es5-ext@^0.10.50: - version "0.10.62" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" - integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - next-tick "^1.1.0" - -es6-iterator@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-promise@^4.2.8: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-symbol@^3.1.1, es6-symbol@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -2155,47 +1366,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - -eth-ens-namehash@2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== - dependencies: - idna-uts46-hx "^2.3.1" - js-sha3 "^0.5.7" - -eth-lib@0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" - integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@^0.1.26: - version "0.1.29" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" - integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== - 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" - -ethereum-bloom-filters@^1.0.6: - version "1.0.10" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz#3ca07f4aed698e75bd134584850260246a5fed8a" - integrity sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA== - dependencies: - js-sha3 "^0.8.0" - ethereum-cryptography@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" @@ -2217,7 +1387,7 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" -ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: +ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== @@ -2228,54 +1398,18 @@ ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^5.7.2: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" - -ethjs-unit@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== - dependencies: - bn.js "4.11.6" - number-to-bn "1.7.0" - -eventemitter3@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" - integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== +ethers@^6.12.1, ethers@^6.7.1: + version "6.13.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.1.tgz#2b9f9c7455cde9d38b30fe6589972eb083652961" + integrity sha512-hdJ2HOxg/xx97Lm9HdCWk949BfYqYWpyw4//78SiwOLgASyfrNszfMUNB2joKjvGUdwhHfaiMMFFwacVVoLR9A== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.17.1" evp_bytestokey@^1.0.3: version "1.0.3" @@ -2292,65 +1426,6 @@ executioner@^2.0.1: dependencies: mixly "^1.0.0" -express@^4.14.0: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -ext@^1.1.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" - integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== - dependencies: - type "^2.7.2" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2417,19 +1492,6 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - find-replace@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" @@ -2481,23 +1543,6 @@ follow-redirects@^1.15.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - -form-data-encoder@1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96" - integrity sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg== - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -2507,34 +1552,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== - -fs-extra@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -2554,13 +1571,6 @@ fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2571,49 +1581,16 @@ fulcon@^1.0.1: resolved "https://registry.yarnpkg.com/fulcon/-/fulcon-1.0.2.tgz#8a4dfda4c73fcd9cc62a79d5045c392b45547320" integrity sha1-ik39pMc/zZzGKnnVBFw5K0VUcyA= -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - gensequence@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-7.0.0.tgz#bb6aedec8ff665e3a6c42f92823121e3a6ea7718" integrity sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" - integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" - get-stdin@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-stream@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -2659,14 +1636,6 @@ global-directory@^4.0.1: dependencies: ini "4.1.1" -global@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" - integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== - dependencies: - min-document "^2.19.0" - process "^0.11.10" - globals@^13.19.0: version "13.20.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" @@ -2686,49 +1655,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" - -got@12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/got/-/got-12.1.0.tgz#099f3815305c682be4fd6b0ee0726d8e4c6b0af4" - integrity sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig== - 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" - -got@^11.8.5: - version "11.8.6" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" - integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== - 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" - graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.2.9" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" @@ -2744,19 +1670,6 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2772,25 +1685,6 @@ has-own-prop@^2.0.0: resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== -has-symbols@^1.0.2, has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - hash-base@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" @@ -2800,7 +1694,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -2817,71 +1711,6 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -http-cache-semantics@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" - integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -http-https@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg== - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - -http2-wrapper@^2.1.10: - version "2.2.0" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.0.tgz#b80ad199d216b7d3680195077bd7b9060fa9d7f3" - integrity sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.2.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -idna-uts46-hx@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" - integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== - dependencies: - punycode "2.1.0" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" @@ -2913,7 +1742,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2931,41 +1760,11 @@ install-peers-cli@^2.2.0: commander "^2.20.0" executioner "^2.0.1" -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-callable@^1.1.3: - version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-function@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" - integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== - -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -2973,11 +1772,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: dependencies: is-extglob "^2.1.1" -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -2988,42 +1782,16 @@ is-path-inside@^3.0.3: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-typed-array@^1.1.10, is-typed-array@^1.1.3: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - -js-sha3@0.8.0, js-sha3@^0.8.0: +js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== - js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -3031,11 +1799,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -3046,21 +1809,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -3077,16 +1830,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - keccak@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" @@ -3096,13 +1839,6 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -keyv@^4.0.0: - version "4.5.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" - integrity sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug== - dependencies: - json-buffer "3.0.1" - keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" @@ -3140,16 +1876,6 @@ lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lowercase-keys@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" - integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== - make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -3164,26 +1890,11 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== - merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== - micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -3205,35 +1916,13 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-response@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== - dependencies: - dom-walk "^0.1.0" - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -3251,26 +1940,6 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -minipass@^2.6.0, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mixly@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/mixly/-/mixly-1.0.0.tgz#9b5a2e1f63e6dfba0d30e6797ffae62ab1dc24ef" @@ -3278,126 +1947,30 @@ mixly@^1.0.0: dependencies: fulcon "^1.0.1" -mkdirp-promise@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w== - dependencies: - mkdirp "*" - -mkdirp@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" - integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== - -mkdirp@^0.5.5: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mock-fs@^4.1.0: - version "4.14.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" - integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multibase@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" - integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multibase@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" - integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multicodec@^0.5.5: - version "0.5.7" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" - integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== - dependencies: - varint "^5.0.0" - -multicodec@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" - integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== - dependencies: - buffer "^5.6.0" - varint "^5.0.0" - -multihashes@^0.4.15, multihashes@~0.4.15: - version "0.4.21" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" - integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== - dependencies: - buffer "^5.5.0" - multibase "^0.7.0" - varint "^5.0.0" - -nano-json-stream-parser@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -next-tick@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" - integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== - node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^2.6.6: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== +node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -3406,54 +1979,7 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== -node-gyp-build@^4.3.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" - integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== - -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - -number-to-bn@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== - dependencies: - bn.js "4.11.6" - strip-hex-prefix "1.0.0" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-inspect@^1.9.0: - version "1.12.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" - integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== - -oboe@2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA== - dependencies: - http-https "^1.0.0" - -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -3472,16 +1998,6 @@ optionator@^0.9.3: prelude-ls "^1.2.1" type-check "^0.4.0" -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - -p-cancelable@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" - integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -3510,16 +2026,6 @@ parent-module@^2.0.0: dependencies: callsites "^3.1.0" -parse-headers@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.5.tgz#069793f9356a54008571eb7f9761153e6c770da9" - integrity sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA== - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3535,11 +2041,6 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -3556,11 +2057,6 @@ pbkdf2@^3.0.17: safe-buffer "^5.0.1" sha.js "^2.4.8" -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -3576,83 +2072,21 @@ prettier@^2.3.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - integrity sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA== - punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -punycode@^2.1.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - -query-string@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -3660,31 +2094,6 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -raw-body@2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -3704,37 +2113,6 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request@^2.79.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - 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" - -resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" - integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -3745,13 +2123,6 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -responselike@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" - integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== - dependencies: - lowercase-keys "^2.0.0" - reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -3786,22 +2157,12 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@~5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@3.0.1, 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== @@ -3815,61 +2176,16 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -semver@^7.3.7, semver@^7.5.4, semver@^7.6.2: +semver@^7.5.4, semver@^7.6.0, semver@^7.6.1, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - -servify@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== - dependencies: - body-parser "^1.16.0" - cors "^2.8.1" - express "^4.14.0" - request "^2.79.0" - xhr "^2.3.3" - setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -3890,59 +2206,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^2.7.0: - version "2.8.2" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.2.tgz#5708fb0919d440657326cd5fe7d2599d07705019" - integrity sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw== - dependencies: - decompress-response "^3.3.0" - once "^1.3.1" - simple-concat "^1.0.0" - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - 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" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== - string-format@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" @@ -3969,13 +2237,6 @@ strip-ansi@^7.1.0: dependencies: ansi-regex "^6.0.1" -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== - dependencies: - is-hex-prefixed "1.0.0" - strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -3995,23 +2256,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -swarm-js@^0.1.40: - version "0.1.42" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" - integrity sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ== - 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" - table-layout@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" @@ -4022,29 +2266,11 @@ table-layout@^1.0.2: typical "^5.2.0" wordwrapjs "^4.0.0" -tar@^4.0.2: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - 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" - text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -timed-out@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -4052,19 +2278,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -4109,17 +2322,10 @@ ts-node@^10.5.0: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" @@ -4133,28 +2339,10 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" - integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== - -typechain@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.2.0.tgz#bd4fc8f111d4405e36858bae6f744604617b60f3" - integrity sha512-tZqhqjxJ9xAS/Lh32jccTjMkpx7sTdUVVHAy5Bf0TIer5QFNYXotiX74oCvoVYjyxUKDK3MXHtMFzMyD3kE+jg== +typechain@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73" + integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q== dependencies: "@types/prettier" "^2.1.1" debug "^4.3.1" @@ -4167,13 +2355,6 @@ typechain@^8.2.0: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - typescript@^5.1.6: version "5.2.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" @@ -4189,11 +2370,6 @@ typical@^5.2.0: resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - undici-types@~5.26.4: version "5.26.5" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" @@ -4209,11 +2385,6 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -4221,78 +2392,16 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url-set-query@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== - -utf-8-validate@^5.0.2: - version "5.0.10" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" - integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== - dependencies: - node-gyp-build "^4.3.0" - -utf8@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -util@^0.12.5: - version "0.12.5" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" - integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - which-typed-array "^1.1.2" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -varint@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - -vary@^1, vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - vscode-languageserver-textdocument@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" @@ -4303,358 +2412,11 @@ vscode-uri@^3.0.8: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== -web3-bzz@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.10.0.tgz#ac74bc71cdf294c7080a79091079192f05c5baed" - integrity sha512-o9IR59io3pDUsXTsps5pO5hW1D5zBmg46iNc2t4j2DkaYHNdDLwk2IP9ukoM2wg47QILfPEJYzhTfkS/CcX0KA== - dependencies: - "@types/node" "^12.12.6" - got "12.1.0" - swarm-js "^0.1.40" - -web3-core-helpers@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.10.0.tgz#1016534c51a5df77ed4f94d1fcce31de4af37fad" - integrity sha512-pIxAzFDS5vnbXvfvLSpaA1tfRykAe9adw43YCKsEYQwH0gCLL0kMLkaCX3q+Q8EVmAh+e1jWL/nl9U0de1+++g== - dependencies: - web3-eth-iban "1.10.0" - web3-utils "1.10.0" - -web3-core-helpers@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.9.0.tgz#a1ca4ac7b9cec822886643312d2e98b0e4d8f1bc" - integrity sha512-NeJzylAp9Yj9xAt2uTT+kyug3X0DLnfBdnAcGZuY6HhoNPDIfQRA9CkJjLngVRlGTLZGjNp9x9eR+RyZQgUlXg== - dependencies: - web3-eth-iban "1.9.0" - web3-utils "1.9.0" - -web3-core-method@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.10.0.tgz#82668197fa086e8cc8066742e35a9d72535e3412" - integrity sha512-4R700jTLAMKDMhQ+nsVfIXvH6IGJlJzGisIfMKWAIswH31h5AZz7uDUW2YctI+HrYd+5uOAlS4OJeeT9bIpvkA== - dependencies: - "@ethersproject/transactions" "^5.6.2" - web3-core-helpers "1.10.0" - web3-core-promievent "1.10.0" - web3-core-subscriptions "1.10.0" - web3-utils "1.10.0" - -web3-core-method@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.9.0.tgz#81da8aa21503b470537c9f075f30adfad194a2d8" - integrity sha512-sswbNsY2xRBBhGeaLt9c/eDc+0yDDhi6keUBAkgIRa9ueSx/VKzUY9HMqiV6bXDcGT2fJyejq74FfEB4lc/+/w== - dependencies: - "@ethersproject/transactions" "^5.6.2" - web3-core-helpers "1.9.0" - web3-core-promievent "1.9.0" - web3-core-subscriptions "1.9.0" - web3-utils "1.9.0" - -web3-core-promievent@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.10.0.tgz#cbb5b3a76b888df45ed3a8d4d8d4f54ccb66a37b" - integrity sha512-68N7k5LWL5R38xRaKFrTFT2pm2jBNFaM4GioS00YjAKXRQ3KjmhijOMG3TICz6Aa5+6GDWYelDNx21YAeZ4YTg== - dependencies: - eventemitter3 "4.0.4" - -web3-core-promievent@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.9.0.tgz#2598a4d91b4edd3607366529f52bc96dee9f6d83" - integrity sha512-PHG1Mn23IGwMZhnPDN8dETKypqsFbHfiyRqP+XsVMPmTHkVfzDQTCBU/c2r6hUktBDoGKut5xZQpGfhFk71KbQ== - dependencies: - eventemitter3 "4.0.4" - -web3-core-requestmanager@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.10.0.tgz#4b34f6e05837e67c70ff6f6993652afc0d54c340" - integrity sha512-3z/JKE++Os62APml4dvBM+GAuId4h3L9ckUrj7ebEtS2AR0ixyQPbrBodgL91Sv7j7cQ3Y+hllaluqjguxvSaQ== - dependencies: - util "^0.12.5" - web3-core-helpers "1.10.0" - web3-providers-http "1.10.0" - web3-providers-ipc "1.10.0" - web3-providers-ws "1.10.0" - -web3-core-requestmanager@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.9.0.tgz#9d7d0e7f890cf7a24e9c568b9772c64d57fc4fcd" - integrity sha512-hcJ5PCtTIJpj+8qWxoseqlCovDo94JJjTX7dZOLXgwp8ah7E3WRYozhGyZocerx+KebKyg1mCQIhkDpMwjfo9Q== - dependencies: - util "^0.12.5" - web3-core-helpers "1.9.0" - web3-providers-http "1.9.0" - web3-providers-ipc "1.9.0" - web3-providers-ws "1.9.0" - -web3-core-subscriptions@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.10.0.tgz#b534592ee1611788fc0cb0b95963b9b9b6eacb7c" - integrity sha512-HGm1PbDqsxejI075gxBc5OSkwymilRWZufIy9zEpnWKNmfbuv5FfHgW1/chtJP6aP3Uq2vHkvTDl3smQBb8l+g== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.10.0" - -web3-core-subscriptions@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.9.0.tgz#dc67b478875dab1875844df3307a986dd7d468dd" - integrity sha512-MaIo29yz7hTV8X8bioclPDbHFOVuHmnbMv+D3PDH12ceJFJAXGyW8GL5KU1DYyWIj4TD1HM4WknyVA/YWBiiLA== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.9.0" - -web3-core@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.10.0.tgz#9aa07c5deb478cf356c5d3b5b35afafa5fa8e633" - integrity sha512-fWySwqy2hn3TL89w5TM8wXF1Z2Q6frQTKHWmP0ppRQorEK8NcHJRfeMiv/mQlSKoTS1F6n/nv2uyZsixFycjYQ== - dependencies: - "@types/bn.js" "^5.1.1" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.10.0" - web3-core-method "1.10.0" - web3-core-requestmanager "1.10.0" - web3-utils "1.10.0" - -web3-core@^1.8.1: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.9.0.tgz#9cfafb2f8c01931429108af75205610406a5a1ab" - integrity sha512-DZ+TPmq/ZLlx4LSVzFgrHCP/QFpKDbGWO4HoquZSdu24cjk5SZ+FEU1SZB2OaK3/bgBh+25mRbmv8y56ysUu1w== - dependencies: - "@types/bn.js" "^5.1.1" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.9.0" - web3-core-method "1.9.0" - web3-core-requestmanager "1.9.0" - web3-utils "1.9.0" - -web3-eth-abi@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.10.0.tgz#53a7a2c95a571e205e27fd9e664df4919483cce1" - integrity sha512-cwS+qRBWpJ43aI9L3JS88QYPfFcSJJ3XapxOQ4j40v6mk7ATpA8CVK1vGTzpihNlOfMVRBkR95oAj7oL6aiDOg== - dependencies: - "@ethersproject/abi" "^5.6.3" - web3-utils "1.10.0" - -web3-eth-accounts@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.10.0.tgz#2942beca0a4291455f32cf09de10457a19a48117" - integrity sha512-wiq39Uc3mOI8rw24wE2n15hboLE0E9BsQLdlmsL4Zua9diDS6B5abXG0XhFcoNsXIGMWXVZz4TOq3u4EdpXF/Q== - dependencies: - "@ethereumjs/common" "2.5.0" - "@ethereumjs/tx" "3.3.2" - eth-lib "0.2.8" - ethereumjs-util "^7.1.5" - scrypt-js "^3.0.1" - uuid "^9.0.0" - web3-core "1.10.0" - web3-core-helpers "1.10.0" - web3-core-method "1.10.0" - web3-utils "1.10.0" - -web3-eth-contract@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.10.0.tgz#8e68c7654576773ec3c91903f08e49d0242c503a" - integrity sha512-MIC5FOzP/+2evDksQQ/dpcXhSqa/2hFNytdl/x61IeWxhh6vlFeSjq0YVTAyIzdjwnL7nEmZpjfI6y6/Ufhy7w== - dependencies: - "@types/bn.js" "^5.1.1" - web3-core "1.10.0" - web3-core-helpers "1.10.0" - web3-core-method "1.10.0" - web3-core-promievent "1.10.0" - web3-core-subscriptions "1.10.0" - web3-eth-abi "1.10.0" - web3-utils "1.10.0" - -web3-eth-ens@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.10.0.tgz#96a676524e0b580c87913f557a13ed810cf91cd9" - integrity sha512-3hpGgzX3qjgxNAmqdrC2YUQMTfnZbs4GeLEmy8aCWziVwogbuqQZ+Gzdfrym45eOZodk+lmXyLuAdqkNlvkc1g== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - web3-core "1.10.0" - web3-core-helpers "1.10.0" - web3-core-promievent "1.10.0" - web3-eth-abi "1.10.0" - web3-eth-contract "1.10.0" - web3-utils "1.10.0" - -web3-eth-iban@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.10.0.tgz#5a46646401965b0f09a4f58e7248c8a8cd22538a" - integrity sha512-0l+SP3IGhInw7Q20LY3IVafYEuufo4Dn75jAHT7c2aDJsIolvf2Lc6ugHkBajlwUneGfbRQs/ccYPQ9JeMUbrg== - dependencies: - bn.js "^5.2.1" - web3-utils "1.10.0" - -web3-eth-iban@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.9.0.tgz#a8f838e42c20d49ff58aaa9f67ece47a968e40b1" - integrity sha512-jPAm77PuEs1kE/UrrBFJdPD2PN42pwfXA0gFuuw35bZezhskYML9W4QCxcqnUtceyEA4FUn7K2qTMuCk+23fog== - dependencies: - bn.js "^5.2.1" - web3-utils "1.9.0" - -web3-eth-personal@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.10.0.tgz#94d525f7a29050a0c2a12032df150ac5ea633071" - integrity sha512-anseKn98w/d703eWq52uNuZi7GhQeVjTC5/svrBWEKob0WZ5kPdo+EZoFN0sp5a5ubbrk/E0xSl1/M5yORMtpg== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.10.0" - web3-core-helpers "1.10.0" - web3-core-method "1.10.0" - web3-net "1.10.0" - web3-utils "1.10.0" - -web3-eth@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.10.0.tgz#38b905e2759697c9624ab080cfcf4e6c60b3a6cf" - integrity sha512-Z5vT6slNMLPKuwRyKGbqeGYC87OAy8bOblaqRTgg94CXcn/mmqU7iPIlG4506YdcdK3x6cfEDG7B6w+jRxypKA== - dependencies: - web3-core "1.10.0" - web3-core-helpers "1.10.0" - web3-core-method "1.10.0" - web3-core-subscriptions "1.10.0" - web3-eth-abi "1.10.0" - web3-eth-accounts "1.10.0" - web3-eth-contract "1.10.0" - web3-eth-ens "1.10.0" - web3-eth-iban "1.10.0" - web3-eth-personal "1.10.0" - web3-net "1.10.0" - web3-utils "1.10.0" - -web3-net@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.10.0.tgz#be53e7f5dafd55e7c9013d49c505448b92c9c97b" - integrity sha512-NLH/N3IshYWASpxk4/18Ge6n60GEvWBVeM8inx2dmZJVmRI6SJIlUxbL8jySgiTn3MMZlhbdvrGo8fpUW7a1GA== - dependencies: - web3-core "1.10.0" - web3-core-method "1.10.0" - web3-utils "1.10.0" - -web3-providers-http@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.10.0.tgz#864fa48675e7918c9a4374e5f664b32c09d0151b" - integrity sha512-eNr965YB8a9mLiNrkjAWNAPXgmQWfpBfkkn7tpEFlghfww0u3I0tktMZiaToJVcL2+Xq+81cxbkpeWJ5XQDwOA== - dependencies: - abortcontroller-polyfill "^1.7.3" - cross-fetch "^3.1.4" - es6-promise "^4.2.8" - web3-core-helpers "1.10.0" - -web3-providers-http@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.9.0.tgz#93cd3eb42fff974c9f7634ede1a9795d6435c3fe" - integrity sha512-5+dMNDAE0rRFz6SJpfnBqlVi2J5bB/Ivr2SanMt2YUrkxW5t8betZbzVwRkTbwtUvkqgj3xeUQzqpOttiv+IqQ== - dependencies: - abortcontroller-polyfill "^1.7.3" - cross-fetch "^3.1.4" - es6-promise "^4.2.8" - web3-core-helpers "1.9.0" - -web3-providers-ipc@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.10.0.tgz#9747c7a6aee96a51488e32fa7c636c3460b39889" - integrity sha512-OfXG1aWN8L1OUqppshzq8YISkWrYHaATW9H8eh0p89TlWMc1KZOL9vttBuaBEi96D/n0eYDn2trzt22bqHWfXA== - dependencies: - oboe "2.1.5" - web3-core-helpers "1.10.0" - -web3-providers-ipc@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.9.0.tgz#db486cb0dde9062ac6055478861e3d37535924d2" - integrity sha512-cPXU93Du40HCylvjaa5x62DbnGqH+86HpK/+kMcFIzF6sDUBhKpag2tSbYhGbj7GMpfkmDTUiiMLdWnFV6+uBA== - dependencies: - oboe "2.1.5" - web3-core-helpers "1.9.0" - -web3-providers-ws@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.10.0.tgz#cb0b87b94c4df965cdf486af3a8cd26daf3975e5" - integrity sha512-sK0fNcglW36yD5xjnjtSGBnEtf59cbw4vZzJ+CmOWIKGIR96mP5l684g0WD0Eo+f4NQc2anWWXG74lRc9OVMCQ== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.10.0" - websocket "^1.0.32" - -web3-providers-ws@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.9.0.tgz#568330766e8abbb6eb43e1153a72fb24398fcb7e" - integrity sha512-JRVsnQZ7j2k1a2yzBNHe39xqk1ijOv01dfIBFw52VeEkSRzvrOcsPIM/ttSyBuJqt70ntMxXY0ekCrqfleKH/w== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.9.0" - websocket "^1.0.32" - -web3-shh@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.10.0.tgz#c2979b87e0f67a7fef2ce9ee853bd7bfbe9b79a8" - integrity sha512-uNUUuNsO2AjX41GJARV9zJibs11eq6HtOe6Wr0FtRUcj8SN6nHeYIzwstAvJ4fXA53gRqFMTxdntHEt9aXVjpg== - dependencies: - web3-core "1.10.0" - web3-core-method "1.10.0" - web3-core-subscriptions "1.10.0" - web3-net "1.10.0" - -web3-utils@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.0.tgz#ca4c1b431a765c14ac7f773e92e0fd9377ccf578" - integrity sha512-kSaCM0uMcZTNUSmn5vMEhlo02RObGNRRCkdX0V9UTAU0+lrvn0HSaudyCo6CQzuXUsnuY2ERJGCGPfeWmv19Rg== - dependencies: - bn.js "^5.2.1" - ethereum-bloom-filters "^1.0.6" - ethereumjs-util "^7.1.0" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - utf8 "3.0.0" - -web3-utils@1.9.0, web3-utils@^1.8.1: - version "1.9.0" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.9.0.tgz#7c5775a47586cefb4ad488831be8f6627be9283d" - integrity sha512-p++69rCNNfu2jM9n5+VD/g26l+qkEOQ1m6cfRQCbH8ZRrtquTmrirJMgTmyOoax5a5XRYOuws14aypCOs51pdQ== - dependencies: - bn.js "^5.2.1" - ethereum-bloom-filters "^1.0.6" - ethereumjs-util "^7.1.0" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - utf8 "3.0.0" - -web3@^1.8.1: - version "1.10.0" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.10.0.tgz#2fde0009f59aa756c93e07ea2a7f3ab971091274" - integrity sha512-YfKY9wSkGcM8seO+daR89oVTcbu18NsVfvOngzqMYGUU0pPSQmE57qQDvQzUeoIOHAnXEBNzrhjQJmm8ER0rng== - dependencies: - web3-bzz "1.10.0" - web3-core "1.10.0" - web3-eth "1.10.0" - web3-eth-personal "1.10.0" - web3-net "1.10.0" - web3-shh "1.10.0" - web3-utils "1.10.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -websocket@^1.0.32: - version "1.0.34" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" - integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -4663,18 +2425,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-typed-array@^1.1.2: - version "1.1.9" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" - integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -4695,70 +2445,16 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -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@^3.0.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" +ws@8.17.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xdg-basedir@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== -xhr-request-promise@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" - integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== - dependencies: - xhr-request "^1.1.0" - -xhr-request@^1.0.1, xhr-request@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== - 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" - -xhr@^2.0.4, xhr@^2.3.3: - version "2.6.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" - integrity sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA== - dependencies: - global "~4.4.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -yaeti@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug== - -yallist@^3.0.0, yallist@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yaml@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.2.tgz#7a2b30f2243a5fc299e1f14ca58d475ed4bc5362" From 9fab9c29b10f84cf83d26239a5cc8817a81c3b29 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 8 Jul 2024 17:41:02 +0300 Subject: [PATCH 39/44] Fix networks --- src/gnosis-safe.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index cdf18f8..a25a73a 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -12,7 +12,6 @@ import chalk from "chalk"; // Cspell:words arbitrum celo sepolia xdai - // Constants const URLS = { @@ -21,35 +20,38 @@ const URLS = { "https://safe-transaction-mainnet.safe.global", [Network.from("arbitrum").chainId.toString()]: "https://safe-transaction-arbitrum.safe.global", - [Network.from("aurora").chainId.toString()]: - "https://safe-transaction-aurora.safe.global", - [Network.from("avalanche").chainId.toString()]: - "https://safe-transaction-avalanche.safe.global", [Network.from("base").chainId.toString()]: "https://safe-transaction-base.safe.global", [Network.from("base-sepolia").chainId.toString()]: "https://safe-transaction-base-sepolia.safe.global", [Network.from("bnb").chainId.toString()]: "https://safe-transaction-bsc.safe.global", - [Network.from("celo").chainId.toString()]: - "https://safe-transaction-celo.safe.global", [Network.from("xdai").chainId.toString()]: "https://safe-transaction-gnosis-chain.safe.global", [Network.from("optimism").chainId.toString()]: "https://safe-transaction-optimism.safe.global", [Network.from("matic").chainId.toString()]: "https://safe-transaction-polygon.safe.global", + [Network.from("sepolia").chainId.toString()]: + "https://safe-transaction-sepolia.safe.global", + // Aurora + "0x4e454152": + "https://safe-transaction-aurora.safe.global", // Polygon zkEVM "1101": "https://safe-transaction-zkevm.safe.global", // ZkSync Era Mainnet "324": - "https://safe-transaction-zksync.safe.global", + "https://safe-transaction-zksync.safe.global", + // Celo + "42220": + "https://safe-transaction-celo.safe.global", + // Avalanche + "43114": + "https://safe-transaction-avalanche.safe.global", // Scroll "534352": "https://safe-transaction-scroll.safe.global", - [Network.from("sepolia").chainId.toString()]: - "https://safe-transaction-sepolia.safe.global", } }; From fb5553ecf5b37a16c0243e7bf4a06a468bb63eb9 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Tue, 9 Jul 2024 19:12:02 +0300 Subject: [PATCH 40/44] Add semaphore --- package.json | 3 ++- src/upgrader.ts | 20 +++++++++++++++++++- yarn.lock | 5 +++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4ed4103..1c68913 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "@safe-global/safe-core-sdk-types": "^5.0.1", "@skalenetwork/skale-contracts-ethers-v6": "^1.0.0", "axios": "^1.4.0", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.4", + "semaphore-async-await": "^1.5.1" }, "peerDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.0", diff --git a/src/upgrader.ts b/src/upgrader.ts index e70f194..09b379b 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -5,6 +5,7 @@ import {EXIT_CODES} from "./exitCodes"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v6"; import {NonceProvider} from "./nonceProvider"; import {ProxyAdmin} from "../typechain-types"; +import Semaphore from 'semaphore-async-await'; import {Submitter} from "./submitters/submitter"; import {Transaction} from "ethers"; import chalk from "chalk"; @@ -30,6 +31,10 @@ interface Project { const withoutNull = (array: Array) => array. filter((element) => element !== null) as Array; +const maxSimultaneousDeployments = 10; +// 10 minutes +const deployTimeout = 60e4; + export abstract class Upgrader { instance: Instance; @@ -46,6 +51,8 @@ export abstract class Upgrader { nonceProvider?: NonceProvider; + deploySemaphore: Semaphore; + constructor ( project: Project, submitter: Submitter = new AutoSubmitter() @@ -59,6 +66,7 @@ export abstract class Upgrader { this.projectName = project.name; this.transactions = []; this.submitter = submitter; + this.deploySemaphore = new Semaphore(maxSimultaneousDeployments); } // Abstract @@ -187,12 +195,21 @@ export abstract class Upgrader { this.nonceProvider ??= await NonceProvider.createForWallet(deployer); const contracts = await Promise.all(this.contractNamesToUpgrade. map( - this.deployNewImplementation, + this.protectedDeployNewImplementation, this )); return withoutNull(contracts); } + private async protectedDeployNewImplementation (contract: string) { + await this.deploySemaphore.acquire(); + try { + return this.deployNewImplementation(contract); + } finally { + this.deploySemaphore.release(); + } + } + private async deployNewImplementation (contract: string) { const contractFactory = await getContractFactoryAndUpdateManifest( contract, @@ -210,6 +227,7 @@ export abstract class Upgrader { proxyAddress, contractFactory, { + "timeout": deployTimeout, "txOverrides": { "nonce": this.nonceProvider?.reserveNonce() }, diff --git a/yarn.lock b/yarn.lock index dda6473..28483e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2176,6 +2176,11 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +semaphore-async-await@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" + integrity sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg== + semver@^7.5.4, semver@^7.6.0, semver@^7.6.1, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" From 2ede5c83db1682558c8c37242671cc3289b7d473 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Tue, 9 Jul 2024 19:30:12 +0300 Subject: [PATCH 41/44] Fix protection --- src/upgrader.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index 09b379b..5d1fe94 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -203,11 +203,13 @@ export abstract class Upgrader { private async protectedDeployNewImplementation (contract: string) { await this.deploySemaphore.acquire(); + let result: ContractToUpgrade | null = null; try { - return this.deployNewImplementation(contract); + result = await this.deployNewImplementation(contract); } finally { this.deploySemaphore.release(); } + return result; } private async deployNewImplementation (contract: string) { From b87cd5bd33e576577bd2fd6a65fcf06b0b27fd8b Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 10 Jul 2024 16:01:25 +0300 Subject: [PATCH 42/44] Reduce the limit --- src/upgrader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index 5d1fe94..8105f39 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -31,7 +31,7 @@ interface Project { const withoutNull = (array: Array) => array. filter((element) => element !== null) as Array; -const maxSimultaneousDeployments = 10; +const maxSimultaneousDeployments = 5; // 10 minutes const deployTimeout = 60e4; From aa9ee61712cfa91eeae30618d2dd64291dc669f1 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 10 Jul 2024 18:33:55 +0300 Subject: [PATCH 43/44] Fix nonce issue --- src/nonceProvider.ts | 24 +++++++++++++++++++++--- src/upgrader.ts | 21 ++++++++++++++++----- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/nonceProvider.ts b/src/nonceProvider.ts index 3aa7a5b..23cd546 100644 --- a/src/nonceProvider.ts +++ b/src/nonceProvider.ts @@ -2,9 +2,11 @@ import {Signer} from "ethers"; export class NonceProvider { currentNonce: number; + releasedNonces: number[]; constructor (nonce: number) { this.currentNonce = nonce; + this.releasedNonces = []; } static async createForWallet (signer: Signer) { @@ -12,8 +14,24 @@ export class NonceProvider { } reserveNonce () { - const nonce = this.currentNonce; - this.currentNonce += 1; - return nonce; + if (!this.releasedNonces) { + const nonce = this.currentNonce; + this.currentNonce += 1; + return nonce; + } + return this.releasedNonces.shift(); + } + + releaseNonce (nonce: number) { + if (NonceProvider.next(nonce) === this.currentNonce) { + this.currentNonce -= 1; + } else { + this.releasedNonces.push(nonce); + } + } + + private static next (nonce: number) { + const nextDiff = 1; + return nonce + nextDiff; } } diff --git a/src/upgrader.ts b/src/upgrader.ts index 8105f39..f5496f4 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,3 +1,4 @@ +import {ContractFactory, Transaction} from "ethers"; import {Manifest, getImplementationAddress} from "@openzeppelin/upgrades-core"; import {ethers, network, upgrades} from "hardhat"; import {AutoSubmitter} from "./submitters/auto-submitter"; @@ -7,7 +8,6 @@ import {NonceProvider} from "./nonceProvider"; import {ProxyAdmin} from "../typechain-types"; import Semaphore from 'semaphore-async-await'; import {Submitter} from "./submitters/submitter"; -import {Transaction} from "ethers"; import chalk from "chalk"; import {promises as fs} from "fs"; import {getContractFactoryAndUpdateManifest} from "./contractFactory"; @@ -31,7 +31,7 @@ interface Project { const withoutNull = (array: Array) => array. filter((element) => element !== null) as Array; -const maxSimultaneousDeployments = 5; +const maxSimultaneousDeployments = 8; // 10 minutes const deployTimeout = 60e4; @@ -221,17 +221,25 @@ export abstract class Upgrader { (await this.instance.getContract(contract)).getAddress(); console.log(`Prepare upgrade of ${contract}`); + + return this.prepareUpgrade(contract, proxyAddress, contractFactory); + } + + private async prepareUpgrade(contractName: string, proxyAddress: string, contractFactory: ContractFactory) { const currentImplementationAddress = await getImplementationAddress( network.provider, proxyAddress ); + + const nonce = this.nonceProvider?.reserveNonce(); + const newImplementationAddress = await upgrades.prepareUpgrade( proxyAddress, contractFactory, { "timeout": deployTimeout, "txOverrides": { - "nonce": this.nonceProvider?.reserveNonce() + nonce }, "unsafeAllowLinkedLibraries": true, "unsafeAllowRenames": true @@ -240,11 +248,14 @@ export abstract class Upgrader { if (newImplementationAddress !== currentImplementationAddress) { return { "implementationAddress": newImplementationAddress, - "name": contract, + "name": contractName, proxyAddress }; } - console.log(chalk.gray(`Contract ${contract} is up to date`)); + console.log(chalk.gray(`Contract ${contractName} is up to date`)); + if (nonce) { + this.nonceProvider?.releaseNonce(nonce); + } return null; } From 0cf5b3b7fff7659fcf4c99454e23af9b673e3d07 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 22 Jul 2024 17:12:13 +0300 Subject: [PATCH 44/44] Remove simultaneous deployments --- src/upgrader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/upgrader.ts b/src/upgrader.ts index f5496f4..0bf9dcc 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -31,7 +31,8 @@ interface Project { const withoutNull = (array: Array) => array. filter((element) => element !== null) as Array; -const maxSimultaneousDeployments = 8; +// TODO: Set to 8 when upgrade plugins become thread safe +const maxSimultaneousDeployments = 1; // 10 minutes const deployTimeout = 60e4;