Skip to content

Commit

Permalink
Remove more instances of Azorius typechain
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed May 8, 2024
1 parent 5890b07 commit 175f1ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
18 changes: 7 additions & 11 deletions src/models/AzoriusTxBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Azorius, Azorius__factory } from '@fractal-framework/fractal-contracts';
import {
getCreate2Address,
Address,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -171,7 +170,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
LinearERC20VotingAbi,
this.linearERC20VotingAddress!,
'setAzorius', // contract function name
[this.azoriusContract!.address],
[this.azoriusAddress],
0,
false,
);
Expand All @@ -180,7 +179,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
LinearERC721VotingAbi,
this.linearERC721VotingAddress!,
'setAzorius', // contract function name
[this.azoriusContract!.address],
[this.azoriusAddress],
0,
false,
);
Expand All @@ -194,7 +193,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
GnosisSafeL2Abi,
this.safeContractAddress,
'enableModule',
[this.azoriusContract!.address],
[this.azoriusAddress],
0,
false,
);
Expand All @@ -205,7 +204,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
GnosisSafeL2Abi,
this.safeContractAddress,
'addOwnerWithThreshold',
[this.azoriusContract!.address, 1],
[this.azoriusAddress, 1],
0,
false,
);
Expand All @@ -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,
);
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/models/DaoTxBuilder.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/models/FreezeGuardTxBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Azorius,
AzoriusFreezeGuard__factory,
ERC20FreezeVoting__factory,
MultisigFreezeGuard__factory,
Expand All @@ -20,6 +19,7 @@ import {
parseAbiParameters,
isHex,
PublicClient,
Abi,
} from 'viem';
import GnosisSafeL2Abi from '../assets/abi/GnosisSafeL2';
import ModuleProxyFactoryAbi from '../assets/abi/ModuleProxyFactory';
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 175f1ef

Please sign in to comment.