Skip to content

Commit

Permalink
more TS dao renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
eladmallel committed Feb 6, 2024
1 parent b13ed55 commit 8a5fee9
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 71 deletions.
2 changes: 1 addition & 1 deletion packages/nouns-contracts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export { NounsToken__factory as NounsTokenFactory } from '../typechain/factories
export { NounsAuctionHouse__factory as NounsAuctionHouseFactory } from '../typechain/factories/contracts/NounsAuctionHouse__factory';
export { NounsDescriptor__factory as NounsDescriptorFactory } from '../typechain/factories/contracts/NounsDescriptor__factory';
export { NounsSeeder__factory as NounsSeederFactory } from '../typechain/factories/contracts/NounsSeeder__factory';
export { NounsDAOLogicV3__factory as NounsDaoLogicV3Factory } from '../typechain/factories/contracts/governance/NounsDAOLogicV3__factory';
export { NounsDAOLogicV4__factory as NounsDaoLogicFactory } from '../typechain/factories/contracts/governance/NounsDAOLogicV4__factory';
export { NounsDAOData__factory as NounsDaoDataFactory } from '../typechain/factories/contracts/governance/data/NounsDAOData.sol/NounsDAOData__factory';
export { NounsDAOExecutorV2__factory as NounsDaoExecutorV2Factory } from '../typechain/factories/contracts/governance/NounsDAOExecutorV2__factory';
10 changes: 5 additions & 5 deletions packages/nouns-contracts/test/governance/quorumConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
NounsToken,
NounsDescriptorV2__factory as NounsDescriptorV2Factory,
INounsDAOLogicV3,
NounsDAOLogicV3__factory,
NounsDAOLogicV4__factory,
} from '../../typechain';
import { parseUnits } from 'ethers/lib/utils';
import { DynamicQuorumParams } from '../types';
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('NounsDAO#_setDynamicQuorumParams', () => {
expect(actualParams.maxQuorumVotesBPS).to.equal(2222);
expect(actualParams.quorumCoefficient).to.equal(quorumCoefficient);

let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);

await expect(tx).to.emit(govWithEvents, 'MinQuorumVotesBPSSet').withArgs(200, 222);
await expect(tx).to.emit(govWithEvents, 'MaxQuorumVotesBPSSet').withArgs(2000, 2222);
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('NounsDAO#_setDynamicQuorumParams', () => {
const params = await gov.getDynamicQuorumParamsAt(await blockNumber());

expect(params.minQuorumVotesBPS).to.equal(222);
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx).to.emit(govWithEvents, 'MinQuorumVotesBPSSet').withArgs(200, 222);
});

Expand Down Expand Up @@ -238,7 +238,7 @@ describe('NounsDAO#_setDynamicQuorumParams', () => {
const params = await gov.getDynamicQuorumParamsAt(await blockNumber());

expect(params.maxQuorumVotesBPS).to.equal(3333);
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx).to.emit(govWithEvents, 'MaxQuorumVotesBPSSet').withArgs(3000, 3333);
});

Expand Down Expand Up @@ -267,7 +267,7 @@ describe('NounsDAO#_setDynamicQuorumParams', () => {
const params = await gov.getDynamicQuorumParamsAt(await blockNumber());

expect(params.quorumCoefficient).to.equal(111);
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx).to.emit(govWithEvents, 'QuorumCoefficientSet').withArgs(1, 111);
});

Expand Down
14 changes: 7 additions & 7 deletions packages/nouns-contracts/test/governance/voteRefund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { solidity } from 'ethereum-waffle';
import { BigNumber, ContractReceipt } from 'ethers';
import { ethers } from 'hardhat';
import {
NounsDAOLogicV3__factory,
NounsDAOLogicV4__factory,
NounsDAOLogicV4,
NounsDescriptorV2__factory,
NounsToken,
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('V3 Vote Refund', () => {
expect(r.gasUsed).to.be.gt(0);
expect(balanceDiff).to.be.closeTo(BigNumber.from(0), REFUND_ERROR_MARGIN);
expectRefundEvent(r, user, await txCostInEth(r));
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx)
.to.emit(govWithEvents, 'VoteCast')
.withArgs(user.address, BigNumber.from(1), 1, 2, '');
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('V3 Vote Refund', () => {
expect(balanceDiff).to.be.closeTo(BigNumber.from(0), REFUND_ERROR_MARGIN);

expectRefundEvent(r, user, await txCostInEth(r));
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx)
.to.emit(govWithEvents, 'VoteCast')
.withArgs(user.address, BigNumber.from(1), 1, 2, 'some reason');
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('V3 Vote Refund', () => {
expect(balanceDiff).to.be.closeTo(await expectedGasUsedCappedDiff(r), REFUND_ERROR_MARGIN);

expectRefundEvent(r, user, MAX_REFUND_GAS_USED.mul(await latestBasePlusMaxPriority()));
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx)
.to.emit(govWithEvents, 'VoteCast')
.withArgs(user.address, BigNumber.from(1), 1, 2, LONG_REASON);
Expand All @@ -278,7 +278,7 @@ describe('V3 Vote Refund', () => {
expect(balanceDiff).to.be.closeTo(await expectedBaseFeeCappedDiff(r), REFUND_ERROR_MARGIN);

expectRefundEvent(r, user, r.gasUsed.mul(MAX_REFUND_BASE_FEE.add(MAX_PRIORITY_FEE_CAP)));
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx)
.to.emit(govWithEvents, 'VoteCast')
.withArgs(user.address, BigNumber.from(1), 1, 2, 'some reason');
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('V3 Vote Refund', () => {
expect(balanceDiff).to.be.closeTo(BigNumber.from(0), REFUND_ERROR_MARGIN);

expectRefundEvent(r, user, await txCostInEth(r));
let govWithEvents = NounsDAOLogicV3__factory.connect(gov.address, gov.signer);
let govWithEvents = NounsDAOLogicV4__factory.connect(gov.address, gov.signer);
await expect(tx)
.to.emit(govWithEvents, 'VoteCast')
.withArgs(voter.address, BigNumber.from(2), 1, 1, 'some reason');
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('V3 Vote Refund', () => {
// Not using expect emit because it doesn't support the `closeTo` matcher
// Using longer event parsing because r.events doesn't work when using the Voter contract
// to simulate multisig usage; events are returned undefined
const daoInterface = NounsDAOLogicV3__factory.createInterface();
const daoInterface = NounsDAOLogicV4__factory.createInterface();
const eventId = ethers.utils.id('RefundableVote(address,uint256,bool)');
const filtered = r.logs.filter(l => l.topics[0] === eventId);
const parsed = filtered.map(e => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nouns-contracts/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
Inflator__factory,
NounsDAOStorageV2,
NounsDAOLogicV4,
NounsDAOLogicV3__factory as NounsDaoLogicV3Factory,
NounsDAOLogicV4__factory as NounsDaoLogicFactory,
NounsDAOProxyV3__factory as NounsDaoProxyV3Factory,
NounsDAOForkEscrow__factory as NounsDAOForkEscrowFactory,
INounsDAOLogicV3__factory,
Expand Down Expand Up @@ -558,7 +558,7 @@ export const deployGovernorV3 = async (deployer: SignerWithAddress): Promise<Nou
await ethers.getContractFactory('NounsDAOV3DynamicQuorum', deployer)
).deploy();

return await new NounsDaoLogicV3Factory(
return await new NounsDaoLogicFactory(
{
'contracts/governance/NounsDAOV3Proposals.sol:NounsDAOV3Proposals':
NounsDAOV3Proposals.address,
Expand Down
4 changes: 2 additions & 2 deletions packages/nouns-sdk/src/contract/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
NounsAuctionHouseFactory,
NounsDescriptorFactory,
NounsSeederFactory,
NounsDaoLogicV3Factory,
NounsDaoLogicFactory,
} from '@nouns/contracts';
import type { Signer } from 'ethers';
import type { Provider } from '@ethersproject/providers';
Expand Down Expand Up @@ -40,7 +40,7 @@ export const getContractsForChainOrThrow = (
addresses.nounsSeeder,
signerOrProvider as Signer | Provider,
),
nounsDaoContract: NounsDaoLogicV3Factory.connect(
nounsDaoContract: NounsDaoLogicFactory.connect(
addresses.nounsDAOProxy,
signerOrProvider as Signer | Provider,
),
Expand Down
2 changes: 1 addition & 1 deletion packages/nouns-sdk/src/contract/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export {
NounsAuctionHouseFactory,
NounsDescriptorFactory,
NounsSeederFactory,
NounsDaoLogicV3Factory,
NounsDaoLogicFactory,
NounsDaoExecutorV2Factory,
} from '@nouns/contracts';
4 changes: 2 additions & 2 deletions packages/nouns-sdk/src/contract/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
NounsAuctionHouseFactory,
NounsDescriptorFactory,
NounsSeederFactory,
NounsDaoLogicV3Factory,
NounsDaoLogicFactory,
} from '@nouns/contracts';

export interface ContractAddresses {
Expand All @@ -29,7 +29,7 @@ export interface Contracts {
nounsAuctionHouseContract: ReturnType<typeof NounsAuctionHouseFactory.connect>;
nounsDescriptorContract: ReturnType<typeof NounsDescriptorFactory.connect>;
nounsSeederContract: ReturnType<typeof NounsSeederFactory.connect>;
nounsDaoContract: ReturnType<typeof NounsDaoLogicV3Factory.connect>;
nounsDaoContract: ReturnType<typeof NounsDaoLogicFactory.connect>;
}

export enum ChainId {
Expand Down
4 changes: 2 additions & 2 deletions packages/nouns-webapp/src/wrappers/nounsDao.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NounsDAOV3ABI, NounsDaoLogicV3Factory } from '@nouns/sdk';
import { NounsDAOV3ABI, NounsDaoLogicFactory } from '@nouns/sdk';
import {
ChainId,
useBlockNumber,
Expand Down Expand Up @@ -262,7 +262,7 @@ export interface ForkSubgraphEntity {
}

const abi = new utils.Interface(NounsDAOV3ABI);
const nounsDaoContract = NounsDaoLogicV3Factory.connect(config.addresses.nounsDAOProxy, undefined!);
const nounsDaoContract = NounsDaoLogicFactory.connect(config.addresses.nounsDAOProxy, undefined!);

// Start the log search at the mainnet deployment block to speed up log queries
const fromBlock = CHAIN_ID === ChainId.Mainnet ? 12985453 : 0;
Expand Down
Loading

0 comments on commit 8a5fee9

Please sign in to comment.