From 00fd68f9fb9dd01ce00637e88a1a203d35d9c024 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Thu, 23 May 2024 09:25:13 -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 3b02928277..e48ef34fc0 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, @@ -49,7 +48,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; @@ -171,7 +170,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { LinearERC20VotingAbi, this.linearERC20VotingAddress!, 'setAzorius', // contract function name - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -180,7 +179,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { LinearERC721VotingAbi, this.linearERC721VotingAddress!, 'setAzorius', // contract function name - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -194,7 +193,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'enableModule', - [this.azoriusContract!.address], + [this.azoriusAddress], 0, false, ); @@ -205,7 +204,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'addOwnerWithThreshold', - [this.azoriusContract!.address, 1], + [this.azoriusAddress, 1], 0, false, ); @@ -216,7 +215,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { GnosisSafeL2Abi, this.safeContractAddress, 'removeOwner', - [this.azoriusContract!.address, this.multiSendCallOnlyAddress, 1], + [this.azoriusAddress, this.multiSendCallOnlyAddress, 1], 0, false, ); @@ -577,10 +576,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 {