-
Notifications
You must be signed in to change notification settings - Fork 607
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
feat/docs(CWPool): contract messages and basic readme #4792
Conversation
]; | ||
} | ||
|
||
message SwapExactAmountOutSudoMsg { |
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.
If we're gonna launch the contract first and pools chain side later, then the messages need to be execute, not sudo (as only the chain can send sudo messages).
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.
Good point. Let me cut an issue to discuss with Boss in a future iteration
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.
Ideally, this should still be a sudo message, and the contract refactored and upgraded.
We should be customizing the contract to make the chain code as secure and general as possible instead of adjusting chain code to be transmuter-specific
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.
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 still think it makes sense for this to be an exec. Is there a reason we don't want people using the pools directly?
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.
Tagged you here with the reasoning: #4810 (comment)
Even if we decide to change this in the future, let's not block this PR on this request, please. The reason is that everything else in the spike #4675, including the test contract, depends on these messages being sudo. As a result, it would be blocked on Boss refactoring the test contract.
I will make sure to use #4797 as a tracker to address this based on the conclusions from discussions we are having here: #4810 (comment)
Let me know if that works
|
||
// CalcOutAmtGivenIn | ||
func NewCalcOutAmtGivenInRequest(tokenIn sdk.Coin, tokenOutDenom string, swapFee sdk.Dec) CalcOutAmtGivenInRequest { | ||
return CalcOutAmtGivenInRequest{ |
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.
Just our of curiosity, these functions should always return the the same as the inputs for transmuter, right?
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.
Not sure I understand the question - but these functions are just meant to reduce boilerpate from callers. Instead of hardcoding the entire struct request every time, we can call this helper constructor
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.
yeah, that makes sense. My understanding of transmutter is that it just swaps tokens 1:1. So I guess these functions don't have anything to calculate: send 1 axlusdc, get 1 nobleusdc.
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.
These abstractions are enforced by PoolI
and PoolModuleI
interfaces from x/poolmanager
. We use them in x/gamm
and x/concentrated-liquidity
as well.
Calc in this context means that this is the same operation as swap but does not persist any updates to state (is non-mutative)
With the exception of the sudo messages and the proto checks failing, this lgtm |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
@@ -0,0 +1,39 @@ | |||
# CosmWasm Pool Module |
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.
Note: @iboss-ptk I'm down to eventually overwrite/merge this with yours #4810, and can help with resolving conflicts
Thanks! Merging. Will refresh #4675 and continue working there |
* feat/docs(CWPool): contract messages and basic readme * proto gen
Closes: #XXX
What is the purpose of the change
This PR merges #4675 in smaller chunks.
The change here focuses on generating message boilerplate to interact between the chain and the contract.
Additionally, it adds basic READMEs. No state breaks in this PR.
Review suggestion: only skim
proto
folder and README.md. This is under 300 LOC, the rest is generated boilerplate.Testing and Verifying
This change is a trivial rework / code cleanup without any test coverage.
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? no