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

Multichain erc20 vote weight + Native ETH voting #10049

Merged
merged 12 commits into from
Dec 4, 2024

Conversation

rbennettcw
Copy link
Contributor

@rbennettcw rbennettcw commented Nov 26, 2024

Link to Issue

Closes: #9849
Closes: #9927

Description of Changes

  • Adds support for chain selection on ERC20 weighted topics
  • Adds support for native ETH for ERC20 weighted topics

Test Plan

  • Ensure you have >= 1 CMN token on base sepolia
  • Create ERC20 topic with token address 0x429ae85883f82203D736e8fc203A455990745ca1 (CMN token) with chain set to base sepolia and vote multiplier of 1
    • Create thread on topic and upvote it, ensure that upvote weight matches the number of tokens you own
  • Create ERC20 topic using native token, with chain set to base sepolia (or any other chain you have native ETH on)
    • Create thread on topic and upvote it, ensure that upvote weight matches number of full tokens you own (not fractional)

Deployment Plan

N/A

Other Considerations

  • Maybe native ETH should be a new topic type and not use ERC20 type?

@rbennettcw rbennettcw requested a review from masvelio December 2, 2024 14:38
@rbennettcw rbennettcw marked this pull request as ready for review December 2, 2024 14:38
@rbennettcw rbennettcw changed the title Multichain erc20 vote weight WIP Multichain erc20 vote weight + Native ETH voting Dec 2, 2024
Copy link
Contributor

@masvelio masvelio left a comment

Choose a reason for hiding this comment

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

  1. Change the name of the voting strategy from "Connect ERC 20" to "Use ERC20/ETH"

This one from the ticket is not applied

  1. Created community on BASE and topic with native address. Vote weight is 0 for me even though I have ~0.22 base eth in my wallet.

image

  1. Cant vote on a thread in topic that uses native token.
Kapture.2024-12-02.at.16.44.57.mp4

image

  1. There are some TS error around getTokenError in two components

@rbennettcw
Copy link
Contributor Author

Issue w/ native token has been fixed, UI updated.

Copy link
Contributor

@Rotorsoft Rotorsoft left a comment

Choose a reason for hiding this comment

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

Should we be testing these changes?

@rbennettcw
Copy link
Contributor Author

Should we be testing these changes?

Will fill a more thorough CA test plan + add lifecycle coverage

@masvelio
Copy link
Contributor

masvelio commented Dec 4, 2024

I have 0.22 base eth in my wallet, vote weight is displayed as 0 (as we dont display decimal points here), but when I upvote, it counts as 1. Weight 0 is misleading in this case.

image

@rbennettcw
Copy link
Contributor Author

Updated testing instructions. I tried to add a test to the lifecycle, but I was unable to figure out how to mock the TBC, likely because of the way it's exported.

I attempted to update the exports to match other mocked libs, but didn't want to potentially cause a regression elsewhere. Will try again later.

@rbennettcw rbennettcw merged commit eb63537 into master Dec 4, 2024
10 checks passed
@sachben91
Copy link

I have 0.22 base eth in my wallet, vote weight is displayed as 0 (as we dont display decimal points here), but when I upvote, it counts as 1. Weight 0 is misleading in this case.

image

hmm, should we show fractional vote weights? so something like 0.2 votes? ideally admin sets up vote weights appropriately so that its not needed so something like 0.1 base eth = 1 vote but in cases where they dont we should have fractional vote weight

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.

Add ETH based weighted voting Add weighted voting for other chains
4 participants