-
Notifications
You must be signed in to change notification settings - Fork 54
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
(Feature) Votings to Manage Emission Funds #173
Conversation
src/components/NewBallot.jsx
Outdated
const { ballotStore, contractsStore } = this.props | ||
const inputToMethod = { | ||
startTime: startTime, | ||
endTime: ballotStore.endTimeUnix, | ||
endTime: endTime, |
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.
could be written shorter:
startTime: startTime,
=> startTime,
endTime: endTime,
=> endTime,
src/components/NewBallot.jsx
Outdated
const { ballotStore, contractsStore } = this.props | ||
const inputToMethod = { | ||
startTime: startTime, | ||
endTime: ballotStore.endTimeUnix, | ||
endTime: endTime, |
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.
the same as above ☝️
src/components/NewBallot.jsx
Outdated
const { ballotStore, contractsStore } = this.props | ||
const inputToMethod = { | ||
startTime: startTime, | ||
endTime: ballotStore.endTimeUnix, | ||
endTime: endTime, |
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.
the same as above ☝️
src/components/NewBallot.jsx
Outdated
createBallotForEmissionFunds = (startTime, endTime) => { | ||
const { ballotStore, contractsStore } = this.props | ||
const inputToMethod = { | ||
startTime: startTime, |
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.
the same as above ☝️
note = <p>To be able to create a new ballot, the previous ballot of this type must be finalized.</p> | ||
} | ||
if (contractsStore.netId === '77') { | ||
explorerLink = `https://sokol-explorer.poa.network/account/${contractsStore.emissionFunds.address}` |
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.
I would suggest changing the link to Blockscout explorer:
https://blockscout.com/poa/sokol/address/${contractsStore.emissionFunds.address}
Also, I would suggest considering using eth-net-props npm package to get explorer URL for network by its ID (method getExplorerAccountLinkFor(addr, networkID)
).
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.
@vbaranov Yes, but something's wrong with Blockscout
displaying balance of EmissionFunds
contract - it shows 0 POA
for 0x523B6539Ff08d72A6C8Bb598Af95bF50c1EA839C
but sokol-explorer
shows correct balance: https://sokol-explorer.poa.network/account/0x523B6539Ff08d72A6C8Bb598Af95bF50c1EA839C
I think Blockscout
doesn't take into account the balance that was accumulated not as a result of transactions.
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.
Sounds like a bug. Was it reported in Blockscout repo?
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.
I've notified @acravenho about this and opened the issue blockscout/blockscout#767.
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.
@vbaranov Maybe use https://sokol.poaexplorer.com/address/search/0x523B6539Ff08d72A6C8Bb598Af95bF50c1EA839C instead of old sokol-explorer
?
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, let's use it until this issue will have not been fixed in Blockscout
onChange={e => ballotStore.changeBallotMetadata(e, 'receiver', 'ballotEmissionFunds')} | ||
/> | ||
<p className="hint"> | ||
The address to which the funds will be sent if `Send` operation obtains the majority of votes. |
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.
Maybe, let's rewrite shorter: The address which the funds will be sent to, in case of the majority of votes
? What do you think @varasev?
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.
Agree.
@observer | ||
export class BallotEmissionFundsCard extends React.Component { | ||
render() { | ||
let { id, votingState, pos, contractsStore } = this.props |
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.
These parameters are not changed. Let's change the declaration to const
.
src/components/NewBallot.jsx
Outdated
.add(minBallotDurationInHours, 'hours') | ||
.format() | ||
let neededMinutes = moment(minEndTime).diff(moment(ballotStore.endTime), 'minutes') | ||
let neededHours = Math.floor(neededMinutes / 60) |
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.
neededHours
is not changed => const
src/components/NewBallot.jsx
Outdated
.utc() | ||
.add(14, 'days') | ||
.format() | ||
let exceededMinutes = moment(ballotStore.endTime).diff(moment(twoWeeks), 'minutes') |
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.
The same as above: let
to const
Description of |
(Mandatory) Description
This PR solves the issue #130.
We have done 3rd HF in
Sokol
network, so now we have new smart contracts deployed there.Thereby a new type of ballot has been added to
Governance DApp
with this PR. For now it is only supported forSokol
because we still have old contracts inCore
.Below are screenshots of DApp showing the new type of a ballot.
How the ballot's card looks:
Creator of a ballot can cancel the ballot within 15 minutes right after its creation (according to poanetwork/poa-network-consensus-contracts#161):
Here is how
New Ballot
page looks (it is not displayed forCore
in this version):I.e., a validator should enter a ballot description and paste an address of funds receiver. The field
Current amount of funds
is not editable and just shows the current balance ofEmissionFunds
contract.Above the
Add Ballot
button, we see the note with time interval when the next ballot of this type can be created. The bounds of the interval are calculated automatically and depend onVotingToManageEmissionFunds
contract's parameters such asrelease time
,emission release threshold
, anddistribution threshold
described here.For
Sokol
therelease time
is equal to20 Sep 2018 10:37 UTC
, theemission release threshold
is equal to7 days
, anddistribution threshold
is equal to3 days
.Therefore, the nearest ballot of this type in
Sokol
can be started from20 Sep 2018 10:37 UTC
(the nearestrelease time
) and it will be finished on23 Sep 2018 10:37 UTC
as shown on the screen above. I.e. the end date of the ballot will be20 Sep 2018 10:37 UTC plus Distribution threshold
.The next ballot will be able to be started from
27 Sep 2018 10:37 UTC
(nextrelease time
) and so on.Some explanation of
release time
andemission release threshold
can be found here: poanetwork/poa-network-consensus-contracts#168 (comment)(Mandatory) What is it: (Fix), (Feature) or (Refactor)
(Feature)