-
Notifications
You must be signed in to change notification settings - Fork 1
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
add swap function, queries #3
base: main
Are you sure you want to change the base?
Conversation
new_admin, | ||
new_event_tracker, | ||
} => { | ||
STATE.update(deps.storage, |mut state| -> StdResult<_> { |
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.
State
/STATE
&c may be better named Config
.
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.
State
/STATE
includes configuration and pool_count
which is not a part of config.
if let Some(new_admin) = new_admin { | ||
state.admin = new_admin; | ||
} |
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.
One question I had, what is the point of being able to transfer admin account vs having a list of admins (or similar)?
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 think if we don't have to implement multiple admins, a single admin will be better for security.
src/msg.rs
Outdated
/// Pool id. | ||
pool_id: Uint256, |
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 know it's hard, but this cannot be the documentation for pool id.
- You can make a newtype
struct PoolId(Uint256)
and document that (what is a pool id?), then this documentation becomes a little forgivable. - OR You can describe here what a pool id is and what it's used for. Are liquidity elements identified by their pool id (one per pool?), the queue id? Both? &c.
- Or you can do some combo. Newtypes are a little rust specific but they would go a long way towards clarifying this code.
(this applies everywhere there is an
/// X.
x
style item)
src/contract.rs
Outdated
@@ -122,9 +171,10 @@ fn create_pool( | |||
token1: String, | |||
chain0_init_depositor: String, | |||
chain1_init_depositor: String, | |||
fee: u16, | |||
) -> Result<Response<PalomaMsg>, ContractError> { | |||
assert!(chain0_id < chain1_id); |
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 don't assert this inequality, is it going to create problems somewhere? This design requires the two chains to be different, which is not necessary.
026da32
to
86340c5
Compare
Fix calculation errors, add more tests
add more tests
No description provided.