DUSDLock Smartcontract
What kind of PR is this?:
/kind feature
What this PR does / why we need it:
Implementation for DFIP 2211-D: https://github.com/DeFiCh/dfips/issues/236
Additional comments?:
This is really great work and super appreciate the effort to get this in. But really wouldn't rush this -- would be better to have get some mind space to think about how to actually implement this cleanly.
Today it's lock 1 and lock 2, what if we need a different variant. It would be better to think through this some more before setting this in stone as a part of an immutable blockchain.
@kuegi Nice work. I'll write comments on the questions you asked in the code comments and necessary modifications.
I'll write comments on the questions you asked in the code comments and necessary modifications.
@Mixa84 thx. but its still WIP. since I didn't have a env setup its lots of small things not working out yet. Today I finally set it up and will refactor a bit (since we decided to not squeeze it into v3). So maybe wait till tomorrow, then the state of the branch will be much better (with tests and all)
I'll write comments on the questions you asked in the code comments and necessary modifications.
@Mixa84 thx. but its still WIP. since I didn't have a env setup its lots of small things not working out yet. Today I finally set it up and will refactor a bit (since we decided to not squeeze it into v3). So maybe wait till tomorrow, then the state of the branch will be much better (with tests and all)
I've added some stuff I saw currently and it will maybe help you in the refactor. If you already addressed those just resolve it ;)
I'll write comments on the questions you asked in the code comments and necessary modifications.
@Mixa84 thx. but its still WIP. since I didn't have a env setup its lots of small things not working out yet. Today I finally set it up and will refactor a bit (since we decided to not squeeze it into v3). So maybe wait till tomorrow, then the state of the branch will be much better (with tests and all)
I've added some stuff I saw currently and it will maybe help you in the refactor. If you already addressed those just resolve it ;)
thx a lot. adapted the code and logic. Now using a more generic approach so the attributes can define what lockperiods are available and which token is used (so no need to hardcode the token key now).
Not sure if the way I did the attribute keys is good or complete crap.
More tests are likely better, also to split the test function into more smaller tests. But at least they are green now ;)
I am thinking about switching the logic from "lockTime" to "batchId". cause in the end, that number is random. So we could build it with logic that there are batches in this smartcontract. Each batch would have
- associated lockToken
- limit how much DUSD can be swapped
- blockheight when withdrawal/swap back is possible
Any thoughts on that? @Mixa84 @prasannavl
@Mixa84 Thank you very much for the comments. I tried to implement all of them.
@Mixa84 @prasannavl anything left for me to do here?
Closing stale PRs. No longer relevant.