Skip to content

Commit

Permalink
Don't need to create a contract object, address will do
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed May 7, 2024
1 parent 1f0e490 commit 3863404
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/models/AzoriusTxBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
isAddress,
isHex,
encodeFunctionData,
GetContractReturnType,
PublicClient,
getContract,

Check warning on line 22 in src/models/AzoriusTxBuilder.ts

View workflow job for this annotation

GitHub Actions / lint

'getContract' is defined but never used
} from 'viem';
Expand Down Expand Up @@ -56,7 +55,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
public azoriusContract: Azorius | undefined;
public linearVotingContract: LinearERC20Voting | undefined;
public linearERC721VotingContract: LinearERC721Voting | undefined;
public votesTokenContract: GetContractReturnType<typeof VotesERC20Abi> | undefined;
public votesTokenContractAddress: Address | undefined;

private votesERC20WrapperMasterCopyAddress: string;
private votesERC20MasterCopyAddress: string;
Expand Down Expand Up @@ -248,14 +247,14 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
}

public buildApproveClaimAllocation() {
if (!this.votesTokenContract) {
if (!this.votesTokenContractAddress) {
return;
}

const azoriusGovernanceDaoData = this.daoData as AzoriusERC20DAO;
return buildContractCallViem(
VotesERC20Abi,
this.votesTokenContract.address,
this.votesTokenContractAddress,
'approve',
[this.predictedTokenClaimAddress, azoriusGovernanceDaoData.parentAllocationAmount],
0,
Expand Down Expand Up @@ -569,11 +568,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder {
this.predictedStrategyAddress!,
this.signerOrProvider,
);
this.votesTokenContract = getContract({
abi: VotesERC20Abi,
address: this.predictedTokenAddress,
client: this.publicClient,
});
this.votesTokenContractAddress = this.predictedTokenAddress;
} else if (daoData.votingStrategyType === VotingStrategyType.LINEAR_ERC721) {
this.linearERC721VotingContract = LinearERC721Voting__factory.connect(
this.predictedStrategyAddress!,
Expand Down

0 comments on commit 3863404

Please sign in to comment.