Conversation
…:denom -> Change handle_bond to accept native of cw20 balance. That means accepting sender: HumanAddr, amount: cw20::Balance instead of info: MessageInfo. This conversion should be done in the handle switch just like in cw20-escrow. -> handle_bond should enforce incoming tokens using a switch on config.denom, inspired by cw20-escrow checks. You will want to keep the current logic for the Balance::Native case (or simplify it to use cw0::must_pay if you know how to extend the custom error type. -> Update handle_claim to release either native token (as now) or cw20-token (this can be unimplemented!() now, but have the branch based on the cw20::Balance variant)
ethanfrey
left a comment
There was a problem hiding this comment.
Nice start. The wiring up of the objects looks good, but I think you made it much too complex for checking the input denom.
Hope these suggestions of simpler data structs help.
|
Thank you for reviewing. I will come up with the optimized code in the next commit. |
|
I got a notification, but the last commit was 12 days ago. |
…ntroduced must_pay_funds function. Introduced a struct call Denom in packages/cw20/denom.rs
ethanfrey
left a comment
There was a problem hiding this comment.
Much nicer.
We will be doing a big overhaul to v0.14 cosmwasm soon.
Can you address the few PR comments I added and we can merge this in (half done), so it gets updated along with the rest of the contracts?
Removed unnecessary imports and tweaked coding conventions.
ethanfrey
left a comment
There was a problem hiding this comment.
Thanks for the update. The CosmWasm v0.14.0 upgrade happened faster than expected.
Can you rebase and resolve conflicts. Then I am happy to merge. You can look at the migration PR to see some changes needed (in particular, handle -> execute as entry point) and returning a plain Response object (same fields, just a rename)
…rnaut/Add-cw20-support
Re-based from master branch and resolved conflicts. Checked lint issues.
ethanfrey
left a comment
There was a problem hiding this comment.
Thanks for fixing this up.
I'm going to merge this in now. I will be doing some refactoring in another PR, then happy for you to complete the support.
This pull Request is regarding the issue #143
cw20::Denominstead of String inInitMsg::denomandConfig::denomhandle_bondto accept native of cw20 balance. That means acceptingsender: HumanAddr, amount: cw20::Balanceinstead ofinfo: MessageInfo.handle_bondis now accepting incoming tokens using a switch onconfig.denom. Kept the current logic for native case.handle_claimto release either native token (as now) or cw20-token (used unimplemented!() now, implemented using a match case.