Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

AP-724 mainnet readiness #345

Merged
merged 61 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
3e9628c
Change config to match new username/project
stevieraykatz Aug 24, 2023
013ff54
Merge branch 'master' into AP-698-mainnet-readiness
stevieraykatz Aug 24, 2023
aa7229f
Added ProxyAdmin multisig singleton, changed deployer back to Signer
stevieraykatz Aug 24, 2023
82045e9
Added proxyAdminSigner to env deps on prod/dev, upgrade tasks now sub…
stevieraykatz Aug 25, 2023
866efdb
Fixes according to tsc output
stevieraykatz Aug 25, 2023
76068f8
Lint
stevieraykatz Aug 25, 2023
27da7bc
fix remaining issues with tests, typo in env.config
stevieraykatz Aug 25, 2023
be57a5e
Resolved open conversation with env switching proxyAdminSigner
stevieraykatz Aug 25, 2023
f0525c8
Add pkey helper method, rename contract to ProxyAdminMultisig
stevieraykatz Aug 25, 2023
8f052ac
Remove _PROD proxyAdmin signer
stevieraykatz Aug 25, 2023
fdeb56b
Move proxyAdmin address into multiSig struct, Address PR comments
stevieraykatz Aug 25, 2023
5bf0265
Address tsc complains from refactor
stevieraykatz Aug 25, 2023
7292129
Add type safety to env.config, remove unused env vars
stevieraykatz Aug 25, 2023
a62a900
explicitly call deploy scripts with a deployer Signer
stevieraykatz Aug 25, 2023
eb4891f
Added config fields for prod, made apTeamMultisig and charityApplicat…
stevieraykatz Aug 26, 2023
260fb6e
Added multisig signer args to tasks
stevieraykatz Aug 26, 2023
6787b53
lint
stevieraykatz Aug 26, 2023
7edd0f2
Fix useless ternary
stevieraykatz Aug 26, 2023
84cafe4
Fix order of accounts in env.config.ts (+refactor)
0xNeshi Aug 28, 2023
662078d
Rename PROXY_ADMIN_DEV_[] to PROXY_ADMIN_[]
0xNeshi Aug 28, 2023
4635ebe
Rename ProxyAdmin__factory uses to ProxyAdminMultiSig__factory
0xNeshi Aug 28, 2023
42030b5
Refactor getSigners
0xNeshi Aug 28, 2023
8189dfe
Add JSON.stringify when printing newly created endowment
0xNeshi Aug 28, 2023
444054b
Refactor resetContractAddresses
0xNeshi Aug 28, 2023
b1053f3
Refactor networkHelpers.ts
0xNeshi Aug 28, 2023
cf02e36
Set ProxyAdminMultiSig as diamond's contract owner
0xNeshi Aug 28, 2023
f87541c
Await ownership transfer on deployGasFwd
0xNeshi Aug 28, 2023
28c6a5b
Refactor deployCharityApplications
0xNeshi Aug 28, 2023
b111f17
Refactor deployIndexFund
0xNeshi Aug 28, 2023
351f484
Update deployEndowmentMultiSig > rename 'admin' to 'proxyAdmin'
0xNeshi Aug 28, 2023
fb40e98
Update deployVaultEmitter > rename 'admin' to 'proxyAdmin'
0xNeshi Aug 28, 2023
69b216e
Update deployAPTeamMultiSig > rename 'admin' to 'proxyAdmin'
0xNeshi Aug 28, 2023
9432eb3
Fix typo in proxyAdminPkey param description
0xNeshi Aug 28, 2023
168e5a5
Fix upgrade:ContractsUsingAccountStorage
0xNeshi Aug 28, 2023
c56be2f
Refactor upgradeFacets/cutDiamond
0xNeshi Aug 28, 2023
12a2007
Deploy ProxyAdminMultiSig by default
0xNeshi Aug 28, 2023
ed27f3a
Remove proxyAdminMultiSig from saved addresses
0xNeshi Aug 28, 2023
e86f91c
Increase transaction expiry time for ProxyAdminMultiSig
0xNeshi Aug 28, 2023
a3d2e6f
Fix modifier error messages in MultiSig(s)
0xNeshi Aug 28, 2023
ab50784
Fix Accounts diamond owner to be set to APTeamMultiSig
0xNeshi Aug 28, 2023
38c36ae
Add yes flag to deploy:GasFwd
0xNeshi Aug 28, 2023
accfcda
Better logs
0xNeshi Aug 28, 2023
06c9bed
Use apTeam2 wallet in createEndowment
0xNeshi Aug 28, 2023
ecf3f5d
Use isConfirmed in MultiSigGeneric where possible
0xNeshi Aug 28, 2023
d602260
Fix CharityApplications executeProposal only if enough confirmations …
0xNeshi Aug 28, 2023
f817d08
Update createEndowment to work with prod and dev
0xNeshi Aug 28, 2023
271b336
Minor fixes in manage:accounts:updateConfig
0xNeshi Aug 28, 2023
d5ac4af
Fix upgrade:endowmentMultiSig:emitter - use ITransparentUpgradeablePr…
0xNeshi Aug 28, 2023
7f83928
Transfer EndowmentMultiSigFactory ownership to ProxyAdminMultiSig aft…
0xNeshi Aug 28, 2023
e4e845d
Make proxyAdmin and implementationAddress in EndowmentMultiSigFactory…
0xNeshi Aug 28, 2023
a9336ce
add missing env vars to template
Aug 29, 2023
dee1195
remove override
Aug 29, 2023
b11945f
Set EndowmentMultiSigFactory owner to APTeamMultiSig proxy
0xNeshi Aug 29, 2023
2e2b3fb
Update deployGasFwd.Data.admin -> proxyAdmin
0xNeshi Aug 29, 2023
f34acd4
Remove address validation in OwnershipFacet.owner
0xNeshi Aug 29, 2023
b118ed7
Fix manage:changeAdmin
0xNeshi Aug 29, 2023
a84d96d
Add missing address validation to OwnershipFacet.transferOwnership
0xNeshi Aug 29, 2023
23ea91f
Remove NETWORK and VERIFY_CONTRACTS from .env
0xNeshi Aug 29, 2023
0c755f0
FYEO-ANGL-ID-29: Fix last of missing Zero Address checks (#348)
SovereignAndrey Aug 30, 2023
1983b9b
Pass owners array to deployProxyAdminMultiSig
0xNeshi Aug 30, 2023
39e3e21
Pass ProxyAdminMultiSig owners in deploy scripts
0xNeshi Aug 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Network where to deploy contracts
# options=[hardhat, polygon, mumbai, goerli]
# options=[hardhat,polygon, mumbai, goerli]
NETWORK="hardhat"
SovereignAndrey marked this conversation as resolved.
Show resolved Hide resolved
VERIFY_CONTRACTS=false

Expand Down
29 changes: 24 additions & 5 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import dotenv from "dotenv";
import {ethers} from "ethers";
import {Config} from "./types";

import {BigNumber} from "ethers";
dotenv.config({path: __dirname + "/./../.env"});

const config: Config = {
AP_TEAM_MULTISIG_DATA: {
threshold: 1,
requireExecution: false,
transactionExpiry: 100000,
transactionExpiry: 604800,
},
PROXY_ADMIN_MULTISIG_DATA: {
threshold: 1,
requireExecution: false,
transactionExpiry: 345600,
},
REGISTRAR_DATA: {
taxRate: 1,
Expand All @@ -26,10 +31,10 @@ const config: Config = {
CHARITY_APPLICATIONS_DATA: {
threshold: 1,
0xNeshi marked this conversation as resolved.
Show resolved Hide resolved
requireExecution: false,
transactionExpiry: 100000,
transactionExpiry: 345600,
seedSplitToLiquid: 0,
gasAmount: 0,
seedAmount: 100,
gasAmount: BigNumber.from("180000000000000000"), // 0.18 Ether
seedAmount: 0,
},
DONATION_MATCH_CHARITY_DATA: {
poolFee: 300,
Expand All @@ -50,6 +55,20 @@ const config: Config = {
// vestingOwner : "0x1F98431c8aD98523631AE4a59f267346ea31F984",
// vestingGenesisTime : 50000
},
PROD_CONFIG: {
0xNeshi marked this conversation as resolved.
Show resolved Hide resolved
APTeamMultiSigOwners: [
"0xF71eba1cf57997B6C52eA33D7939A330D6D85502",
"0x165d1f1361490974ea2F2A4079b5828E81F13b11",
"0x109641d919da899c7bd1ce27413d0c02b3bb611d",
"0x13C9060a611e4277a93ca259068256271fC2d7B4",
],
CharityApplicationsOwners: [
"0xF71eba1cf57997B6C52eA33D7939A330D6D85502",
"0x165d1f1361490974ea2F2A4079b5828E81F13b11",
"0x13C9060a611e4277a93ca259068256271fC2d7B4",
],
Treasury: "0x4C6cDdFC00064D73E64B34aE453884de1Bf6D639",
},
};

export default config;
12 changes: 11 additions & 1 deletion config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export type Config = {
requireExecution: boolean;
transactionExpiry: number;
};
PROXY_ADMIN_MULTISIG_DATA: {
threshold: number;
requireExecution: boolean;
transactionExpiry: number;
};
REGISTRAR_DATA: {
taxRate: number;
acceptedTokens: {
Expand All @@ -25,7 +30,7 @@ export type Config = {
requireExecution: boolean;
transactionExpiry: number;
seedSplitToLiquid: number;
gasAmount: number;
gasAmount: BigNumber;
seedAmount: number;
};
DONATION_MATCH_CHARITY_DATA: {
Expand All @@ -44,4 +49,9 @@ export type Config = {
CommunitySpendLimit: number;
distributorSpendLimit: number;
};
PROD_CONFIG: {
APTeamMultiSigOwners: string[];
CharityApplicationsOwners: string[];
Treasury: string;
};
};
85 changes: 43 additions & 42 deletions contract-address.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,36 +131,36 @@
},
"31337": {
"accounts": {
"diamond": "0x3Ca355541eAe06EFBb53A489b89B1F2966FC044a",
"diamond": "0xb463AFC0b3A499a2D826155fc6E6E73061BEF826",
"facets": {
"accountsDepositWithdrawEndowments": "0xf9Bf69b6319fe9061c549BcFf984c6fa967c3116",
"accountsAllowance": "0xFa2B78ACc38204E6aB7465d79c4FB6672Ad6EcD2",
"accountsCreateEndowment": "0x581Ca6F583472fdf76F8070dD6b23D2D2599ed86",
"accountsGasManager": "0x13AeE574292F9934ED631216E53bc8a08683cA90",
"accountsQueryEndowments": "0x78F2fb36ad2268aFdE137F152716dE7c762a5cef",
"accountsStrategy": "0x8F15FE529f12a239364219e87cC4f308d7a02932",
"accountsSwapRouter": "0x6Eb46Cb6f3EDB24A8bc942f7e357BE7befB8B0d7",
"accountsUpdate": "0xAc7337B92f469F438E26bd9AB3078CD35014462c",
"accountsUpdateEndowments": "0x5A1D883B9ecf8A4D88290d26682F625FEc620706",
"accountsUpdateEndowmentSettingsController": "0xA4C4bC12A1Ab33EeFd40BB216CcF44235d8Dc5de",
"accountsUpdateStatusEndowments": "0x06499E212Ce9F9D4a2147e82242F137c5e32f8C8",
"diamondCutFacet": "0x9f9985900ddadc4A3Cb9b626Ae78c45A9Ca4D22C",
"diamondInitFacet": "0xd5Ce55AF9EC550C4fd77B9cd8F9fa84730b53b4c",
"diamondLoupeFacet": "0x36884aEE2eB53f350a67AC5b487b5cf08ed884ac",
"ownershipFacet": "0x22b28c6461746Fa4FAa41C45Db5862be36341961"
"accountsDepositWithdrawEndowments": "0x635D1fE12b3b8af7174eED21536319b5280B4453",
"accountsAllowance": "0xBfA2d241f8f2ecaeA58A7D60E2a358f851D5c1b1",
"accountsCreateEndowment": "0x6843cd0Ccc776EA0FE7E26e6527C925F06dDD76C",
"accountsGasManager": "0x5C680949386aCD7c85FBC6f56413936f091e3f47",
"accountsQueryEndowments": "0x38f05a857a1D4FE6eB712A794a63C61D2b282b30",
"accountsStrategy": "0x84efD60753f006DE6878C7139675b110Da654459",
"accountsSwapRouter": "0x4F4d5EABF5A8fDaeE5794DEFff4eE88e6e2c5f51",
"accountsUpdate": "0x620119C4952f0648Ee905cdE00C3077CA3f9961e",
"accountsUpdateEndowments": "0x33936aF12923725cEc788e2AC5beBa03c7a5BD79",
"accountsUpdateEndowmentSettingsController": "0x243f0Fd94F12dEB0a8B73deEA25138479ee7E4aA",
"accountsUpdateStatusEndowments": "0x2A8f0893A534983c63e4F52E39dDf3527b130768",
"diamondCutFacet": "0xAb3aa8BCEA9832CB18153Aa9731E989A289277f7",
"diamondInitFacet": "0xacE2a31e8B8d66C24DAea008d1eDaf571369A728",
"diamondLoupeFacet": "0x53557e97deED0DdEEf2404a6A29A415e379051bb",
"ownershipFacet": "0xB1A33A8f6cD8572976004C3653AbCEb3E697b9ad"
}
},
"axelar": {
"gasService": "0xC9783d89a8e0Fd3202D84a7F8e1768Ae8383C0C0",
"gateway": "0x9D04A92f355E89afaE8609620321866dfB3a1737"
"gasService": "0x7E891709346B193ff9f37Eb739C8a294B2395Ba6",
"gateway": "0xfC8caFA21dc76a1065494E213dE9F94E788DaAC9"
},
"fundraising": {
"implementation": "",
"proxy": ""
},
"gasFwd": {
"factory": "0x600eCa807e7952AC66E81Ea44279a74Eb9c5Ba05",
"implementation": "0x1C07F4d1e01AF47146EccB64B4C526A312Ad70Df"
"factory": "0x3Bfc59C12e4f838419C483B4CCb86D5798f29DFF",
"implementation": "0x790094B9fdC8C8a83507f7Eb275DEe903Ffd71eD"
},
"giftcards": {
"implementation": "",
Expand Down Expand Up @@ -218,50 +218,51 @@
}
},
"indexFund": {
"implementation": "0x41E4c81a60346b5f76aD669Af7e5bCAee30107E4",
"proxy": "0x3F1E0C7b13fb5b616EADFA8fbcC439B207aD960c"
"implementation": "0x7Eb691CaD47e698642Ac507aC0383d8Ef1A20C7D",
"proxy": "0x03d1823DCE06d5bD225cB18773bb090b2aD33b5D"
},
"multiSig": {
"charityApplications": {
"implementation": "0x1aCC68E90145A8Db8D223370e2B29A5Aa2415169",
"proxy": "0xC2790723ab94Ad77F7B102E6010a0aEA85bFbd3E"
"implementation": "0xd9Ee17555a04f2E34ea43528628582AC45A6E984",
"proxy": "0x402e14f3f9118A3745d8554EC4106450fB91aE23"
},
"apTeam": {
"implementation": "0xd8A98Ee63B135CA4d19458cBe07Ff47Ac2a9C9dF",
"proxy": "0x9a5D723096c87843E2384FC6Dc7893922277a3cE"
"implementation": "0x730EEB14F27B5D6132b9BF7D62eF877D89600F55",
"proxy": "0x45CCb6251F3500c7EE3219eE47C213fB239346cB"
},
"endowment": {
"emitter": {
"implementation": "0x7a576Cc05680F04D1Da3C4c33eA11e1Eba355028",
"proxy": "0xed7c73439a5A6487518B13A568951ae8C0b4F2d9"
"implementation": "0xC79662B65F21A222EE95d22557664C3BE14Ec0FE",
"proxy": "0xd62A19ffb64C3f00271Dd7BBf455824aa799d074"
},
"factory": "0x76e48b41810e5ec24f3FEa3c47a7C9Ae1d4F0F19",
"implementation": "0xd607fc8FCfc5FDF5b499daBf3C76f7349bfc624B"
}
"factory": "0x79AF01164e25B9c6Ff828A5f795CFA62A635CFC3",
"implementation": "0x7a0f853900040d5b131342018EAb9453723d9dcc"
},
"proxyAdmin": "0x5602bAF3002df39FbAA568C0657bBBBB8e84527a"
},
"registrar": {
"implementation": "0xaBCe32FBA4C591E8Ea5A5f711F7112dC08BCee74",
"proxy": "0x1BE9451496bfB6aDcFfbc308b673018a8972AFFE"
"implementation": "0xbF6b148a440acAb936796ad40947C0C33C78639A",
"proxy": "0x03Bb663AccB9FD14aD3c37B2D66B025bbd4Fc533"
},
"router": {
"implementation": "0x1F624f6259d6C61224E9Fd5cD11481C271a2bf75",
"proxy": "0x5f437141bCF08A919863603C946D5c8AEa66B32b"
"implementation": "0x658E94B5FfBDe68b99203BBbBAef618D36862766",
"proxy": "0x486b1C056AC365dD969056C717ab8E7AEd59a178"
},
"tokens": {
"dai": "",
"halo": "",
"reserveToken": "",
"seedAsset": "0xF82ABBea7Edb7A6602a02eE69e6c5330C049CDa5",
"usdc": "0x715e97514F641A256bC77a6A08edd8bEA908066e",
"wmatic": "0xcC46d552a29E99c71779d05AFF3675DD90d127D6"
"seedAsset": "0xB2BD05A652973f567aD6472b9FEa29FE293f6cD9",
"usdc": "0x9B1a72BD9efC089935766f7Ebc8779B67C0F7495",
"wmatic": "0x42f293b5D45C0a949639EE229E4c9acD51DF904D"
},
"uniswap": {
"factory": "0x3304eD6a8D90Ab57bb7b797aF9f66447CDf09C3E",
"swapRouter": "0x3304eD6a8D90Ab57bb7b797aF9f66447CDf09C3E"
"factory": "0x40B5D836dBeAf26c652210D8f07169B99E77C994",
"swapRouter": "0x40B5D836dBeAf26c652210D8f07169B99E77C994"
},
"vaultEmitter": {
"implementation": "0x0Bd2640F272D074e0d8c2111373526bA946255A9",
"proxy": "0xEC9d58EDD9752AdC448769Fff558cE19A7473Dbc"
"implementation": "0x6eB34f65AcC0dd09C3AA72C3C4bA08578a4A3F96",
"proxy": "0x675017e864CB39CEbe4A0CDBA639750f6ee0BDE2"
}
},
"80001": {
Expand Down
15 changes: 8 additions & 7 deletions contracts/accessory/gift-cards/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import {HardhatRuntimeEnvironment} from "hardhat/types";
import {getContractName, getSigners, logger, updateAddresses, verify} from "utils";

import {GiftCardsMessage} from "typechain-types/contracts/accessory/gift-cards/GiftCards";
import {GiftCards__factory, ProxyContract__factory} from "typechain-types";

export async function deployGiftCard(
GiftCardsDataInput: GiftCardsMessage.InstantiateMsgStruct,
admin: string,
verify_contracts: boolean,
hre: HardhatRuntimeEnvironment
) {
try {
const {ethers, run, network} = hre;
const {proxyAdmin} = await getSigners(hre);
const GiftCards = await ethers.getContractFactory("GiftCards");
const {deployer} = await getSigners(hre);

const GiftCards = new GiftCards__factory(deployer);
const GiftCardsInstance = await GiftCards.deploy();
await GiftCardsInstance.deployed();
logger.out(`GiftCards implementation address: ${GiftCardsInstance.address}"`);

const ProxyContract = await ethers.getContractFactory("ProxyContract");
const ProxyContract = new ProxyContract__factory(deployer);
const GiftCardsData = GiftCardsInstance.interface.encodeFunctionData("initialize", [
GiftCardsDataInput,
]);
const GiftCardsProxy = await ProxyContract.deploy(
GiftCardsInstance.address,
proxyAdmin.address,
admin,
GiftCardsData
);
await GiftCardsProxy.deployed();
Expand All @@ -42,7 +43,7 @@ export async function deployGiftCard(
if (verify_contracts) {
await verify(hre, {
address: GiftCardsProxy.address,
constructorArguments: [GiftCardsInstance.address, proxyAdmin.address, GiftCardsData],
constructorArguments: [GiftCardsInstance.address, admin, GiftCardsData],
contractName: getContractName(GiftCards),
});
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/core/accounts/diamond/facets/OwnershipFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity ^0.8.19;

import {LibDiamond} from "../libraries/LibDiamond.sol";
import {IERC173} from "../interfaces/IERC173.sol";
import {Validator} from "../../../validator.sol";

contract OwnershipFacet is IERC173 {
function transferOwnership(address newOwner) external override {
Expand All @@ -12,7 +11,6 @@ contract OwnershipFacet is IERC173 {
}

function owner() external view override returns (address owner_) {
require(Validator.addressChecker(owner_), "Invalid address");
owner_ = LibDiamond.contractOwner();
}
}
41 changes: 30 additions & 11 deletions contracts/core/accounts/scripts/deploy/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers";
import {HardhatRuntimeEnvironment} from "hardhat/types";
import {DiamondCutFacet__factory, DiamondInit__factory, Diamond__factory} from "typechain-types";
import {Deployment, getContractName, getSigners, logger, updateAddresses} from "utils";
import {
DiamondCutFacet__factory,
DiamondInit__factory,
Diamond__factory,
IERC173__factory,
} from "typechain-types";
import {Deployment, getContractName, logger, updateAddresses} from "utils";
import cutDiamond from "./cutDiamond";
import deployFacets from "./deployFacets";

export async function deployAccountsDiamond(
owner: string,
registrar: string,
diamondAdmin: string,
deployer: SignerWithAddress,
hre: HardhatRuntimeEnvironment
): Promise<{
diamond: Deployment;
facets: Array<Deployment>;
}> {
logger.out("Deploying and setting up Accounts Diamond and all its facets...");

const {proxyAdmin} = await getSigners(hre);
const {diamond, diamondCutFacet} = await deployDiamond(deployer, hre);

const {diamond, diamondCutFacet} = await deployDiamond(proxyAdmin, hre);
const diamondInit = await deployDiamondInit(deployer, hre);

const diamondInit = await deployDiamondInit(proxyAdmin, hre);
const cuts = await deployFacets(deployer, hre);

const cuts = await deployFacets(proxyAdmin, hre);
await cutDiamond(diamond.address, diamondInit.address, deployer, owner, registrar, cuts, hre);

await cutDiamond(diamond.address, diamondInit.address, proxyAdmin, owner, registrar, cuts, hre);
await setDiamondContractOwner(diamond.address, diamondAdmin, deployer);

return {
diamond,
Expand All @@ -37,19 +44,19 @@ export async function deployAccountsDiamond(
}

async function deployDiamond(
admin: SignerWithAddress,
deployer: SignerWithAddress,
hre: HardhatRuntimeEnvironment
): Promise<{diamond: Deployment; diamondCutFacet: Deployment}> {
const DiamondCutFacet = new DiamondCutFacet__factory(admin);
const DiamondCutFacet = new DiamondCutFacet__factory(deployer);
const diamondCutFacet = await DiamondCutFacet.deploy();
await diamondCutFacet.deployed();
logger.out(`DiamondCutFacet deployed at: ${diamondCutFacet.address}`);

const constructorArguments: Parameters<Diamond__factory["deploy"]> = [
admin.address,
deployer.address,
diamondCutFacet.address,
];
const Diamond = new Diamond__factory(admin);
const Diamond = new Diamond__factory(deployer);
const diamond = await Diamond.deploy(...constructorArguments);
await diamond.deployed();
logger.out(`Diamond deployed at: ${diamond.address}`);
Expand Down Expand Up @@ -93,3 +100,15 @@ async function deployDiamondInit(
contractName: getContractName(DiamondInit),
};
}

async function setDiamondContractOwner(
address: string,
newOwner: string,
curOwner: SignerWithAddress
) {
logger.out(`Transferring ownership from "${curOwner}" to "${newOwner}"...`);
const accountsDiamond = IERC173__factory.connect(address, curOwner);
const tx = await accountsDiamond.transferOwnership(newOwner);
logger.out(`Tx hash: ${tx.hash}`);
await tx.wait();
}
Loading