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

Contract: emit activityKey in NewCommitment event #57

Open
spengrah opened this issue Jun 29, 2021 · 0 comments
Open

Contract: emit activityKey in NewCommitment event #57

spengrah opened this issue Jun 29, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@spengrah
Copy link
Member

Currently, the ActivityUpdated and NewCommitment events have the below signatures. Most importantly, NewCommitment only emits the activityName param and not the activityKey param, which forces the subgraph to use activityName as the ID for the Activity entity. Since the contract logic ensures there are no collisions between activityNames this is technically ok, but its more conventional to use something other than plaintext as an entity id.

In the next version of the contract, NewCommitment should emit the activityKey param. For readability on block explorers, it can also emit the plaintext activityName param, though that does carry a small gas cost.

event ActivityUpdated(string name, bytes32 activityKey, address oracle, bool allowed, bool exists);

event NewCommitment(address committer, string activityName, uint256 goalValue, uint256 startTime, uint256 endTime, uint256 stake);
@spengrah spengrah added the enhancement New feature or request label Jun 29, 2021
@spengrah spengrah added this to the v1 milestone Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant