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

fix resolution counting with delegation #141

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contracts/ResolutionManager/ResolutionManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ abstract contract ResolutionManagerBase {
//if (!resolution.hasVoted[msg.sender]) {
// Did sender's delegate vote?
if (
!resolution.hasVoted[msg.sender] &&
resolution.hasVoted[delegate] &&
resolution.hasVotedYes[delegate]
) {
Expand Down
22 changes: 22 additions & 0 deletions test/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,28 @@ describe("Integration", async () => {
expect(resolutionResult).equal(true);
});

it("bug #10", async () => {
await _makeContributor(user1, 65);
await _makeContributor(user2, 32);

await _delegate(user1, user2); // yesTotalVote == 33

const resolutionId = await _prepareResolution();
await _makeVotable(resolutionId);

await _vote(user1, false, resolutionId);
await _vote(user2, true, resolutionId);
await _vote(user1, true, resolutionId);

await _endResolution();

const resolutionResult = await resolutionManager.getResolutionResult(
resolutionId
);

expect(resolutionResult).equal(true);
});

// Mint token to a multiple shareholder
// Promote them to contributor
// Self-delegate
Expand Down
Loading