-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
… Transferred helper function to the separate module. Added ESLint to the project. Installed Chai for tests. Updated gitignore.
…flow tests sketch.
…. Added interfaces for both tokens. Adapted mock contract.
…l. Touched up existing tests.
voter2, | ||
] = await ethers.getSigners(); | ||
|
||
const Token = await ethers.getContractFactory("MockERC20Votes"); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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", []); |
There was a problem hiding this comment.
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")); |
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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") | ||
); |
There was a problem hiding this comment.
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?
No description provided.