Skip to content

Voting tokens#2

Open
MichaelKorchagin wants to merge 9 commits intomainfrom
Voting-tokens
Open

Voting tokens#2
MichaelKorchagin wants to merge 9 commits intomainfrom
Voting-tokens

Conversation

@MichaelKorchagin
Copy link
Copy Markdown

No description provided.

Comment thread contracts/votingTokens/IZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread contracts/votingTokens/ZeroVotingERC20.sol
Comment thread test/votingTokens.test.ts
Comment thread test/votingTokens.test.ts
Comment thread test/votingTokens.test.ts
Comment thread test/votingTokens.test.ts
Comment thread test/votingTokens.test.ts
Comment thread test/votingTokens.test.ts
voter2,
] = await ethers.getSigners();

const Token = await ethers.getContractFactory("MockERC20Votes");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change all tests to use actual token contracts and not mocks. in ALL Tests

token = await Token.deploy("Governance Token", "GT", owner);
await token.waitForDeployment();

const Token2 = await ethers.getContractFactory("MockERC721Votes");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

] = await ethers.getSigners();

const Token = await ethers.getContractFactory("MockERC20Votes");
token = await Token.deploy("Governance Token", "GT", owner);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erc20Token

await token.waitForDeployment();

const Token2 = await ethers.getContractFactory("MockERC721Votes");
token2 = await Token2.deploy("Governance Token 2", "GT2", "1.0", owner);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erc721Token

5n,
1n,
0n,
2n
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are these values taken from? this needs to be thought out. now it seems to be negating all the below tests cause quorum seems to be 0

);

await ethers.provider.send("evm_increaseTime", [3600]);
await ethers.provider.send("evm_mine", []);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these 2 lines here? what do they do?


const finalBalance = await token.balanceOf(proposer.address);
// 1000 was before mint and then mints 100 more.
expect(finalBalance).to.equal(ethers.parseUnits("1100"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not a variable that we get from the code? some balanceBefore + mintAmt or something

expect(finalBalance).to.equal(ethers.parseUnits("1100"));
});

it("Other vote, while one propose executes", async () => {
Copy link
Copy Markdown

@Whytecrowe Whytecrowe Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proposal. also unclear title

expect(
await token.balanceOf(voter1.address)
).to.equal(
ethers.parseUnits("550")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variables calculated in the test! no hardcoded values

await token.balanceOf(voter2.address)
).to.equal(
ethers.parseUnits("575")
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are voting tokens used? what happens with them?
can you vote with 0 token? can you vote if not delegated any tokens?
can you vote if have tokens but none delegated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants