VRGDAs icon indicating copy to clipboard operation
VRGDAs copied to clipboard

Move VRGDA logic into a lib

Open 0xBeans opened this issue 3 years ago • 6 comments

PR for https://github.com/transmissions11/VRGDAs/issues/12

Followed the design of https://github.com/transmissions11/libcompound - split Linear and Logistic into 2 libs.

0xBeans avatar Sep 07 '22 02:09 0xBeans

wait why close?

transmissions11 avatar Oct 19 '22 00:10 transmissions11

sorry my bad for not merging earlier

transmissions11 avatar Oct 19 '22 00:10 transmissions11

@transmissions11 was just cleaning up some loose ends on GH, thought maybe this wasn't what you wanted haha Should I reopen?

0xBeans avatar Oct 19 '22 00:10 0xBeans

yes def, sorry i will clean this up asap and get it merged!

transmissions11 avatar Oct 19 '22 01:10 transmissions11

yes def, sorry i will clean this up asap and get it merged!

Screen Shot 2022-10-18 at 9 21 50 PM

0xBeans avatar Oct 19 '22 01:10 0xBeans

Hi @transmissions11 @0xBeans, I'm working on a VRGDA project that needs this library in order to make our contract upgradeable. To that end, I rebased this branch so it is up-to-date with current master branch, except for the LogisticToLinear implementation since it was only added recently. I pushed that branch here https://github.com/transmissions11/VRGDAs/compare/master...nvonpentz:VRGDAs:library-rebase?expand=1.

When making the remaining changes to the LogisticToLinear implementation, I noticed the abstractions didn't fit as well, so I created a fresh branch with a different approach. You can see that here https://github.com/transmissions11/VRGDAs/compare/master...nvonpentz:VRGDAs:library?expand=1. The main differences are that it

  • Creates one library instead of two, with only one getVRGDAPrice function (similar to master), and separate getTargetSaleTimeLinear and getTargetSaleTimeLogistic functions.
  • Does not remove all the abstract classes. Instead, logic common between the different VRGDA types (i.e. the getVRGDAPrice function) is defined in an abstract VRDGA class that Linear, Logitistic, and LogisticToLinear inherit from. I implemented things such that the interfaces defined by the current abstract contracts on master are preserved.

If it's useful, I'm happy to open a PR for either, but I also want to be respectful of the work @0xBeans has done already. In this case I went ahead and implemented in order to unblock myself. Cheers!

nvonpentz avatar Nov 20 '22 19:11 nvonpentz