Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voting tokens #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Voting tokens #2

wants to merge 9 commits into from

Conversation

MichaelKorchagin
Copy link

No description provided.

voter2,
] = await ethers.getSigners();

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

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");

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);

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);

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

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", []);

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"));

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

@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")

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")
);

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