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

Streaming Grant Mecahnics #17

Merged
merged 13 commits into from
Apr 25, 2020
Merged

Streaming Grant Mecahnics #17

merged 13 commits into from
Apr 25, 2020

Conversation

apbendi
Copy link
Member

@apbendi apbendi commented Apr 24, 2020

Basic functionality for issuing & revoking streaming grants via Sablier.

Aside from needing some cleanup & cleaning up the commit history I think this is good to go. I also had to increase gas limits (not sure if it's real or a bug) but I set them to super high numbers. Need to investigate this.

closes #6
closes #7
closes #11

@apbendi apbendi requested a review from mds1 April 24, 2020 22:00
@mds1
Copy link
Contributor

mds1 commented Apr 24, 2020

I also had to increase gas limits (not sure if it's real or a bug) but I set them to super high numbers. Need to investigate this.

I had a similar issue and created #16 for it. If you have any details to add that would probably be a good place to put them

@mds1
Copy link
Contributor

mds1 commented Apr 24, 2020

Some questions/thoughts:

  1. We should probably rename Moloch to Endaoment everywhere
  2. What was the rationale for removing Ownable.sol and implementing similar (but reduced) functionality manually?
  3. If a grant or revocation proposal does not pass, I think we do not need to do anything in the else blocks where it says // TODO: anything?
  4. Pool.sol: Do we need this file? It's not used. I haven't looked at it closely but I don't remember what it's used for
  5. I'd recommend putting dai.json in a folder called abi at the project root, and adding a file called addresses.json at the project root with all relevant contract address. We'll need those in both the contracts and frontend so probably should have it all in one spot
    • Oh just noticed you're using environment variables for the addresses so that works too

Otherwise, all tests passed! 🥳

Other general question—in the tests I noticed you do things like this.instance in the before() hook, whereas with Truffle tests I (we?) previously used let instance; just above the before hook and instance = ... within the hook when creating the contract. Is there any tradeoffs / reasons / considerations here as to the differences in the approaches?

@apbendi apbendi force-pushed the stream branch 2 times, most recently from 8a4cdfc to c6aa21a Compare April 25, 2020 01:32
* Rename contract & contract file
* Replace all error messages and comments throughout
  the contract
@apbendi
Copy link
Member Author

apbendi commented Apr 25, 2020

Great feedback. Thanks!

We should probably rename Moloch to Endaoment everywhere

Good call. Done.

What was the rationale for removing Ownable.sol and implementing similar (but reduced) functionality manually?

Good question. So the new OZ contracts all use the "initializer" pattern, which broke Moloch's assumptions around the owner being set automatically in the constructor. When I realized this, I tried calling the initialize function but then I got out of gas errors. Didn't seem worth fighting with especially because the Endaoment contract owns the Guildbank and literally can't utilize the rest of OZ's Ownable implementation (unless we expanded it).

If a grant or revocation proposal does not pass, I think we do not need to do anything in the else blocks where it says // TODO: anything?

Don't think so either. Removed.

Pool.sol: Do we need this file? It's not used. I haven't looked at it closely but I don't remember what it's used for

Agreed don't think we need it.

I'd recommend putting dai.json in a folder called abi at the project root, and adding a file called addresses.json at the project root with all relevant contract address. We'll need those in both the contracts and frontend so probably should have it all in one spot

Ahh yes good call, will do this.

Other general question—in the tests I noticed you do things like this.instance in the before() hook, whereas with Truffle tests I (we?) previously used let instance; just above the before hook and instance = ... within the hook when creating the contract. Is there any tradeoffs / reasons / considerations here as to the differences in the approaches?

No major tradeoffs I'm aware of. In fact if my understand of JavaScript is correct they're functionally the same. Not sure why I used this this time 🤷‍♂️

@apbendi
Copy link
Member Author

apbendi commented Apr 25, 2020

OK! I've made changes for all your suggestions and rebased to your (now merged) branch. If it looks good to you, feel free to merge!

@apbendi apbendi changed the title WIP: Streaming Grant Mecahnics Streaming Grant Mecahnics Apr 25, 2020
@mds1 mds1 merged commit 4710adf into master Apr 25, 2020
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

Successfully merging this pull request may close these issues.

Implement Guild Bank <--> Sablier Integration Proposal To End A Stream Proposal Type To Create A Stream
2 participants