From 584950a92b55ce92a17c365e76835f3f9866d04d Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:43:09 +0200 Subject: [PATCH 01/10] Fix deployRegistrar > update index fund registrar instead of owner (error) --- tasks/deploy/deployRegistrar.ts | 4 +- tasks/manage/indexFund/index.ts | 1 + tasks/manage/indexFund/updateRegistrar.ts | 54 +++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 tasks/manage/indexFund/updateRegistrar.ts diff --git a/tasks/deploy/deployRegistrar.ts b/tasks/deploy/deployRegistrar.ts index 8308a9a32..6dd96cbe9 100644 --- a/tasks/deploy/deployRegistrar.ts +++ b/tasks/deploy/deployRegistrar.ts @@ -102,8 +102,8 @@ task( newRegistrar: registrarDeployment.address, yes: true, }); - await hre.run("manage:IndexFund:updateOwner", { - to: registrarDeployment.address, + await hre.run("manage:IndexFund:updateRegistrar", { + newRegistrar: registrarDeployment.address, yes: true, }); diff --git a/tasks/manage/indexFund/index.ts b/tasks/manage/indexFund/index.ts index f0e651466..2b6ab803a 100644 --- a/tasks/manage/indexFund/index.ts +++ b/tasks/manage/indexFund/index.ts @@ -1 +1,2 @@ import "./updateOwner"; +import "./updateRegistrar"; diff --git a/tasks/manage/indexFund/updateRegistrar.ts b/tasks/manage/indexFund/updateRegistrar.ts new file mode 100644 index 000000000..9a804dae2 --- /dev/null +++ b/tasks/manage/indexFund/updateRegistrar.ts @@ -0,0 +1,54 @@ +import {task} from "hardhat/config"; +import {APTeamMultiSig__factory, IndexFund__factory} from "typechain-types"; +import {confirmAction, getAddresses, getSigners, logger} from "utils"; + +type TaskArgs = {newRegistrar: string; yes: boolean}; + +task("manage:IndexFund:updateRegistrar", "Will update the registrar address of the IndexFund") + .addOptionalParam( + "newRegistrar", + "Address of the new registrar. Will default to `contract-address.json > registrar.proxy` if none is provided." + ) + .addFlag("yes", "Automatic yes to prompt.") + .setAction(async (taskArgs: TaskArgs, hre) => { + try { + logger.divider(); + const addresses = await getAddresses(hre); + const {apTeamMultisigOwners} = await getSigners(hre); + + const newRegistrar = taskArgs.newRegistrar || addresses.registrar.proxy; + + logger.out("Querying current IndexFund registrar..."); + const indexFund = IndexFund__factory.connect( + addresses.indexFund.proxy, + apTeamMultisigOwners[0] + ); + const curRegistrar = (await indexFund.queryConfig()).registrarContract; + if (curRegistrar === newRegistrar) { + return logger.out(`"${newRegistrar}" is already set as the registrar address.`); + } + logger.out(`Current registrar: ${curRegistrar}`); + + const isConfirmed = + taskArgs.yes || (await confirmAction(`Update Registrar address to: ${newRegistrar}`)); + if (!isConfirmed) { + return logger.out("Confirmation denied.", logger.Level.Warn); + } + + logger.out(`Updating Registrar address to: ${newRegistrar}...`); + const curOwner = (await indexFund.queryConfig()).owner; + const apTeamMultiSig = APTeamMultiSig__factory.connect( + curOwner, // ensure connection to current owning APTeamMultiSig contract + apTeamMultisigOwners[0] + ); + const data = indexFund.interface.encodeFunctionData("updateRegistrar", [newRegistrar]); + const tx = await apTeamMultiSig.submitTransaction(indexFund.address, 0, data, "0x"); + logger.out(`Tx hash: ${tx.hash}`); + await tx.wait(); + + const updatedOwner = (await indexFund.queryConfig()).registrarContract; + logger.out(`New registrar: ${updatedOwner}`); + } catch (error) { + logger.out(error, logger.Level.Error); + } + }); From 375646d3b353a9a1b33887fc2c9e1306783e32e1 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:46:03 +0200 Subject: [PATCH 02/10] Add updateRegistrar function to GasFwdFactory --- contracts/core/gasFwd/GasFwdFactory.sol | 7 +++++++ contracts/core/gasFwd/IGasFwdFactory.sol | 2 ++ 2 files changed, 9 insertions(+) diff --git a/contracts/core/gasFwd/GasFwdFactory.sol b/contracts/core/gasFwd/GasFwdFactory.sol index 0e20ab468..a10ab234c 100644 --- a/contracts/core/gasFwd/GasFwdFactory.sol +++ b/contracts/core/gasFwd/GasFwdFactory.sol @@ -44,4 +44,11 @@ contract GasFwdFactory is IGasFwdFactory, Ownable { } impl = _impl; } + + function updateRegistrar(address _registrar) external onlyOwner { + if (_registrar == address(0)) { + revert InvalidAddress("_registrar"); + } + registrar = _registrar; + } } diff --git a/contracts/core/gasFwd/IGasFwdFactory.sol b/contracts/core/gasFwd/IGasFwdFactory.sol index f2811bfee..88b51d348 100644 --- a/contracts/core/gasFwd/IGasFwdFactory.sol +++ b/contracts/core/gasFwd/IGasFwdFactory.sol @@ -11,4 +11,6 @@ interface IGasFwdFactory { function create() external returns (address); function updateImplementation(address _impl) external; + + function updateRegistrar(address _impl) external; } From 73ea8efb702b9d1de2aea9e0c34d1f4b85effbff Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:48:54 +0200 Subject: [PATCH 03/10] Set proxyAdmin as the GasFwdFactory admin --- tasks/deploy/deployAngelProtocol.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/deploy/deployAngelProtocol.ts b/tasks/deploy/deployAngelProtocol.ts index 92405b13e..2d31ff68e 100644 --- a/tasks/deploy/deployAngelProtocol.ts +++ b/tasks/deploy/deployAngelProtocol.ts @@ -71,7 +71,7 @@ task("deploy:AngelProtocol", "Will deploy complete Angel Protocol") const gasFwd = await deployGasFwd( { - deployer: deployer, + deployer: proxyAdmin, admin: proxyAdmin, registrar: registrar?.address, }, From ef19440907b0483d10fc2e199236c82acccf10df Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:53:13 +0200 Subject: [PATCH 04/10] Make all fields public --- contracts/core/gasFwd/GasFwdFactory.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/core/gasFwd/GasFwdFactory.sol b/contracts/core/gasFwd/GasFwdFactory.sol index a10ab234c..ad3fd7a3c 100644 --- a/contracts/core/gasFwd/GasFwdFactory.sol +++ b/contracts/core/gasFwd/GasFwdFactory.sol @@ -8,9 +8,9 @@ import {IRegistrar} from "../registrar/interfaces/IRegistrar.sol"; import {RegistrarStorage} from "../registrar/storage.sol"; contract GasFwdFactory is IGasFwdFactory, Ownable { - address impl; - address admin; - address registrar; + address public impl; + address public admin; + address public registrar; constructor(address _impl, address _admin, address _registrar) { if (_impl == address(0)) { From 401eb64be19455a3514db5812150301b63042a51 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:54:00 +0200 Subject: [PATCH 05/10] Add manage:GasFwdFactory:updateRegistrar script --- tasks/manage/gasFwdFactory/updateRegistrar.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tasks/manage/gasFwdFactory/updateRegistrar.ts diff --git a/tasks/manage/gasFwdFactory/updateRegistrar.ts b/tasks/manage/gasFwdFactory/updateRegistrar.ts new file mode 100644 index 000000000..7dd689f5a --- /dev/null +++ b/tasks/manage/gasFwdFactory/updateRegistrar.ts @@ -0,0 +1,48 @@ +import {task} from "hardhat/config"; +import {GasFwdFactory__factory} from "typechain-types"; +import {confirmAction, getAddresses, getSigners, logger} from "utils"; + +type TaskArgs = {newRegistrar: string; yes: boolean}; + +task( + "manage:GasFwdFactory:updateRegistrar", + "Will update the registrar address of the GasFwdFactory" +) + .addOptionalParam( + "newRegistrar", + "Address of the new registrar. Will default to `contract-address.json > registrar.proxy` if none is provided." + ) + .addFlag("yes", "Automatic yes to prompt.") + .setAction(async (taskArgs: TaskArgs, hre) => { + try { + logger.divider(); + const addresses = await getAddresses(hre); + const {proxyAdmin} = await getSigners(hre); + + const newRegistrar = taskArgs.newRegistrar || addresses.registrar.proxy; + + logger.out("Querying current GasFwdFactory registrar..."); + const gasFwdFactory = GasFwdFactory__factory.connect(addresses.indexFund.proxy, proxyAdmin); + const curRegistrar = await gasFwdFactory.registrar(); + if (curRegistrar === newRegistrar) { + return logger.out(`"${newRegistrar}" is already set as the registrar address.`); + } + logger.out(`Current registrar: ${curRegistrar}`); + + const isConfirmed = + taskArgs.yes || (await confirmAction(`Update Registrar address to: ${newRegistrar}`)); + if (!isConfirmed) { + return logger.out("Confirmation denied.", logger.Level.Warn); + } + + logger.out(`Updating Registrar address to: ${newRegistrar}...`); + const tx = await gasFwdFactory.updateRegistrar(newRegistrar); + logger.out(`Tx hash: ${tx.hash}`); + await tx.wait(); + + const updatedRegistrar = await gasFwdFactory.registrar(); + logger.out(`New registrar: ${updatedRegistrar}`); + } catch (error) { + logger.out(error, logger.Level.Error); + } + }); From 08ea8939ffda7fef25dee18adf85f952fa7df307 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 08:54:11 +0200 Subject: [PATCH 06/10] Update GasFwdFactory registrar address in deployRegistrar --- tasks/deploy/deployRegistrar.ts | 4 ++++ tasks/manage/gasFwdFactory/index.ts | 1 + tasks/manage/index.ts | 1 + 3 files changed, 6 insertions(+) create mode 100644 tasks/manage/gasFwdFactory/index.ts diff --git a/tasks/deploy/deployRegistrar.ts b/tasks/deploy/deployRegistrar.ts index 6dd96cbe9..47e9fac0e 100644 --- a/tasks/deploy/deployRegistrar.ts +++ b/tasks/deploy/deployRegistrar.ts @@ -106,6 +106,10 @@ task( newRegistrar: registrarDeployment.address, yes: true, }); + await hre.run("manage:GasFwdFactory:updateRegistrar", { + newRegistrar: registrarDeployment.address, + yes: true, + }); if (!isLocalNetwork(hre) && !taskArgs.skipVerify) { await verify(hre, registrarDeployment); diff --git a/tasks/manage/gasFwdFactory/index.ts b/tasks/manage/gasFwdFactory/index.ts new file mode 100644 index 000000000..36c9e9a6f --- /dev/null +++ b/tasks/manage/gasFwdFactory/index.ts @@ -0,0 +1 @@ +import "./updateRegistrar"; diff --git a/tasks/manage/index.ts b/tasks/manage/index.ts index 5181a2924..a8bfcf747 100644 --- a/tasks/manage/index.ts +++ b/tasks/manage/index.ts @@ -5,6 +5,7 @@ import "./changeOwner"; import "./charityApplications"; import "./createEndowment"; import "./createIndexFund"; +import "./gasFwdFactory"; import "./indexFund"; import "./registrar"; import "./updateRegistrar"; From 54dc4857a69037cdb91bd0cae08da143ea78ebf5 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 09:02:02 +0200 Subject: [PATCH 07/10] Fix updateNetworkConnections script to use enum NetworkConnectionAction.POST --- contract-address.json | 78 ++++++++++++++++---------------- tasks/helpers/updateRegistrar.ts | 4 +- utils/constants.ts | 6 +++ 3 files changed, 47 insertions(+), 41 deletions(-) diff --git a/contract-address.json b/contract-address.json index e4463447a..596b0e23f 100644 --- a/contract-address.json +++ b/contract-address.json @@ -1,30 +1,30 @@ { "31337": { "accounts": { - "diamond": "0x1D99a347B5EcdbAa3C5365470d461Cf66B77ECd2", + "diamond": "0x73eccD6288e117cAcA738BDAD4FEC51312166C1A", "facets": { - "accountsDeployContract": "0xbe241D1B7b54bF06742cefd45A3440C6562f7603", - "accountsDepositWithdrawEndowments": "0x3c705dB336C81c7FEFC5746e283aB2c0781A4B7b", - "accountsDonationMatch": "0xA82ED5224ba72f2f776e09B11DC99E30Ee65Da8d", - "accountsAllowance": "0x1dBDba33dfA381bCC89FCe74DFF69Aa96B53b503", - "accountsCreateEndowment": "0x7798A400cBe0Ca14a7D614ECa1CD15adE5055413", - "accountsDaoEndowments": "0x17C8b71E5eE01A726766c99d397D619219C8CAF3", - "accountsQueryEndowments": "0xE4F89Fb0dBb45378633c05ACAb071eB998F0A736", - "accountsStrategy": "0x9Fe28b717aDE38BA99E32c45BE3Ee4291f2E338B", - "accountsSwapRouter": "0x7B3Be2dDDdDf9A0a3fE1DC57B98980F662C3a422", - "accountsUpdate": "0x8990C5DAAA40673eF8826990A6Fd8284a0a17d61", - "accountsUpdateEndowments": "0x90352F820342f8BE0012848bCB8aBd37877d7ec2", - "accountsUpdateEndowmentSettingsController": "0x82B642D9deDb3Ad19b8E99FF3792A49d4d9d85Bf", - "accountsUpdateStatusEndowments": "0xf69E1dFAc3D43F438Bae80090b8E186B0231CFeb", - "diamondCutFacet": "0x49FcbCC4E425add3a45AFC82F4dD0E5c227A0Ff8", - "diamondInitFacet": "0x84227190685c25c4aF662EE1bD0E4cd82e57360D", - "diamondLoupeFacet": "0xDDEec1224034F4A68A2697eF13379a014fa60261", - "ownershipFacet": "0x199c27B10a195ee79e02d50846e59A4aFB82CAD1" + "accountsDeployContract": "0xe6b98F104c1BEf218F3893ADab4160Dc73Eb8367", + "accountsDepositWithdrawEndowments": "0x1e2F4432bFeF9E9Ad39DA6d272F4aFf33629c770", + "accountsDonationMatch": "0x5C7c905B505f0Cf40Ab6600d05e677F717916F6B", + "accountsAllowance": "0x446e7636a5Fa9af46c3718719e465B547248bF62", + "accountsCreateEndowment": "0x505d59ffFd312983Cc0eD114d7F117B91520d742", + "accountsDaoEndowments": "0x0D4ff719551E23185Aeb16FFbF2ABEbB90635942", + "accountsQueryEndowments": "0xfbAb4aa40C202E4e80390171E82379824f7372dd", + "accountsStrategy": "0xcEC91d876E8f003110D43381359b1bAd124e7F2b", + "accountsSwapRouter": "0xed17543171C1459714cdC6519b58fFcC29A3C3c9", + "accountsUpdate": "0x85C5Dd61585773423e378146D4bEC6f8D149E248", + "accountsUpdateEndowments": "0x677df0cb865368207999F2862Ece576dC56D8dF6", + "accountsUpdateEndowmentSettingsController": "0x0Cf17D5DcDA9cF25889cEc9ae5610B0FB9725F65", + "accountsUpdateStatusEndowments": "0xAfe1b5bdEbD4ae65AF2024738bf0735fbb65d44b", + "diamondCutFacet": "0x2dE080e97B0caE9825375D31f5D0eD5751fDf16D", + "diamondInitFacet": "0x381445710b5e73d34aF196c53A3D5cDa58EDBf7A", + "diamondLoupeFacet": "0x2fc631e4B3018258759C52AF169200213e84ABab", + "ownershipFacet": "0x63cf2Cd54fE91e3545D1379abf5bfd194545259d" } }, "axelar": { - "gasService": "0x55cb3b67D9E65F0Cf4eABCAC84564a1bE6E3b06A", - "gateway": "0x7290f72B5C67052DDE8e6E179F7803c493e90d3f" + "gasService": "0x8464135c8F25Da09e49BC8782676a84730C318bC", + "gateway": "0x71C95911E9a5D330f4D621842EC243EE1343292e" }, "donationMatch": { "emitter": "", @@ -39,8 +39,8 @@ "proxy": "" }, "gasFwd": { - "factory": "0x87F850cbC2cFfac086F20d0d7307E12d06fA2127", - "implementation": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" + "factory": "0xF818A7C2AFC45cF4B9DDC48933C9A1edD624e46f", + "implementation": "0xC76A71C4492c11bbaDC841342C4Cb470b5d12193" }, "giftcards": { "implementation": "", @@ -101,8 +101,8 @@ "implementation": "" }, "indexFund": { - "implementation": "0x549bc7EE4B85A2Df5F74799f213483CE599F1999", - "proxy": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" + "implementation": "0xe0B39353F69b54e945364ffcdDD7901697Ca0166", + "proxy": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" }, "libraries": { "angelCoreStruct": "", @@ -110,29 +110,29 @@ }, "multiSig": { "charityApplications": { - "implementation": "0xDeBD0Bc00932E8b5bEfF65053989B0687c894b5F", - "proxy": "0xB0748F8B73C53aB94b3DD1109f3427B7Bb2907F5" + "implementation": "0x8613A4029EaA95dA61AE65380aC2e7366451bF2b", + "proxy": "0x20Fbd46DeEd5EEDEB6e5c87eeB31924e9CA312ad" }, "apTeam": { - "implementation": "0xa85b028984bC54A2a3D844B070544F59dDDf89DE", - "proxy": "0xD499f5F7d3C918D0e553BA03954c4E02af16B6e4" + "implementation": "0x05Aa229Aec102f78CE0E852A812a388F076Aa555", + "proxy": "0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52" }, "endowment": { "emitter": { - "implementation": "0x20F43316cf784C821a65aE874c8060f30c30c7C4", - "proxy": "0x9B4aC8FAfC44575C6963fA22D50963379e899a49" + "implementation": "0x130A46b6E41DB6E1e18fb9c759F223c459190e90", + "proxy": "0x55cb3b67D9E65F0Cf4eABCAC84564a1bE6E3b06A" }, - "factory": "0x34E59e53Bd4f1A60ca8b6c21572509027571341d", - "implementation": "0xEe54514745B056F07040CaCF801f59031D801431" + "factory": "0xAd5d57aD9bB17d34Debb88566ab2F5dB879Cc46F", + "implementation": "0xE5BD5bDC03371fB239956dbbF40bD185D6c2ea28" } }, "registrar": { - "implementation": "0xDadd1125B8Df98A66Abd5EB302C0d9Ca5A061dC2", - "proxy": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" + "implementation": "0x0f5D1ef48f12b6f691401bfe88c2037c690a6afe", + "proxy": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, "router": { - "implementation": "0x23d351BA89eaAc4E328133Cb48e050064C219A1E", - "proxy": "0x35D2F51DBC8b401B11fA3FE04423E0f5cd9fEDb4" + "implementation": "0x90118d110B07ABB82Ba8980D1c5cC96EeA810d2C", + "proxy": "0xcA03Dc4665A8C3603cb4Fd5Ce71Af9649dC00d44" }, "subDao": { "emitter": { @@ -147,9 +147,9 @@ "dai": "", "halo": "", "reserveToken": "", - "seedAsset": "0x0AFdAcD509e73115EA1654B1a770f1a807e7c9C0", - "usdc": "0x1a6a3e7Bb246158dF31d8f924B84D961669Ba4e5", - "wmatic": "0xBa3e08b4753E68952031102518379ED2fDADcA30" + "seedAsset": "0x948B3c65b89DF0B4894ABE91E6D02FE579834F8F", + "usdc": "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508", + "wmatic": "0xC6bA8C3233eCF65B761049ef63466945c362EdD2" }, "uniswap": { "factory": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", diff --git a/tasks/helpers/updateRegistrar.ts b/tasks/helpers/updateRegistrar.ts index 15a2d56ca..d70aec974 100644 --- a/tasks/helpers/updateRegistrar.ts +++ b/tasks/helpers/updateRegistrar.ts @@ -4,7 +4,7 @@ import { IAccountsStrategy, RegistrarMessages, } from "typechain-types/contracts/core/registrar/interfaces/IRegistrar"; -import {getSigners, logger, structToObject, validateAddress} from "utils"; +import {NetworkConnectionAction, getSigners, logger, structToObject, validateAddress} from "utils"; export async function updateRegistrarNetworkConnections( registrar = "", @@ -35,7 +35,7 @@ export async function updateRegistrarNetworkConnections( const updateNetworkConnectionsData = registrarContract.interface.encodeFunctionData( "updateNetworkConnections", - [network.name, {...curNetworkConnection, ...newNetworkInfo}, "post"] + [network.name, {...curNetworkConnection, ...newNetworkInfo}, NetworkConnectionAction.POST] ); const apTeamMultisigContract = APTeamMultiSig__factory.connect( apTeamMultisig, diff --git a/utils/constants.ts b/utils/constants.ts index 75b522865..ec01611db 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -3,3 +3,9 @@ import path from "path"; export const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000"; export const DEFAULT_CONTRACT_ADDRESS_FILE_PATH = path.join(__dirname, "../contract-address.json"); + +export enum NetworkConnectionAction { + NONE, + POST, + DELETE, +} From 4539e3e00f3b235a396b4435e830c8bfd9d2cfee Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 20 Jul 2023 09:04:35 +0200 Subject: [PATCH 08/10] Fix address used to connect to GasFwdFactory in manage:GasFwdFactory:updateRegistrar --- contract-address.json | 78 +++++++++---------- tasks/manage/gasFwdFactory/updateRegistrar.ts | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/contract-address.json b/contract-address.json index 596b0e23f..76625ed47 100644 --- a/contract-address.json +++ b/contract-address.json @@ -1,30 +1,30 @@ { "31337": { "accounts": { - "diamond": "0x73eccD6288e117cAcA738BDAD4FEC51312166C1A", + "diamond": "0x84227190685c25c4aF662EE1bD0E4cd82e57360D", "facets": { - "accountsDeployContract": "0xe6b98F104c1BEf218F3893ADab4160Dc73Eb8367", - "accountsDepositWithdrawEndowments": "0x1e2F4432bFeF9E9Ad39DA6d272F4aFf33629c770", - "accountsDonationMatch": "0x5C7c905B505f0Cf40Ab6600d05e677F717916F6B", - "accountsAllowance": "0x446e7636a5Fa9af46c3718719e465B547248bF62", - "accountsCreateEndowment": "0x505d59ffFd312983Cc0eD114d7F117B91520d742", - "accountsDaoEndowments": "0x0D4ff719551E23185Aeb16FFbF2ABEbB90635942", - "accountsQueryEndowments": "0xfbAb4aa40C202E4e80390171E82379824f7372dd", - "accountsStrategy": "0xcEC91d876E8f003110D43381359b1bAd124e7F2b", - "accountsSwapRouter": "0xed17543171C1459714cdC6519b58fFcC29A3C3c9", - "accountsUpdate": "0x85C5Dd61585773423e378146D4bEC6f8D149E248", - "accountsUpdateEndowments": "0x677df0cb865368207999F2862Ece576dC56D8dF6", - "accountsUpdateEndowmentSettingsController": "0x0Cf17D5DcDA9cF25889cEc9ae5610B0FB9725F65", - "accountsUpdateStatusEndowments": "0xAfe1b5bdEbD4ae65AF2024738bf0735fbb65d44b", - "diamondCutFacet": "0x2dE080e97B0caE9825375D31f5D0eD5751fDf16D", - "diamondInitFacet": "0x381445710b5e73d34aF196c53A3D5cDa58EDBf7A", - "diamondLoupeFacet": "0x2fc631e4B3018258759C52AF169200213e84ABab", - "ownershipFacet": "0x63cf2Cd54fE91e3545D1379abf5bfd194545259d" + "accountsDeployContract": "0xA82ED5224ba72f2f776e09B11DC99E30Ee65Da8d", + "accountsDepositWithdrawEndowments": "0x1dBDba33dfA381bCC89FCe74DFF69Aa96B53b503", + "accountsDonationMatch": "0x17C8b71E5eE01A726766c99d397D619219C8CAF3", + "accountsAllowance": "0x7798A400cBe0Ca14a7D614ECa1CD15adE5055413", + "accountsCreateEndowment": "0x7B3Be2dDDdDf9A0a3fE1DC57B98980F662C3a422", + "accountsDaoEndowments": "0x8990C5DAAA40673eF8826990A6Fd8284a0a17d61", + "accountsQueryEndowments": "0xf69E1dFAc3D43F438Bae80090b8E186B0231CFeb", + "accountsStrategy": "0x650aEF4b63095e4EDe581BC79CdeA927e3ba553A", + "accountsSwapRouter": "0x90352F820342f8BE0012848bCB8aBd37877d7ec2", + "accountsUpdate": "0xE4F89Fb0dBb45378633c05ACAb071eB998F0A736", + "accountsUpdateEndowments": "0x82B642D9deDb3Ad19b8E99FF3792A49d4d9d85Bf", + "accountsUpdateEndowmentSettingsController": "0x9Fe28b717aDE38BA99E32c45BE3Ee4291f2E338B", + "accountsUpdateStatusEndowments": "0xDDEec1224034F4A68A2697eF13379a014fa60261", + "diamondCutFacet": "0x1D99a347B5EcdbAa3C5365470d461Cf66B77ECd2", + "diamondInitFacet": "0xbe241D1B7b54bF06742cefd45A3440C6562f7603", + "diamondLoupeFacet": "0x199c27B10a195ee79e02d50846e59A4aFB82CAD1", + "ownershipFacet": "0x3c705dB336C81c7FEFC5746e283aB2c0781A4B7b" } }, "axelar": { - "gasService": "0x8464135c8F25Da09e49BC8782676a84730C318bC", - "gateway": "0x71C95911E9a5D330f4D621842EC243EE1343292e" + "gasService": "0x7290f72B5C67052DDE8e6E179F7803c493e90d3f", + "gateway": "0x0AFdAcD509e73115EA1654B1a770f1a807e7c9C0" }, "donationMatch": { "emitter": "", @@ -39,8 +39,8 @@ "proxy": "" }, "gasFwd": { - "factory": "0xF818A7C2AFC45cF4B9DDC48933C9A1edD624e46f", - "implementation": "0xC76A71C4492c11bbaDC841342C4Cb470b5d12193" + "factory": "0xB0748F8B73C53aB94b3DD1109f3427B7Bb2907F5", + "implementation": "0xDeBD0Bc00932E8b5bEfF65053989B0687c894b5F" }, "giftcards": { "implementation": "", @@ -101,8 +101,8 @@ "implementation": "" }, "indexFund": { - "implementation": "0xe0B39353F69b54e945364ffcdDD7901697Ca0166", - "proxy": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" + "implementation": "0x34E59e53Bd4f1A60ca8b6c21572509027571341d", + "proxy": "0x0165878A594ca255338adfa4d48449f69242Eb8F" }, "libraries": { "angelCoreStruct": "", @@ -110,29 +110,29 @@ }, "multiSig": { "charityApplications": { - "implementation": "0x8613A4029EaA95dA61AE65380aC2e7366451bF2b", - "proxy": "0x20Fbd46DeEd5EEDEB6e5c87eeB31924e9CA312ad" + "implementation": "0x549bc7EE4B85A2Df5F74799f213483CE599F1999", + "proxy": "0xEe54514745B056F07040CaCF801f59031D801431" }, "apTeam": { - "implementation": "0x05Aa229Aec102f78CE0E852A812a388F076Aa555", - "proxy": "0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52" + "implementation": "0xD499f5F7d3C918D0e553BA03954c4E02af16B6e4", + "proxy": "0xDadd1125B8Df98A66Abd5EB302C0d9Ca5A061dC2" }, "endowment": { "emitter": { - "implementation": "0x130A46b6E41DB6E1e18fb9c759F223c459190e90", - "proxy": "0x55cb3b67D9E65F0Cf4eABCAC84564a1bE6E3b06A" + "implementation": "0xa115891Cae16388b84cb7a521A2032f6b354FE25", + "proxy": "0x6ad448bF2AdbF3A7Aa9BfE411eD908315566aE24" }, - "factory": "0xAd5d57aD9bB17d34Debb88566ab2F5dB879Cc46F", - "implementation": "0xE5BD5bDC03371fB239956dbbF40bD185D6c2ea28" + "factory": "0x9B4aC8FAfC44575C6963fA22D50963379e899a49", + "implementation": "0x20F43316cf784C821a65aE874c8060f30c30c7C4" } }, "registrar": { - "implementation": "0x0f5D1ef48f12b6f691401bfe88c2037c690a6afe", - "proxy": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "implementation": "0x2572e04Caf46ba8692Bd6B4CBDc46DAA3cA9647E", + "proxy": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" }, "router": { - "implementation": "0x90118d110B07ABB82Ba8980D1c5cC96EeA810d2C", - "proxy": "0xcA03Dc4665A8C3603cb4Fd5Ce71Af9649dC00d44" + "implementation": "0x72F375F23BCDA00078Ac12e7e9E7f6a8CA523e7D", + "proxy": "0xf23B8c9debCdCEa2a40E81c3f6d786987069D40d" }, "subDao": { "emitter": { @@ -147,9 +147,9 @@ "dai": "", "halo": "", "reserveToken": "", - "seedAsset": "0x948B3c65b89DF0B4894ABE91E6D02FE579834F8F", - "usdc": "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508", - "wmatic": "0xC6bA8C3233eCF65B761049ef63466945c362EdD2" + "seedAsset": "0xc63d2a04762529edB649d7a4cC3E57A0085e8544", + "usdc": "0x093e8F4d8f267d2CeEc9eB889E2054710d187beD", + "wmatic": "0x34ee84036C47d852901b7069aBD80171D9A489a6" }, "uniswap": { "factory": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", diff --git a/tasks/manage/gasFwdFactory/updateRegistrar.ts b/tasks/manage/gasFwdFactory/updateRegistrar.ts index 7dd689f5a..45bc0444f 100644 --- a/tasks/manage/gasFwdFactory/updateRegistrar.ts +++ b/tasks/manage/gasFwdFactory/updateRegistrar.ts @@ -22,7 +22,7 @@ task( const newRegistrar = taskArgs.newRegistrar || addresses.registrar.proxy; logger.out("Querying current GasFwdFactory registrar..."); - const gasFwdFactory = GasFwdFactory__factory.connect(addresses.indexFund.proxy, proxyAdmin); + const gasFwdFactory = GasFwdFactory__factory.connect(addresses.gasFwd.factory, proxyAdmin); const curRegistrar = await gasFwdFactory.registrar(); if (curRegistrar === newRegistrar) { return logger.out(`"${newRegistrar}" is already set as the registrar address.`); From 285fdfe237b0d2c8c11fcc0c3e48e4a8f37feb7a Mon Sep 17 00:00:00 2001 From: Nenad Date: Fri, 21 Jul 2023 08:00:05 +0200 Subject: [PATCH 09/10] Remove deployer from deployGasFwd --- contracts/core/gasFwd/scripts/deploy.ts | 5 ++--- tasks/deploy/deployAngelProtocol.ts | 1 - tasks/deploy/deployGasFwd.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contracts/core/gasFwd/scripts/deploy.ts b/contracts/core/gasFwd/scripts/deploy.ts index 6b47475c2..d4df69252 100644 --- a/contracts/core/gasFwd/scripts/deploy.ts +++ b/contracts/core/gasFwd/scripts/deploy.ts @@ -4,20 +4,19 @@ import {GasFwdFactory__factory, GasFwd__factory} from "typechain-types"; import {Deployment, getAddresses, getContractName, logger, updateAddresses} from "utils"; type Data = { - deployer: SignerWithAddress; admin: SignerWithAddress; registrar?: string; }; export async function deployGasFwd( - {deployer, admin, registrar}: Data, + {admin, registrar}: Data, hre: HardhatRuntimeEnvironment ): Promise<{factory: Deployment; implementation: Deployment} | undefined> { logger.out("Deploying Gas Forwarder..."); try { logger.out("Deploying GasFwd implementation..."); - const GF = new GasFwd__factory(deployer); + const GF = new GasFwd__factory(admin); const gf = await GF.deploy(); await gf.deployed(); logger.out(`Address: ${gf.address}`); diff --git a/tasks/deploy/deployAngelProtocol.ts b/tasks/deploy/deployAngelProtocol.ts index 2d31ff68e..179e52c65 100644 --- a/tasks/deploy/deployAngelProtocol.ts +++ b/tasks/deploy/deployAngelProtocol.ts @@ -71,7 +71,6 @@ task("deploy:AngelProtocol", "Will deploy complete Angel Protocol") const gasFwd = await deployGasFwd( { - deployer: proxyAdmin, admin: proxyAdmin, registrar: registrar?.address, }, diff --git a/tasks/deploy/deployGasFwd.ts b/tasks/deploy/deployGasFwd.ts index d12f5b8a1..ed5fda78b 100644 --- a/tasks/deploy/deployGasFwd.ts +++ b/tasks/deploy/deployGasFwd.ts @@ -15,7 +15,7 @@ task("deploy:GasFwd", "Will deploy the GasFwd implementation and factory") const {deployer, proxyAdmin} = await getSigners(hre); const gasFwdDeployment = await deployGasFwd( - {deployer: deployer, admin: proxyAdmin, registrar: addresses.registrar.proxy}, + {owner: deployer, admin: proxyAdmin, registrar: addresses.registrar.proxy}, hre ); From 70bf155faf31b041a4af04982cdbc6d810f3cefc Mon Sep 17 00:00:00 2001 From: Nenad Date: Fri, 21 Jul 2023 12:26:42 +0200 Subject: [PATCH 10/10] Fix deploy:GasFwd non-existent param --- tasks/deploy/deployGasFwd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/deploy/deployGasFwd.ts b/tasks/deploy/deployGasFwd.ts index ed5fda78b..437f607fe 100644 --- a/tasks/deploy/deployGasFwd.ts +++ b/tasks/deploy/deployGasFwd.ts @@ -12,10 +12,10 @@ task("deploy:GasFwd", "Will deploy the GasFwd implementation and factory") .setAction(async (taskArgs: TaskArgs, hre) => { try { const addresses = await getAddresses(hre); - const {deployer, proxyAdmin} = await getSigners(hre); + const {proxyAdmin} = await getSigners(hre); const gasFwdDeployment = await deployGasFwd( - {owner: deployer, admin: proxyAdmin, registrar: addresses.registrar.proxy}, + {admin: proxyAdmin, registrar: addresses.registrar.proxy}, hre );