From 8806167b61d342f96f24801d8edc88bc83af8df4 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Tue, 7 May 2024 19:08:03 -0400 Subject: [PATCH] Remove more instances of Azorius typechain --- src/models/AzoriusTxBuilder.ts | 18 +++++++----------- src/models/DaoTxBuilder.ts | 5 +++-- src/models/FreezeGuardTxBuilder.ts | 6 +++--- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index a50f52db07..c5de45bf1c 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -1,4 +1,3 @@ -import { Azorius, Azorius__factory } from '@fractal-framework/fractal-contracts'; import { getCreate2Address, Address, @@ -48,7 +47,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { private predictedAzoriusAddress: Address | undefined; private predictedTokenClaimAddress: Address | undefined; - public azoriusContract: Azorius | undefined; + public azoriusAddress: Address | undefined; public linearERC20VotingAddress: Address | undefined; public linearERC721VotingAddress: Address | undefined; public votesTokenAddress: Address | undefined; @@ -170,7 +169,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { LinearERC20VotingAbi, this.linearERC20VotingAddress!, 'setAzorius', // contract function name - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -179,7 +178,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { LinearERC721VotingAbi, this.linearERC721VotingAddress!, 'setAzorius', // contract function name - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -193,7 +192,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'enableModule', - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -204,7 +203,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'addOwnerWithThreshold', - [this.azoriusContract!.address, 1], + [this.azoriusAddress, 1], 0, false, ); @@ -215,7 +214,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'removeOwner', - [this.azoriusContract!.address, this.multiSendCallOnlyAddress, 1], + [this.azoriusAddress, this.multiSendCallOnlyAddress, 1], 0, false, ); @@ -576,10 +575,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { } const daoData = this.daoData as AzoriusGovernanceDAO; - this.azoriusContract = Azorius__factory.connect( - this.predictedAzoriusAddress!, - this.signerOrProvider, - ); + this.azoriusAddress = this.predictedAzoriusAddress; if (daoData.votingStrategyType === VotingStrategyType.LINEAR_ERC20) { this.votesTokenAddress = this.predictedTokenAddress; this.linearERC20VotingAddress = this.predictedStrategyAddress; diff --git a/src/models/DaoTxBuilder.ts b/src/models/DaoTxBuilder.ts index f2bbc61c17..43b889530d 100644 --- a/src/models/DaoTxBuilder.ts +++ b/src/models/DaoTxBuilder.ts @@ -1,5 +1,6 @@ import { ethers } from 'ethers'; import { Address, PublicClient, encodeFunctionData, getAddress, zeroAddress } from 'viem'; +import AzoriusAbi from '../assets/abi/Azorius'; import FractalRegistryAbi from '../assets/abi/FractalRegistry'; import GnosisSafeL2Abi from '../assets/abi/GnosisSafeL2'; import KeyValuePairsAbi from '../assets/abi/KeyValuePairs'; @@ -114,7 +115,7 @@ export class DaoTxBuilder extends BaseTxBuilder { if (this.parentAddress) { const freezeGuardTxBuilder = this.txBuilderFactory.createFreezeGuardTxBuilder( - azoriusTxBuilder.azoriusContract!.address, + azoriusTxBuilder.azoriusAddress, azoriusTxBuilder.linearERC20VotingAddress ?? azoriusTxBuilder.linearERC721VotingAddress, this.parentStrategyType, this.parentStrategyAddress, @@ -126,7 +127,7 @@ export class DaoTxBuilder extends BaseTxBuilder { freezeGuardTxBuilder.buildDeployZodiacModuleTx(), freezeGuardTxBuilder.buildFreezeVotingSetupTx(), freezeGuardTxBuilder.buildDeployFreezeGuardTx(), - freezeGuardTxBuilder.buildSetGuardTx(azoriusTxBuilder.azoriusContract!), + freezeGuardTxBuilder.buildSetGuardTx(AzoriusAbi, azoriusTxBuilder.azoriusAddress!), ]); } const data = this.daoData as AzoriusERC20DAO; diff --git a/src/models/FreezeGuardTxBuilder.ts b/src/models/FreezeGuardTxBuilder.ts index 7a70c767a6..8027aefd8d 100644 --- a/src/models/FreezeGuardTxBuilder.ts +++ b/src/models/FreezeGuardTxBuilder.ts @@ -1,5 +1,4 @@ import { - Azorius, AzoriusFreezeGuard__factory, ERC20FreezeVoting__factory, MultisigFreezeGuard__factory, @@ -20,6 +19,7 @@ import { parseAbiParameters, isHex, PublicClient, + Abi, } from 'viem'; import GnosisSafeL2Abi from '../assets/abi/GnosisSafeL2'; import ModuleProxyFactoryAbi from '../assets/abi/ModuleProxyFactory'; @@ -151,8 +151,8 @@ export class FreezeGuardTxBuilder extends BaseTxBuilder { ); } - public buildSetGuardTx(contract: Azorius): SafeTransaction { - return buildContractCall(contract, 'setGuard', [this.freezeGuardAddress], 0, false); + public buildSetGuardTx(abi: Abi, address: Address): SafeTransaction { + return buildContractCallViem(abi, address, 'setGuard', [this.freezeGuardAddress], 0, false); } public buildSetGuardTxSafe(safeAddress: Address): SafeTransaction {