Move VRGDA logic into a lib
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.
wait why close?
sorry my bad for not merging earlier
@transmissions11 was just cleaning up some loose ends on GH, thought maybe this wasn't what you wanted haha Should I reopen?
yes def, sorry i will clean this up asap and get it merged!
yes def, sorry i will clean this up asap and get it merged!
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!