From fc4e3812e6fc8b12074650feb8df049eca872bc7 Mon Sep 17 00:00:00 2001 From: halaprix Date: Wed, 20 Sep 2023 16:32:19 +0200 Subject: [PATCH 1/4] feat: add option to submit safe tx --- contracts/interfaces/IAccountGuard.sol | 2 + package.json | 6 +- scripts/common/addresses.ts | 4 +- scripts/common/deploy-system.ts | 2 + scripts/common/hardhat.utils.ts | 18 +- scripts/common/safe.ts | 88 +++++++ scripts/common/types.ts | 1 + scripts/deployment/deploy-aave-sl.ts | 162 ++++++------ yarn.lock | 329 +++++++++++++++++++++++-- 9 files changed, 486 insertions(+), 126 deletions(-) create mode 100644 scripts/common/safe.ts diff --git a/contracts/interfaces/IAccountGuard.sol b/contracts/interfaces/IAccountGuard.sol index ac07fb8b..dc78f4eb 100644 --- a/contracts/interfaces/IAccountGuard.sol +++ b/contracts/interfaces/IAccountGuard.sol @@ -6,6 +6,8 @@ interface IAccountGuard { function setWhitelist(address target, bool status) external; + function setWhitelistSend(address target, bool status) external; + function canCall(address proxy, address operator) external view returns (bool); function permit(address caller, address target, bool allowance) external; diff --git a/package.json b/package.json index 70de708d..60578f9b 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,10 @@ "@nomiclabs/hardhat-etherscan": "^2.1.7", "@nomiclabs/hardhat-waffle": "^2.0.1", "@oasisdex/multiply": "^0.2.10", + "@safe-global/safe-core-sdk": "^3.3.5", + "@safe-global/safe-core-sdk-types": "^2.3.0", + "@safe-global/safe-ethers-lib": "^1.9.4", + "@safe-global/safe-service-client": "^2.0.3", "@tenderly/hardhat-tenderly": "^1.1.6", "@typechain/ethers-v5": "^7.2.0", "@typechain/hardhat": "^2.3.1", @@ -84,7 +88,7 @@ }, "dependencies": { "@nomicfoundation/hardhat-network-helpers": "^1.0.7", - "@oasisdex/automation": "^1.5.2", + "@oasisdex/automation": "^1.5.8", "@openzeppelin/contracts": "^4.8.3", "@uniswap/swap-router-contracts": "1.3.0", "@uniswap/v3-core": "1.0.2-solc-0.8-simulate", diff --git a/scripts/common/addresses.ts b/scripts/common/addresses.ts index 588caf3c..c055da38 100644 --- a/scripts/common/addresses.ts +++ b/scripts/common/addresses.ts @@ -57,7 +57,7 @@ const addresses = { AUTOMATION_DPM_ADAPTER: '0xBf2ecA15bff7d9c52e19b5c34EcbD03Bb2fc9CF7', //TODO: add address after deployment AUTOMATION_AAVE_STOPLOSS_COMMAND: '0xDC1c84Aac43F21f103e9bD0B091a1B5cc6433554', AUTOMATION_DUMMY_AAVE: '0x0000000000000000000000000000000000000000', - AUTOMATION_AAVE_PROXY_ACTIONS: '0x0000000000000000000000000000000000000000', + AUTOMATION_AAVE_PROXY_ACTIONS: '0xE6738B3B0214d6042FdFc9a0F0F92b63F459D983', AUTOMATION_BOT_AGGREGATOR: '0x5f1d184204775fBB351C4b2C61a2fD4aAbd3fB76', CONSTANT_MULTIPLE_VALIDATOR: '0x75d956f875e2714bc37Bae38890Fa159eaB661Aa', UNISWAP_V2_ROUTER: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', @@ -68,6 +68,7 @@ const addresses = { DPM_GUARD: '0xCe91349d2A4577BBd0fC91Fe6019600e047f2847', MAKER_SECURITY_ADAPTER: '', MAKER_EXECUTABLE_ADAPTER: '', + GNOSIS_SAFE: '0x85f9b7408afE6CEb5E46223451f5d4b832B522dc', SIGNERS: [ '0x8ff028d1248e9ae2e904603057981c9957f5f963', '0x9bbb1c0a21b834e370c3ea268b2c1c53061470e7', @@ -133,6 +134,7 @@ const addresses = { MAKER_EXECUTABLE_ADAPTER: '', DPM_FACTORY: '0x53958191c3077eDe3Ca90Eb840283df063FC1be3', DPM_GUARD: '0x9319710C25cdaDDD1766F0bDE40F1A4034C17c7e', + GNOSIS_SAFE: '0x0000000000000000000000000000000000000000', SIGNERS: [ '0x909187e0f7340014f89cc35fb045515dc080b3e6', '0xa7063656a171cfdb05f3db28762e7c42429f3d06', diff --git a/scripts/common/deploy-system.ts b/scripts/common/deploy-system.ts index 7a5c7e85..5341b48a 100644 --- a/scripts/common/deploy-system.ts +++ b/scripts/common/deploy-system.ts @@ -15,6 +15,7 @@ import { MakerAutoTakeProfitCommandV2, AaveV3ProxyActions, AaveV3StopLossCommandV2, + IAccountGuard, } from '../../typechain' import { AAVEAdapter } from '../../typechain/AAVEAdapter' import { DPMAdapter } from '../../typechain/DPMAdapter' @@ -47,6 +48,7 @@ export interface DeployedSystem { aaveAdapter?: AAVEAdapter dpmAdapter?: DPMAdapter aaveProxyActions?: AaveV3ProxyActions + dpmGuard?: IAccountGuard } export interface DeploySystemArgs { diff --git a/scripts/common/hardhat.utils.ts b/scripts/common/hardhat.utils.ts index 8dbfdb8e..6c5f4c56 100644 --- a/scripts/common/hardhat.utils.ts +++ b/scripts/common/hardhat.utils.ts @@ -26,11 +26,6 @@ export class HardhatUtils { } public async getDefaultSystem(): Promise { - const serviceRegistry = await this.hre.ethers.getContractAt( - 'ServiceRegistry', - this.addresses.AUTOMATION_SERVICE_REGISTRY, - ) - return { serviceRegistry: await this.hre.ethers.getContractAt( 'ServiceRegistry', @@ -67,18 +62,13 @@ export class HardhatUtils { 'MakerBasicSellCommandV2', this.addresses.AUTOMATION_BASIC_SELL_COMMAND, ), - aaveAdapter: await this.hre.ethers.getContractAt( - 'AAVEAdapter', - await serviceRegistry.getRegisteredService(AutomationServiceName.AAVE_ADAPTER), - ), - dpmAdapter: await this.hre.ethers.getContractAt( - 'DPMAdapter', - await serviceRegistry.getRegisteredService(AutomationServiceName.DPM_ADAPTER), - ), + aaveAdapter: await this.hre.ethers.getContractAt('AAVEAdapter', this.addresses.AUTOMATION_AAVE_ADAPTER), + dpmAdapter: await this.hre.ethers.getContractAt('DPMAdapter', this.addresses.AUTOMATION_DPM_ADAPTER), aaveProxyActions: await this.hre.ethers.getContractAt( 'AaveV3ProxyActions', - await serviceRegistry.getRegisteredService(AutomationServiceName.AAVE_PROXY_ACTIONS), + this.addresses.AUTOMATION_AAVE_PROXY_ACTIONS, ), + dpmGuard: await this.hre.ethers.getContractAt('IAccountGuard', this.addresses.DPM_GUARD), } } diff --git a/scripts/common/safe.ts b/scripts/common/safe.ts new file mode 100644 index 00000000..ccdfb2d8 --- /dev/null +++ b/scripts/common/safe.ts @@ -0,0 +1,88 @@ +import Safe from '@safe-global/safe-core-sdk' +import { SafeTransactionDataPartial, MetaTransactionData } from '@safe-global/safe-core-sdk-types' +import hre, { ethers } from 'hardhat' +import EthersAdapter from '@safe-global/safe-ethers-lib' +import { HardhatUtils, Network } from './' +import SafeServiceClient from '@safe-global/safe-service-client' +import { DeployedSystem } from './deploy-system' +import chalk from 'chalk' + +export const addRegistryEntryMultisig = async ( + safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[], + network: Network, +) => { + const utils = new HardhatUtils(hre) + const safeOwner = hre.ethers.provider.getSigner(0) + const safeAddress = utils.addresses.GNOSIS_SAFE + const ethAdapter = new EthersAdapter({ + ethers, + signerOrProvider: safeOwner, + }) + const safe: Safe = await Safe.create({ + ethAdapter, + safeAddress, + }) + const service = new SafeServiceClient({ + txServiceUrl: `https://safe-transaction-${network}.safe.global`, + ethAdapter, + }) + const safeTx = await safe.createTransaction({ safeTransactionData }) + const safeTxHash = await safe.getTransactionHash(safeTx) + const senderAddress = await safeOwner.getAddress() + const signature = await safe.signTransactionHash(safeTxHash) + await service.proposeTransaction({ + safeAddress, + safeTransactionData: safeTx.data, + safeTxHash, + senderAddress, + senderSignature: signature.data, + }) +} + +export enum SafeTxType { + addNamedService, + setWhitelist, +} + +export function getSafePartialTransactionData( + system: DeployedSystem, + type: SafeTxType, + address: string, + hash?: string, + nameOrTriggerId?: string, +) { + switch (type) { + case SafeTxType.addNamedService: { + console.info( + `Adding ${chalk.bold(address)} to the service registry as ${chalk.bold( + nameOrTriggerId, + )} (hash: ${chalk.bold(hash)})`, + ) + return [ + { + to: system.serviceRegistry.address, + value: '0', + data: system.serviceRegistry.interface.encodeFunctionData('addNamedService', [ + hash as string, + address, + ]), + }, + ] + } + case SafeTxType.setWhitelist: { + console.info(`Adding ${chalk.bold(address)} to the whitelist`) + return [ + { + to: system.dpmGuard!.address, + value: '0', + data: system.dpmGuard!.interface.encodeFunctionData('setWhitelist', [address, true]), + }, + { + to: system.dpmGuard!.address, + value: '0', + data: system.dpmGuard!.interface.encodeFunctionData('setWhitelistSend', [address, true]), + }, + ] + } + } +} diff --git a/scripts/common/types.ts b/scripts/common/types.ts index b86b1fb2..95e944f8 100644 --- a/scripts/common/types.ts +++ b/scripts/common/types.ts @@ -29,6 +29,7 @@ export enum AutomationServiceName { UNISWAP_FACTORY = 'UNISWAP_FACTORY', DPM_ADAPTER = 'DPM_ADAPTER', AAVE_ADAPTER = 'AAVE_ADAPTER', + DPM_GUARD = 'DPM_GUARD', } export interface OneInchQuoteResponse { diff --git a/scripts/deployment/deploy-aave-sl.ts b/scripts/deployment/deploy-aave-sl.ts index 2645ac02..7f0a4dff 100644 --- a/scripts/deployment/deploy-aave-sl.ts +++ b/scripts/deployment/deploy-aave-sl.ts @@ -1,49 +1,14 @@ import { TriggerType } from '@oasisdex/automation' -import { constants } from 'ethers' import hre from 'hardhat' -import { AaveV3StopLossCommandV2, IAccountGuard, ServiceRegistry } from '../../typechain' +import { AaveV3ProxyActions__factory, AaveV3StopLossCommandV2, AaveV3StopLossCommandV2__factory } from '../../typechain' import { AaveV3ProxyActions } from '../../typechain/AaveV3ProxyActions' -import { DummyAaveWithdrawCommand } from '../../typechain/DummyAaveWithdrawCommand' -import { - getAdapterNameHash, - getCommandHash, - getExecuteAdapterNameHash, - getExternalNameHash, - HardhatUtils, -} from '../common' +import { getAdapterNameHash, getCommandHash, getExecuteAdapterNameHash, HardhatUtils, Network } from '../common' +import { SafeTxType, addRegistryEntryMultisig, getSafePartialTransactionData } from '../common/safe' +import chalk from 'chalk' -const createServiceRegistry = (utils: HardhatUtils, serviceRegistry: ServiceRegistry, overwrite: string[] = []) => { - return async (hash: string, address: string): Promise => { - if (utils.hre.network.name === 'local') { - const newSigner = await utils.impersonate('0x85f9b7408afE6CEb5E46223451f5d4b832B522dc') - serviceRegistry = serviceRegistry.connect(newSigner) +// TODO:move to env - const delay = await serviceRegistry.requiredDelay() - if (delay.toNumber() > 0) { - await serviceRegistry.changeRequiredDelay(0) - await utils.forwardTime(delay.toNumber() + 1) - await serviceRegistry.changeRequiredDelay(0) - } - } - - if (address === constants.AddressZero) { - console.log(`WARNING: attempted to add zero address to ServiceRegistry. Hash: ${hash}. Skipping...`) - return - } - - const existingAddress = await serviceRegistry.getServiceAddress(hash) - const gasSettings = await utils.getGasSettings() - if (existingAddress === constants.AddressZero) { - await (await serviceRegistry.addNamedService(hash, address, gasSettings)).wait() - } else if (overwrite.includes(hash)) { - await (await serviceRegistry.updateNamedService(hash, address, gasSettings)).wait() - } else { - console.log( - `WARNING: attempted to change service registry entry, but overwrite is not allowed. Hash: ${hash}. Address: ${address}, existing: ${existingAddress}`, - ) - } - } -} +const MULTISIG_DRY_RUN = true async function main() { const utils = new HardhatUtils(hre) // the hardhat network is coalesced to mainnet @@ -53,56 +18,79 @@ async function main() { console.log(`Network: ${network}`) const system = await utils.getDefaultSystem() - - console.log('Deploying AaveV3ProxyActions') - - system.aaveProxyActions = (await utils.deployContract(hre.ethers.getContractFactory('AaveV3ProxyActions'), [ - utils.addresses.WETH, - utils.addresses.AAVE_V3_POOL, - ])) as AaveV3ProxyActions - - const apa = await system.aaveProxyActions.deployed() - - const ensureServiceRegistryEntry = createServiceRegistry(utils, system.serviceRegistry, []) - - await ensureServiceRegistryEntry(getExternalNameHash('WETH'), utils.addresses.WETH) - - const ensureCorrectAdapter = async (address: string, adapter: string, isExecute = false) => { - if (!isExecute) { - await ensureServiceRegistryEntry(getAdapterNameHash(address), adapter) - } else { - await ensureServiceRegistryEntry(getExecuteAdapterNameHash(address), adapter) - } + const safeTxData = [] + + if (utils.addresses.AUTOMATION_AAVE_PROXY_ACTIONS === hre.ethers.constants.AddressZero) { + console.log(chalk.dim('Deploying AaveV3ProxyActions')) + + system.aaveProxyActions = await utils.deployContract( + hre.ethers.getContractFactory('AaveV3ProxyActions'), + [utils.addresses.WETH, utils.addresses.AAVE_V3_POOL], + ) + const apa = await system.aaveProxyActions.deployed() + safeTxData.push(...getSafePartialTransactionData(system, SafeTxType.setWhitelist, apa.address)) + console.log(chalk.dim('Deployed AaveV3ProxyActions: ' + apa.address)) + } + let stopLossCommand: AaveV3StopLossCommandV2 + if (utils.addresses.AUTOMATION_AAVE_STOPLOSS_COMMAND === hre.ethers.constants.AddressZero) { + console.log(chalk.dim('Deploying AaveV3StopLossCommandV2')) + + const tx = await utils.deployContract( + hre.ethers.getContractFactory('AaveV3StopLossCommandV2'), + [utils.addresses.AUTOMATION_SERVICE_REGISTRY, utils.addresses.SWAP], + ) + stopLossCommand = await tx.deployed() + console.log(chalk.dim('Deployed AaveV3StopLossCommandV2' + stopLossCommand.address)) + } else { + stopLossCommand = (await hre.ethers.getContractAt( + 'AaveV3StopLossCommandV2', + utils.addresses.AUTOMATION_AAVE_STOPLOSS_COMMAND, + )) as AaveV3StopLossCommandV2 } - console.log('Deployed AaveV3ProxyActions: ' + apa.address) - - const tx = (await utils.deployContract(hre.ethers.getContractFactory('AaveV3StopLossCommandV2'), [ - utils.addresses.AUTOMATION_SERVICE_REGISTRY, - utils.addresses.AAVE_V3_POOL, - apa.address, - ])) as AaveV3StopLossCommandV2 - - const stopLossCommand = await tx.deployed() - // TODO change 10 when the command is in common - const commandHash = getCommandHash(10) - - ensureServiceRegistryEntry(commandHash, stopLossCommand.address) - - await ensureCorrectAdapter(stopLossCommand.address, system.aaveAdapter!.address, true) - await ensureCorrectAdapter(stopLossCommand.address, system.dpmAdapter!.address, false) - - if (utils.hre.network.name === 'local') { - const guard = (await hre.ethers.getContractAt('IAccountGuard', utils.addresses.DPM_GUARD)) as IAccountGuard - const owner = await guard.owner() - const guardDeployer = await utils.impersonate(owner) - await guard.connect(guardDeployer).setWhitelist(apa.address, true) - await guard.connect(guardDeployer).setWhitelist(stopLossCommand.address, true) - console.log("Guard's whitelist updated") + const aaveStopLossToCollateralV2hash = getCommandHash(TriggerType.SparkStopLossToCollateralV2) + const aaveStopLossToDebtV2hash = getCommandHash(TriggerType.SparkStopLossToDebtV2) + const aaveStopLossAdapterHash = getAdapterNameHash(stopLossCommand.address) + const aaveStopLossExecuteAdapterHash = getExecuteAdapterNameHash(stopLossCommand.address) + + safeTxData.push( + ...getSafePartialTransactionData( + system, + SafeTxType.addNamedService, + stopLossCommand.address, + aaveStopLossToCollateralV2hash, + TriggerType.SparkStopLossToCollateralV2.toString(), + ), + ...getSafePartialTransactionData( + system, + SafeTxType.addNamedService, + stopLossCommand.address, + aaveStopLossToDebtV2hash, + TriggerType.SparkStopLossToDebtV2.toString(), + ), + ...getSafePartialTransactionData( + system, + SafeTxType.addNamedService, + system.dpmAdapter!.address, + aaveStopLossAdapterHash, + 'aaveStopLossAdapter', + ), + ...getSafePartialTransactionData( + system, + SafeTxType.addNamedService, + system.aaveAdapter!.address, + aaveStopLossExecuteAdapterHash, + 'aaveStopLossExecuteAdapter', + ), + ...getSafePartialTransactionData(system, SafeTxType.setWhitelist, stopLossCommand.address), + ) + if (MULTISIG_DRY_RUN) { + console.log(safeTxData) + } else { + await addRegistryEntryMultisig(safeTxData, hre.network.name as Network) } - console.log(`AaveV3StopLossCommandV2 Deployed: ${stopLossCommand!.address}`) - console.log(`AaveV3ProxyActions Deployed: ${apa!.address}`) + console.log("Guard's whitelist submitted for update") } main().catch(error => { diff --git a/yarn.lock b/yarn.lock index bb819a23..89f0d3b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -134,6 +134,11 @@ crc-32 "^1.2.0" ethereumjs-util "^7.1.5" +"@ethereumjs/rlp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" + integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== + "@ethereumjs/tx@^3.3.2": version "3.5.2" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.2.tgz#197b9b6299582ad84f9527ca961466fce2296c1c" @@ -142,6 +147,15 @@ "@ethereumjs/common" "^2.6.4" ethereumjs-util "^7.1.5" +"@ethereumjs/util@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" + integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== + dependencies: + "@ethereumjs/rlp" "^4.0.1" + ethereum-cryptography "^2.0.0" + micro-ftch "^0.3.1" + "@ethersproject/abi@5.0.0-beta.153": version "5.0.0-beta.153" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" @@ -245,7 +259,7 @@ dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.5.0": +"@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.5.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== @@ -411,7 +425,7 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/solidity@5.7.0": +"@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== @@ -542,16 +556,33 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" +"@noble/curves@1.1.0", "@noble/curves@~1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" + integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== + dependencies: + "@noble/hashes" "1.3.1" + "@noble/hashes@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== +"@noble/hashes@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" + integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== + "@noble/hashes@~1.1.1": version "1.1.4" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.4.tgz#2611ebf5764c1bf754da7c7794de4fb30512336d" integrity sha512-+PYsVPrTSqtVjatKt2A/Proukn2Yrz61OBThOCKErc5w2/r1Fh37vbDv0Eah7pyNltrmacjwTvdw3JoR+WE4TA== +"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@noble/secp256k1@1.6.3", "@noble/secp256k1@~1.6.0": version "1.6.3" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" @@ -809,10 +840,10 @@ "@types/sinon-chai" "^3.2.3" "@types/web3" "1.0.19" -"@oasisdex/automation@^1.5.2": - version "1.5.2" - resolved "https://registry.yarnpkg.com/@oasisdex/automation/-/automation-1.5.2.tgz#99810e1c48f5c02221ed358fb3dcd10a7966b0ca" - integrity sha512-+SRgQU617PGPN/qpPkW0Xz0f5MJ5mXIQVDKLV4ZYNVy6MyZJ9ihT+6ZN98b1hj2BJYAYvv0OQQz+SlMLP/zKMg== +"@oasisdex/automation@^1.5.8": + version "1.5.8" + resolved "https://registry.yarnpkg.com/@oasisdex/automation/-/automation-1.5.8.tgz#c40cb68e063cae4b6afd10079fa229f04bbb8169" + integrity sha512-XEETEpgAWG4xMM8yXK6/91yS6g0xrWh0MKwz8W7TfWIr1P9gGH6kjA1vA3olA1mWFuCuOWHlMpBxjYDI41HOFw== dependencies: ethers "^5.6.2" @@ -872,6 +903,76 @@ path-browserify "^1.0.0" url "^0.11.0" +"@safe-global/safe-core-sdk-types@^1.9.2": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-1.10.1.tgz#94331b982671d2f2b8cc23114c58baf63d460c81" + integrity sha512-BKvuYTLOlY16Rq6qCXglmnL6KxInDuXMFqZMaCzwDKiEh+uoHu3xCumG5tVtWOkCgBF4XEZXMqwZUiLcon7IsA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@safe-global/safe-deployments" "^1.20.2" + web3-core "^1.8.1" + web3-utils "^1.8.1" + +"@safe-global/safe-core-sdk-types@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-2.3.0.tgz#e3be109e58a2d224d1b89052563b04f3efed4bec" + integrity sha512-dU0KkDV1KJNf11ajbUjWiSi4ygdyWfhk1M50lTJWUdCn1/2Bsb/hICM8LoEk6DCoFumxaoCet02SmYakXsW2CA== + 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" + +"@safe-global/safe-core-sdk-utils@^1.7.4": + version "1.7.4" + resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-utils/-/safe-core-sdk-utils-1.7.4.tgz#810d36cf9629129a28eb1b9c6e690b163834b572" + integrity sha512-ITocwSWlFUA1K9VMP/eJiMfgbP/I9qDxAaFz7ukj5N5NZD3ihVQZkmqML6hjse5UhrfjCnfIEcLkNZhtB2XC2Q== + dependencies: + "@safe-global/safe-core-sdk-types" "^1.9.2" + semver "^7.3.8" + web3-utils "^1.8.1" + +"@safe-global/safe-core-sdk@^3.3.5": + version "3.3.5" + resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk/-/safe-core-sdk-3.3.5.tgz#30884639d368a9f50aa5fc96f78de87261ebdab3" + integrity sha512-ul+WmpxZOXgDIXrZ6MIHptThYbm0CVV3/rypMQEn4tZLkudh/yXK7EuWBFnx9prR3MePuku51Zcz9fu1vi7sfQ== + dependencies: + "@ethersproject/solidity" "^5.7.0" + "@safe-global/safe-core-sdk-types" "^1.9.2" + "@safe-global/safe-core-sdk-utils" "^1.7.4" + "@safe-global/safe-deployments" "^1.25.0" + ethereumjs-util "^7.1.5" + semver "^7.3.8" + web3-utils "^1.8.1" + zksync-web3 "^0.14.3" + +"@safe-global/safe-deployments@^1.20.2", "@safe-global/safe-deployments@^1.25.0", "@safe-global/safe-deployments@^1.26.0": + version "1.27.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.27.0.tgz#e074d88543d084764b8bef7e3bddd238ac0d6819" + integrity sha512-Fj6NW2JwSrC3vFIiheTRBGTAdZJSUtXk4rTkZgGoO8MnFM+pWU2pJU2rWzH3EYOXvrndxT2UxsiUIkTbmB2hkw== + dependencies: + semver "^7.3.7" + +"@safe-global/safe-ethers-lib@^1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@safe-global/safe-ethers-lib/-/safe-ethers-lib-1.9.4.tgz#049989a302c6f2010c574cf3a834b0cfb9cf67c5" + integrity sha512-WhzcmNun0s0VxeVQKRqaapV0vEpdm76zZBR2Du+S+58u1r57OjZkOSL2Gru0tdwkt3FIZZtE3OhDu09M70pVkA== + dependencies: + "@safe-global/safe-core-sdk-types" "^1.9.2" + "@safe-global/safe-core-sdk-utils" "^1.7.4" + ethers "5.7.2" + +"@safe-global/safe-service-client@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@safe-global/safe-service-client/-/safe-service-client-2.0.3.tgz#07d3d4dd7284cc765442e967aa1b0294dc3c5043" + integrity sha512-t5eOopQUbP5HxixG0/TUGxzzNetLrNCxnLtt2RTzDVdlvgf/QGHywUqlJ5/eF8YBeZO/TNz6uAoLUMJ0u69IAg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@safe-global/safe-core-sdk-types" "^1.9.2" + node-fetch "^2.6.6" + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" @@ -886,6 +987,15 @@ "@noble/secp256k1" "~1.6.0" "@scure/base" "~1.1.0" +"@scure/bip32@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.1.tgz#7248aea723667f98160f593d621c47e208ccbb10" + integrity sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A== + dependencies: + "@noble/curves" "~1.1.0" + "@noble/hashes" "~1.3.1" + "@scure/base" "~1.1.0" + "@scure/bip39@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.0.tgz#92f11d095bae025f166bef3defcc5bf4945d419a" @@ -894,6 +1004,14 @@ "@noble/hashes" "~1.1.1" "@scure/base" "~1.1.0" +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + "@sentry/core@5.30.0": version "5.30.0" resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" @@ -1093,6 +1211,13 @@ dependencies: "@types/node" "*" +"@types/bn.js@^5.1.1": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.2.tgz#162f5238c46f4bcbac07a98561724eca1fcf0c5e" + integrity sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg== + dependencies: + "@types/node" "*" + "@types/cacheable-request@^6.0.1": version "6.0.3" resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" @@ -1426,6 +1551,11 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" +abortcontroller-polyfill@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" + integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== + abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" @@ -3317,6 +3447,13 @@ cross-fetch@^2.1.0, cross-fetch@^2.1.1: node-fetch "^2.6.7" whatwg-fetch "^2.0.4" +cross-fetch@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983" + integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== + dependencies: + node-fetch "^2.6.12" + cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -3820,6 +3957,11 @@ es6-iterator@^2.0.3: 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" @@ -4332,6 +4474,16 @@ ethereum-cryptography@^1.0.3: "@scure/bip32" "1.1.0" "@scure/bip39" "1.1.0" +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz#18fa7108622e56481157a5cb7c01c0c6a672eb67" + integrity sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug== + dependencies: + "@noble/curves" "1.1.0" + "@noble/hashes" "1.3.1" + "@scure/bip32" "1.3.1" + "@scure/bip39" "1.2.1" + ethereum-waffle@^3.4.0: version "3.4.4" resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.4.4.tgz#1378b72040697857b7f5e8f473ca8f97a37b5840" @@ -4549,22 +4701,7 @@ ethereumjs-wallet@0.6.5: utf8 "^3.0.0" uuid "^3.3.2" -ethers@^4.0.32, ethers@^4.0.40: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.1, ethers@^5.5.2, ethers@^5.5.3, ethers@^5.6.1, ethers@^5.6.2, ethers@^5.7.0: +ethers@5.7.2, ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.1, ethers@^5.5.2, ethers@^5.5.3, ethers@^5.6.1, ethers@^5.6.2, ethers@^5.7.0: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -4600,6 +4737,21 @@ ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.1, ethers@^5.5.2, ethers@^5.5.3, ether "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@^4.0.32, ethers@^4.0.40: + version "4.0.49" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" + integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== + dependencies: + aes-js "3.0.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.4" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -7052,6 +7204,11 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micro-ftch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" + integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== + micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -7450,6 +7607,13 @@ node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@^2.6.12, node-fetch@^2.6.6: + 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" + node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -8783,6 +8947,13 @@ semver@^7.2.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8: dependencies: lru-cache "^6.0.0" +semver@^7.3.7: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -10046,7 +10217,7 @@ util.promisify@^1.0.0: has-symbols "^1.0.1" object.getownpropertydescriptors "^2.1.1" -util@^0.12.0: +util@^0.12.0, 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== @@ -10138,6 +10309,14 @@ web3-bzz@1.7.4: got "9.6.0" swarm-js "^0.1.40" +web3-core-helpers@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.10.2.tgz#bd47686c0e74ef4475713c581f9306a035ce8a74" + integrity sha512-1JfaNtox6/ZYJHNoI+QVc2ObgwEPeGF+YdxHZQ7aF5605BmlwM1Bk3A8xv6mg64jIRvEq1xX6k9oG6x7p1WgXQ== + dependencies: + web3-eth-iban "1.10.2" + web3-utils "1.10.2" + web3-core-helpers@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" @@ -10155,6 +10334,17 @@ web3-core-helpers@1.7.4: web3-eth-iban "1.7.4" web3-utils "1.7.4" +web3-core-method@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.10.2.tgz#4adf3f8c8d0776f0f320e583b791955c41037971" + integrity sha512-gG6ES+LOuo01MJHML4gnEt702M8lcPGMYZoX8UjZzmEebGrPYOY9XccpCrsFgCeKgQzM12SVnlwwpMod1+lcLg== + dependencies: + "@ethersproject/transactions" "^5.6.2" + web3-core-helpers "1.10.2" + web3-core-promievent "1.10.2" + web3-core-subscriptions "1.10.2" + web3-utils "1.10.2" + web3-core-method@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" @@ -10178,6 +10368,13 @@ web3-core-method@1.7.4: web3-core-subscriptions "1.7.4" web3-utils "1.7.4" +web3-core-promievent@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.10.2.tgz#13b380b69ee05c5bf075836be64c2f3b8bdc1a5f" + integrity sha512-Qkkb1dCDOU8dZeORkcwJBQRAX+mdsjx8LqFBB+P4W9QgwMqyJ6LXda+y1XgyeEVeKEmY1RCeTq9Y94q1v62Sfw== + dependencies: + eventemitter3 "4.0.4" + web3-core-promievent@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" @@ -10192,6 +10389,17 @@ web3-core-promievent@1.7.4: dependencies: eventemitter3 "4.0.4" +web3-core-requestmanager@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.10.2.tgz#f5b1264c6470c033f08e21210b0af0c23497c68a" + integrity sha512-nlLeNJUu6fR+ZbJr2k9Du/nN3VWwB4AJPY4r6nxUODAmykgJq57T21cLP/BEk6mbiFQYGE9TrrPhh4qWxQEtAw== + dependencies: + util "^0.12.5" + web3-core-helpers "1.10.2" + web3-providers-http "1.10.2" + web3-providers-ipc "1.10.2" + web3-providers-ws "1.10.2" + web3-core-requestmanager@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" @@ -10214,6 +10422,14 @@ web3-core-requestmanager@1.7.4: web3-providers-ipc "1.7.4" web3-providers-ws "1.7.4" +web3-core-subscriptions@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.10.2.tgz#d325483141ab1406241d6707b86fd6944e4b7ea6" + integrity sha512-MiWcKjz4tco793EPPPLc/YOJmYUV3zAfxeQH/UVTfBejMfnNvmfwKa2SBKfPIvKQHz/xI5bV2TF15uvJEucU7w== + dependencies: + eventemitter3 "4.0.4" + web3-core-helpers "1.10.2" + web3-core-subscriptions@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" @@ -10257,6 +10473,19 @@ web3-core@1.7.4: web3-core-requestmanager "1.7.4" web3-utils "1.7.4" +web3-core@^1.8.1: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.10.2.tgz#464a15335b3adecc4a1cdd53c89b995769059f03" + integrity sha512-qTn2UmtE8tvwMRsC5pXVdHxrQ4uZ6jiLgF5DRUVtdi7dPUmX18Dp9uxKfIfhGcA011EAn8P6+X7r3pvi2YRxBw== + dependencies: + "@types/bn.js" "^5.1.1" + "@types/node" "^12.12.6" + bignumber.js "^9.0.0" + web3-core-helpers "1.10.2" + web3-core-method "1.10.2" + web3-core-requestmanager "1.10.2" + web3-utils "1.10.2" + web3-eth-abi@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" @@ -10366,6 +10595,14 @@ web3-eth-ens@1.7.4: web3-eth-contract "1.7.4" web3-utils "1.7.4" +web3-eth-iban@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.10.2.tgz#f8e668034834c5be038adeb14c39b923e9257558" + integrity sha512-y8+Ii2XXdyHQMFNL2NWpBnXe+TVJ4ryvPlzNhObRRnIo4O4nLIXS010olLDMayozDzoUlmzCmBZJYc9Eev1g7A== + dependencies: + bn.js "^5.2.1" + web3-utils "1.10.2" + web3-eth-iban@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" @@ -10487,6 +10724,16 @@ web3-provider-engine@14.2.1: xhr "^2.2.0" xtend "^4.0.1" +web3-providers-http@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.10.2.tgz#8bd54b5bc5bcc50612fd52af65bd773f926045f7" + integrity sha512-G8abKtpkyKGpRVKvfjIF3I4O/epHP7mxXWN8mNMQLkQj1cjMFiZBZ13f+qI77lNJN7QOf6+LtNdKrhsTGU72TA== + dependencies: + abortcontroller-polyfill "^1.7.5" + cross-fetch "^4.0.0" + es6-promise "^4.2.8" + web3-core-helpers "1.10.2" + web3-providers-http@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" @@ -10503,6 +10750,14 @@ web3-providers-http@1.7.4: web3-core-helpers "1.7.4" xhr2-cookies "1.1.0" +web3-providers-ipc@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.10.2.tgz#4314a04c1d68f5d1cb2d047d027db97c85f921f7" + integrity sha512-lWbn6c+SgvhLymU8u4Ea/WOVC0Gqs7OJUvauejWz+iLycxeF0xFNyXnHVAi42ZJDPVI3vnfZotafoxcNNL7Sug== + dependencies: + oboe "2.1.5" + web3-core-helpers "1.10.2" + web3-providers-ipc@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" @@ -10520,6 +10775,15 @@ web3-providers-ipc@1.7.4: oboe "2.1.5" web3-core-helpers "1.7.4" +web3-providers-ws@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.10.2.tgz#00bf6e00080dd82b8ad7fbed657a6d20ecc532de" + integrity sha512-3nYSiP6grI5GvpkSoehctSywfCTodU21VY8bUtXyFHK/IVfDooNtMpd5lVIMvXVAlaxwwrCfjebokaJtKH2Iag== + dependencies: + eventemitter3 "4.0.4" + web3-core-helpers "1.10.2" + websocket "^1.0.32" + web3-providers-ws@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" @@ -10559,6 +10823,20 @@ web3-shh@1.7.4: web3-core-subscriptions "1.7.4" web3-net "1.7.4" +web3-utils@1.10.2, web3-utils@^1.8.1: + version "1.10.2" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.2.tgz#361103d28a94d5e2a87ba15d776a62c33303eb44" + integrity sha512-TdApdzdse5YR+5GCX/b/vQnhhbj1KSAtfrDtRW7YS0kcWp1gkJsN62gw6GzCaNTeXookB7UrLtmDUuMv65qgow== + dependencies: + "@ethereumjs/util" "^8.1.0" + bn.js "^5.2.1" + ethereum-bloom-filters "^1.0.6" + ethereum-cryptography "^2.1.2" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + web3-utils@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" @@ -11010,6 +11288,11 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +zksync-web3@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.3.tgz#64ac2a16d597464c3fc4ae07447a8007631c57c9" + integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ== + zksync-web3@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" From 36a64a391c62f863227d873e9960c593d2ad5b2f Mon Sep 17 00:00:00 2001 From: halaprix Date: Wed, 20 Sep 2023 16:34:28 +0200 Subject: [PATCH 2/4] chore: add docs --- scripts/common/safe.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/common/safe.ts b/scripts/common/safe.ts index ccdfb2d8..76e09cf2 100644 --- a/scripts/common/safe.ts +++ b/scripts/common/safe.ts @@ -7,6 +7,11 @@ import SafeServiceClient from '@safe-global/safe-service-client' import { DeployedSystem } from './deploy-system' import chalk from 'chalk' +/** + * Adds a registry entry using multisig. + * @param safeTransactionData - The transaction data to be executed on the safe. + * @param network - The network on which the transaction will be executed. + */ export const addRegistryEntryMultisig = async ( safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[], network: Network, @@ -44,6 +49,15 @@ export enum SafeTxType { setWhitelist, } +/** + * Returns an array of partial transaction data based on the provided parameters. + * @param system - The deployed system object. + * @param type - The type of safe transaction. + * @param address - The address to be added to the service registry or whitelist. + * @param hash - The hash of the named service to be added to the service registry. + * @param nameOrTriggerId - The name of service or trigger ID of the named service to be added to the service registry. + * @returns An array of partial transaction data. + */ export function getSafePartialTransactionData( system: DeployedSystem, type: SafeTxType, From ec07606eedd54302815d93d3b9ef0c7c120a5a40 Mon Sep 17 00:00:00 2001 From: halaprix Date: Wed, 20 Sep 2023 16:37:56 +0200 Subject: [PATCH 3/4] chore: check for adapters existance --- scripts/deployment/deploy-aave-sl.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/deployment/deploy-aave-sl.ts b/scripts/deployment/deploy-aave-sl.ts index 7f0a4dff..77c9e446 100644 --- a/scripts/deployment/deploy-aave-sl.ts +++ b/scripts/deployment/deploy-aave-sl.ts @@ -48,6 +48,15 @@ async function main() { )) as AaveV3StopLossCommandV2 } + if ( + !system.dpmAdapter || + !system.aaveAdapter || + system.dpmAdapter.address === hre.ethers.constants.AddressZero || + system.aaveAdapter.address === hre.ethers.constants.AddressZero + ) { + throw new Error('Missing adapters') + } + const aaveStopLossToCollateralV2hash = getCommandHash(TriggerType.SparkStopLossToCollateralV2) const aaveStopLossToDebtV2hash = getCommandHash(TriggerType.SparkStopLossToDebtV2) const aaveStopLossAdapterHash = getAdapterNameHash(stopLossCommand.address) @@ -71,14 +80,14 @@ async function main() { ...getSafePartialTransactionData( system, SafeTxType.addNamedService, - system.dpmAdapter!.address, + system.dpmAdapter.address, aaveStopLossAdapterHash, 'aaveStopLossAdapter', ), ...getSafePartialTransactionData( system, SafeTxType.addNamedService, - system.aaveAdapter!.address, + system.aaveAdapter.address, aaveStopLossExecuteAdapterHash, 'aaveStopLossExecuteAdapter', ), From 57a3ab72ae3e3b2223c4fabf9ab5ebc4ddf2e8f2 Mon Sep 17 00:00:00 2001 From: halaprix Date: Wed, 20 Sep 2023 16:42:10 +0200 Subject: [PATCH 4/4] chore: exit --- scripts/deployment/deploy-aave-sl.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/deployment/deploy-aave-sl.ts b/scripts/deployment/deploy-aave-sl.ts index 77c9e446..7518bf28 100644 --- a/scripts/deployment/deploy-aave-sl.ts +++ b/scripts/deployment/deploy-aave-sl.ts @@ -102,7 +102,8 @@ async function main() { console.log("Guard's whitelist submitted for update") } -main().catch(error => { - console.error(error) - process.exitCode = 1 -}) +main() + .catch(error => { + console.error(error) + }) + .finally(() => process.exit())