-
Notifications
You must be signed in to change notification settings - Fork 7
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 quorum formatting #1348
Fix quorum formatting #1348
Changes from all commits
871bc54
d19d8df
cb1cbf0
4cb3f1b
5ecbffc
82e1662
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,17 +90,22 @@ export class AzoriusTxBuilder extends BaseTxBuilder { | |
} | ||
} | ||
} | ||
} | ||
|
||
this.setPredictedStrategyAddress(); | ||
public async init() { | ||
await this.setPredictedStrategyAddress(); | ||
this.setPredictedAzoriusAddress(); | ||
this.setContracts(); | ||
|
||
if (daoData.votingStrategyType === VotingStrategyType.LINEAR_ERC20) { | ||
daoData = daoData as AzoriusERC20DAO; | ||
if ( | ||
(this.daoData as AzoriusERC20DAO | AzoriusERC721DAO).votingStrategyType === | ||
VotingStrategyType.LINEAR_ERC20 | ||
) { | ||
const azoriusDAOData = this.daoData as AzoriusERC20DAO; | ||
Comment on lines
+101
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mudrila can you explain these few lines a bit more? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the And if you're talking about |
||
if ( | ||
parentTokenAddress && | ||
daoData.parentAllocationAmount && | ||
!daoData.parentAllocationAmount.isZero() | ||
this.parentTokenAddress && | ||
azoriusDAOData.parentAllocationAmount && | ||
!azoriusDAOData.parentAllocationAmount.isZero() | ||
) { | ||
this.setEncodedSetupTokenClaimData(); | ||
this.setPredictedTokenClaimAddress(); | ||
|
@@ -373,9 +378,11 @@ export class AzoriusTxBuilder extends BaseTxBuilder { | |
); | ||
} | ||
|
||
private setPredictedStrategyAddress() { | ||
private async setPredictedStrategyAddress() { | ||
const azoriusGovernanceDaoData = this.daoData as AzoriusGovernanceDAO; | ||
if (azoriusGovernanceDaoData.votingStrategyType === VotingStrategyType.LINEAR_ERC20) { | ||
const quorumDenominator = | ||
await this.azoriusContracts!.linearVotingMasterCopyContract.QUORUM_DENOMINATOR(); | ||
const encodedStrategyInitParams = defaultAbiCoder.encode( | ||
['address', 'address', 'address', 'uint32', 'uint256', 'uint256', 'uint256'], | ||
[ | ||
|
@@ -384,7 +391,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { | |
'0x0000000000000000000000000000000000000001', // Azorius module | ||
azoriusGovernanceDaoData.votingPeriod, | ||
BigNumber.from(1), // proposer weight, how much is needed to create a proposal. | ||
azoriusGovernanceDaoData.quorumPercentage, // quorom numerator, denominator is 1,000,000, so quorum percentage is 50% | ||
azoriusGovernanceDaoData.quorumPercentage.mul(quorumDenominator.div(100)), // quorom numerator, denominator is 1,000,000, so quorum percentage is quorumNumerator * 100 / quorumDenominator | ||
BigNumber.from(500000), // basis numerator, denominator is 1,000,000, so basis percentage is 50% (simple majority) | ||
] | ||
); | ||
|
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.
Yes!