skmgoldin / tcr

A generic token-curated registry
Apache License 2.0
278 stars 131 forks source link

Discussion: Event changes #46

Closed kangarang closed 6 years ago

kangarang commented 6 years ago

REGISTRY

_Application: add appEndDate

_Challenge: remove deposit, add challenger, change pollID to challengeID

_NewListingWhitelisted: change to _ApplicationWhitelisted

Add: (#35 & #45)

Current Implementation:

event _Application(bytes32 listingHash, uint deposit, string data);
event _Challenge(bytes32 listingHash, uint deposit, uint pollID, string data);
event _Deposit(bytes32 listingHash, uint added, uint newTotal);
event _Withdrawal(bytes32 listingHash, uint withdrew, uint newTotal);
event _NewListingWhitelisted(bytes32 listingHash);
event _ApplicationRemoved(bytes32 listingHash);
event _ListingRemoved(bytes32 listingHash);
event _ChallengeFailed(uint challengeID);
event _ChallengeSucceeded(uint challengeID);
event _RewardClaimed(address voter, uint challengeID, uint reward);

Proposed implementation:

* event _Application(bytes32 listingHash, uint deposit, uint appEndDate, string data);
* event _Challenge(bytes32 listingHash, address challenger, uint challengeID, string data);
  event _Deposit(bytes32 listingHash, uint added, uint newTotal);
  event _Withdrawal(bytes32 listingHash, uint withdrew, uint newTotal);
* event _ApplicationWhitelisted(bytes32 listingHash);
  event _ApplicationRemoved(bytes32 listingHash);
  event _ListingRemoved(bytes32 listingHash);
+ event _ListingWithdrawn(bytes32 listingHash);
+ event _TouchAndRemoved(bytes32 listingHash);
  event _ChallengeFailed(uint challengeID);
  event _ChallengeSucceeded(uint challengeID);
  event _RewardClaimed(address voter, uint challengeID, uint reward);

PARAMETERIZER

Add: (#34)

Add: (#33)

Current:

event _ReparameterizationProposal(address proposer, string name, uint value, bytes32 propID);
event _NewChallenge(address challenger, bytes32 propID, uint pollID);

Proposed:

  event _ReparameterizationProposal(address proposer, string name, uint value, bytes32 propID);
  event _NewChallenge(address challenger, bytes32 propID, uint pollID);
+ event _ProposalAccepted(bytes32 propID);
+ event _ProposalUnprocessed(bytes32 propID);
+ event _ChallengeSucceeded(uint challengeID);
+ event _ChallengeFailed(uint challengeID);
+ event _RewardClaimed(address voter, uint challengeID, uint reward);

PLCRVOTING

PollCreated: change args to commitEndDate, revealEndDate

Add: underscores for convention

Experimental: VoteRevealed: change to (voter, pollID, votesFor, votesAgainst)

Current:

event VoteCommitted(address voter, uint pollID, uint numTokens);
event VoteRevealed(address voter, uint pollID, uint numTokens, uint choice);
event PollCreated(uint voteQuorum, uint commitDuration, uint revealDuration, uint pollID);
event VotingRightsGranted(address voter, uint numTokens);
event VotingRightsWithdrawn(address voter, uint numTokens);

Proposed:

_  event _VoteCommitted(address voter, uint pollID, uint numTokens);
*  event _VoteRevealed(address voter, uint pollID, uint votesFor, uint votesAgainst);
*  event _PollCreated(uint voteQuorum, uint commitEndDate, uint revealEndDate, uint pollID);
_  event _VotingRightsGranted(address voter, uint numTokens);
_  event _VotingRightsWithdrawn(address voter, uint numTokens);
eccheung4 commented 6 years ago

Nice, looks good to me.

Not sure if challenger needs to be added to _Challenge event as I get that from the sender of transaction, but not against adding it.

kangarang commented 6 years ago

oh yeah, good point @eccheung4 . i do that too lol

kangarang commented 6 years ago

@eccheung4 , any particular thoughts on the experimental change?

event _VoteRevealed(address voter, uint pollID, uint votesFor, uint votesAgainst);

kangarang commented 6 years ago

maybe...

event _VoteRevealed(uint pollID, uint numTokens, uint votesFor, uint votesAgainst);

since address voter we can get from tx.from

by that same logic, we can get rid of all the address voters

kangarang commented 6 years ago

@eccheung4

Here's another good one

Current:

event _ChallengeFailed(uint challengeID);
event _ChallengeSucceeded(uint challengeID);

Proposed:

event _ChallengeFailed(uint challengeID, uint rewardPool, uint totalTokens);
event _ChallengeSucceeded(uint challengeID, uint rewardPool, uint totalTokens);
kangarang commented 6 years ago

_ProposalUnprocessed(bytes32 propID); -> _ProposalExpired(bytes32 propID);

kangarang commented 6 years ago

Resolved:

Registry: f5b42b26c7be4ae2a0f7756d6e079561a6a0b925

PLCRVoting: cab98ed1f8fb9746dd4f1afb7149bbd86db0f6fe

Parameterizer: 6d3eac7a54209dad485454bf26a907e1151b2d29

kangarang commented 6 years ago

Sorry, I didn't mean to close this so abruptly. Please feel free to comment with any feedback and I'll be happy to reopen this issue.

kangarang commented 6 years ago

Still need to add: