Skip to content

Commit

Permalink
Remove fractalRegistryContract from BaseContracts, resolve all downst…
Browse files Browse the repository at this point in the history
…ream issues
  • Loading branch information
adamgall committed May 7, 2024
1 parent 032d618 commit 02ed6ce
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/hooks/DAO/useBuildDAOTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const useBuildDAOTx = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
},
} = useNetworkConfig();

Expand Down Expand Up @@ -54,7 +55,6 @@ const useBuildDAOTx = () => {
linearVotingERC721MasterCopyContract,
fractalAzoriusMasterCopyContract,
zodiacModuleProxyFactoryContract,
fractalRegistryContract,
fractalModuleMasterCopyContract,
multisigFreezeGuardMasterCopyContract,
azoriusFreezeGuardMasterCopyContract,
Expand Down Expand Up @@ -94,7 +94,6 @@ const useBuildDAOTx = () => {

const buildrerBaseContracts: BaseContracts = {
fractalModuleMasterCopyContract: fractalModuleMasterCopyContract.asSigner,
fractalRegistryContract: fractalRegistryContract.asSigner,
safeFactoryContract: safeFactoryContract.asSigner,
safeSingletonContract: safeSingletonContract.asSigner,
multisigFreezeGuardMasterCopyContract: multisigFreezeGuardMasterCopyContract.asSigner,
Expand All @@ -115,6 +114,7 @@ const useBuildDAOTx = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
parentAddress,
parentTokenAddress,
);
Expand Down Expand Up @@ -165,6 +165,7 @@ const useBuildDAOTx = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
],
);

Expand Down
5 changes: 3 additions & 2 deletions src/hooks/DAO/useDeployAzorius.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const useDeployAzorius = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
},
addressPrefix,
} = useNetworkConfig();
Expand Down Expand Up @@ -57,7 +58,6 @@ const useDeployAzorius = () => {
linearVotingERC721MasterCopyContract,
fractalAzoriusMasterCopyContract,
zodiacModuleProxyFactoryContract,
fractalRegistryContract,
fractalModuleMasterCopyContract,
multisigFreezeGuardMasterCopyContract,
azoriusFreezeGuardMasterCopyContract,
Expand All @@ -78,7 +78,6 @@ const useDeployAzorius = () => {

const builderBaseContracts: BaseContracts = {
fractalModuleMasterCopyContract: fractalModuleMasterCopyContract.asProvider,
fractalRegistryContract: fractalRegistryContract.asProvider,
safeFactoryContract: safeFactoryContract.asProvider,
safeSingletonContract: safeSingletonContract.asProvider,
multisigFreezeGuardMasterCopyContract: multisigFreezeGuardMasterCopyContract.asProvider,
Expand All @@ -99,6 +98,7 @@ const useDeployAzorius = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
undefined,
undefined,
);
Expand Down Expand Up @@ -160,6 +160,7 @@ const useDeployAzorius = () => {
votesERC20WrapperMasterCopy,
votesERC20MasterCopy,
keyValuePairs,
fractalRegistry,
],
);

Expand Down
9 changes: 7 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 { PublicClient, getAddress, zeroAddress } from 'viem';
import FractalRegistryAbi from '../assets/abi/FractalRegistry';
import KeyValuePairsAbi from '../assets/abi/KeyValuePairs';
import { GnosisSafeL2 } from '../assets/typechain-types/usul/@gnosis.pm/safe-contracts/contracts';
import { buildContractCall, buildContractCallViem, encodeMultiSend } from '../helpers';
Expand Down Expand Up @@ -34,6 +35,7 @@ export class DaoTxBuilder extends BaseTxBuilder {
private internalTxs: SafeTransaction[] = [];

private readonly keyValuePairsAddress: string;
private readonly fractalRegistryAddress: string;

constructor(
signerOrProvider: ethers.Signer | any,
Expand All @@ -46,6 +48,7 @@ export class DaoTxBuilder extends BaseTxBuilder {
safeContract: GnosisSafeL2,
txBuilderFactory: TxBuilderFactory,
keyValuePairsAddress: string,
fractalRegistryAddress: string,
parentAddress?: string,
parentTokenAddress?: string,
parentStrategyType?: VotingStrategyType,
Expand All @@ -69,6 +72,7 @@ export class DaoTxBuilder extends BaseTxBuilder {
this.parentStrategyAddress = parentStrategyAddress;

this.keyValuePairsAddress = keyValuePairsAddress;
this.fractalRegistryAddress = fractalRegistryAddress;

// Prep fractal module txs for setting up subDAOs
this.setFractalModuleTxs();
Expand Down Expand Up @@ -227,8 +231,9 @@ export class DaoTxBuilder extends BaseTxBuilder {
//

private buildUpdateDAONameTx(): SafeTransaction {
return buildContractCall(
this.baseContracts.fractalRegistryContract,
return buildContractCallViem(
FractalRegistryAbi,
getAddress(this.fractalRegistryAddress),
'updateDAOName',
[this.daoData.daoName],
0,
Expand Down
4 changes: 4 additions & 0 deletions src/models/TxBuilderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class TxBuilderFactory extends BaseTxBuilder {
private votesERC20WrapperMasterCopyAddress: string;
private votesERC20MasterCopyAddress: string;
private keyValuePairsAddress: string;
private fractalRegistryAddress: string;

constructor(
signerOrProvider: ethers.Signer | any,
Expand All @@ -43,6 +44,7 @@ export class TxBuilderFactory extends BaseTxBuilder {
votesERC20WrapperMasterCopyAddress: string,
votesERC20MasterCopyAddress: string,
keyValuePairsAddress: string,
fractalRegistryAddress: string,
parentAddress?: string,
parentTokenAddress?: string,
) {
Expand All @@ -61,6 +63,7 @@ export class TxBuilderFactory extends BaseTxBuilder {
this.votesERC20WrapperMasterCopyAddress = votesERC20WrapperMasterCopyAddress;
this.votesERC20MasterCopyAddress = votesERC20MasterCopyAddress;
this.keyValuePairsAddress = keyValuePairsAddress;
this.fractalRegistryAddress = fractalRegistryAddress;
}

public setSafeContract(safeAddress: string) {
Expand Down Expand Up @@ -100,6 +103,7 @@ export class TxBuilderFactory extends BaseTxBuilder {
this.safeContract!,
this,
this.keyValuePairsAddress,
this.fractalRegistryAddress,
this.parentAddress,
this.parentTokenAddress,
parentStrategyType,
Expand Down
2 changes: 0 additions & 2 deletions src/types/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
GnosisSafeProxyFactory,
ModuleProxyFactory,
FractalModule,
FractalRegistry,
MultisigFreezeGuard,
MultisigFreezeVoting,
ERC20FreezeVoting,
Expand All @@ -22,7 +21,6 @@ export type ContractConnection<T> = {

export interface BaseContracts {
fractalModuleMasterCopyContract: FractalModule;
fractalRegistryContract: FractalRegistry;
safeFactoryContract: GnosisSafeProxyFactory;
safeSingletonContract: GnosisSafeL2;
multisigFreezeGuardMasterCopyContract: MultisigFreezeGuard;
Expand Down

0 comments on commit 02ed6ce

Please sign in to comment.