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

🎨 Refactor: Decouple GitConsensus to only commit/tag state, use seperate contracts for rewards #37

Open
mattstam opened this issue Sep 28, 2022 · 0 comments
Assignees

Comments

@mattstam
Copy link
Contributor

Logic in GitConsensus could be seen as changeable (e.g. to do mint() vs. transfer() functionality in #29), which really is a no-go for immutable contracts. Any upgrades to the GitConsensus contract would wipe all state (previously saved commits/tags).

To avoid this, we should keep the GitConsensus ridiculously simple.

From

IGitConsensus.sol:

addCommit(CommitData commit) 
addRelease(TagData tag, bytes20[] hashes, uint256[] values) 
hashAddr(bytes20 hash) 
hashExists(bytes20 hash) 

* builds on the assumption of #36

 

to

IGitConsensus.sol:

addCommit(CommitData commit) 
addTag(TagData tag) 
hashAddr(bytes20 hash) 
hashExists(bytes20 hash) 

IDistribution.sol:

rewardByMint(address tokenAddr, bytes20[] hashes, uint256[] values) 
rewardByTransfer(address tokenAddr, bytes20[] hashes, uint256[] values) 
// some other rewardance mechanisms, potentially coupled with tags/releases

 

It is hard imagine a scenario is which the new IGitConsensus.sol would need to be updated now (basically just setters & getters that mirror what Git does). By isolating GitConsensus, we can create and update other logical contracts while leaving the state of this consistent, which is really important because we don’t want to remove saved hash state.

This is also going to make it easier to propose just GitConsensus interface as an future EIP / ERC to the Ethereum board, which eventually we want to do with either method.

@mattstam mattstam changed the title Refactor: Decouple GitConsensus to only commit/tag state, use seperate contracts for rewards 🎨 Refactor: Decouple GitConsensus to only commit/tag state, use seperate contracts for rewards Sep 28, 2022
@Bryce-Soghigian Bryce-Soghigian self-assigned this Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants