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

QA bug fixes #1305

Merged
merged 1 commit into from
Dec 14, 2023
Merged

QA bug fixes #1305

merged 1 commit into from
Dec 14, 2023

Conversation

mudrila
Copy link
Contributor

@mudrila mudrila commented Dec 12, 2023

Description

See linked issues

Notes

Issue / Notion doc (if applicable)

Closes #1299
Closes #1300
Closes #1201
Closes #1301
Closes #1302
Closes #1303
Closes #1304

Testing

Screenshots (if applicable)

@mudrila mudrila added bug Something isn't working enhancement New feature or request labels Dec 12, 2023
@mudrila mudrila self-assigned this Dec 12, 2023
Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for fractal-framework-interface-dev ready!

Name Link
🔨 Latest commit a8077bc
🔍 Latest deploy log https://app.netlify.com/sites/fractal-framework-interface-dev/deploys/6577a7d09c35c20008785c73
😎 Deploy Preview https://deploy-preview-1305--fractal-framework-interface-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

node: { daoName, daoAddress },
} = useFractal();
const { t } = useTranslation('treasury');
const treasuryTotal = useTreasuryTotalBN();
const showButton = user.votingWeight.gt(0) && !treasuryTotal.isZero();
const { canUserCreateProposal } = useSubmitProposal();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

canUserCreateProposal is retrieved from voting strategy contract, so this change fixes both bugs when min threshold for voting power is 0 and user have 0 tokens, but button doesn't appear. As well as bug when user don't have enough voting power to create proposal, but the button is still there

newCanVote = user.votingWeight.gt(0) && !hasVoted;
newCanVote =
(
await ozLinearVotingContract!.asSigner.getProposalVotingSupply(proposal.proposalId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This eventually gets past total supply for proposal's startBlock

@@ -199,7 +199,7 @@ export function DelegateModal({ close }: { close: Function }) {
!!errors.address ||
contractCallPending ||
!values.address ||
azoriusGovernance.votesToken?.balance?.isZero()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Allow delegating to yourself when tokens balance is 0.

@@ -199,7 +199,7 @@ export function DelegateModal({ close }: { close: Function }) {
!!errors.address ||
contractCallPending ||
!values.address ||
azoriusGovernance.votesToken?.balance?.isZero()
values.address === azoriusGovernance.votesToken?.delegatee
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disable button when user entered same address as current delegatee

await Promise.all([
ozLinearVotingContract.asSigner.votingPeriod(),
ozLinearVotingContract.asSigner.quorumNumerator(),
ozLinearVotingContract.asSigner.QUORUM_DENOMINATOR(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though QUORUM_DENOMINATOR is currently hardcoded - it might change in future. In order to have this case supported - we just fetching that from the contract

@sethhrbek sethhrbek changed the base branch from develop to fix/shutter-voting-fixes December 12, 2023 17:12
@sethhrbek sethhrbek changed the base branch from fix/shutter-voting-fixes to develop December 12, 2023 17:13
Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

#1201
seems not fixed to me ❌
I'm still able to cast votes on proposals that were created when my account had 0 voting tokens delegated to it
see: https://deploy-preview-1305--fractal-framework-interface-dev.netlify.app/daos/0x9E7A8CCEC8a4eC98fAA0696A41f5EDbfeB8B3B67/proposals/15

#1299
seems fixed to me ✅

#1300
seems fixed to me ✅

#1301
seems fixed to me ✅

#1302
seems fixed to me ✅

#1303
seems fixed to me ✅

#1304
seems fixed to me ✅

@adamgall adamgall self-requested a review December 14, 2023 20:03
@adamgall
Copy link
Member

@mudrila, i'm going to merge the QA Bug Fixes branch into both develop and main, to get those updates on production (now that DCNT and our Fractal Safe are launched!). when you get to addressing that one existing bug from this PR, please just create a new PR for it.

@adamgall adamgall merged commit e3569c5 into develop Dec 14, 2023
4 checks passed
@adamgall adamgall deleted the fix/bug-fixes branch December 14, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment