-
Notifications
You must be signed in to change notification settings - Fork 94
Uniswap like SC #260
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
base: develop
Are you sure you want to change the base?
Uniswap like SC #260
Conversation
First of all, thank you for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add more comments later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I have some comments now and will continue reviewing later.
cd4ebc5
to
69a085d
Compare
2. use qx.issueAssetFee and qx.transferFee 3. enable code for liqudity for individual 4. test for token issuance, pool creatation, add/remove liqudity, 4 swap interface
69a085d
to
c11ed34
Compare
fa66159
to
311db85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments about coding style and syntax, the rest look good to me. We can proceed proposal->ipo->going live after you addressing all comments.
Disclaimer: Ensuring correctness of the code and security of the funds in the contract is the responsibility of the team developing this contract. I (as a core dev) don’t have enough time for understanding all details and pentesting the SC. It's not the core devs responsibility to make sure this SC 100% bug-free but we do our best to give you the advices to avoid bugs based on our experience.
And my last advice is triple-checking everything before going live.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. The ones about compliance with licenses are very important IMO. I recommend to talk with @J0ET0M , because they may require some high-level decisions to be made.
Please don't rebase and force push, but merge the current |
2. remove dependency of <utilith> in uint128.h 3. add prefix for test in uint128 4. fix some misuse of NULL
2. fix some merge issue
Thanks for your feedback on the code review, I've just update the code, mainly the following items:
|
@J0ET0M can you take a look at license thing for uint128 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments. I have two minor requests additional. After addressing them, you can proceed with the proposal.
Please note the disclaimer written by dkat above. We recommend triple-checking everything before going live, because ensuring correctness of the code and security of the funds in the contract is the responsibility of the team developing this contract (NOT of the core devs reviewing and providing feedback).
Please note that the syntax of how contract procedures and functions are defined will change with the next release. See #361 for details. |
Implement a uniswap like LP in qubic
In the SC, users can create pools with two kind of asset, native qu and asset (like erc20)
users is able to add liqudity and remove liqudity from the pool,
the apis can be used in the contracts are following:
CreatePool
create a liqudity pool which can hold both native qu and asset
AddLiqudity, RemoveLiqudity
users can add/remove liqudity to/from the pool
SwapExactQuForAsset, SwapQuForExactAsset, SwapExactAssetForQu, SwapAssetForExactQu
users can swap in the pool by AMM with differnt requirement
SwapFee
query the protocol swap fee
GetPoolBasicState
get the pool state, such as totoal liqudity and reserve amount of native qu and asset
GetLiqudityOf (Not avaialbe currently)
QuoteExactQuInput, QuoteExactQuOutput, QuoteExactAssetInput, QuoteExactAssetOutput
get the amountIn/amountOut before swap