-
Notifications
You must be signed in to change notification settings - Fork 32
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
Shade protocol #153
base: main
Are you sure you want to change the base?
Shade protocol #153
Conversation
checked_entry_point_contract.address.to_string(), | ||
) | ||
.add_attribute( | ||
"ics20_contract_address", |
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.
This ICS 20 contract address is a contract on secret that interact with the underlying IBC module, is that correct?
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.
yep, it handles wrapping and unwrapping for tokens going in and out of the network
https://github.com/scrtlabs/snip20-ics20
// Verify memo is valid json and add the necessary key/value pair to trigger the ibc hooks callback logic. | ||
let memo = verify_and_create_memo(ibc_info.memo, env.contract.address.to_string())?; | ||
|
||
println!("memo {}", memo); |
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.
remove debug log
// Get and delete the in progress recover address from storage | ||
let in_progress_recover_address = IN_PROGRESS_RECOVER_ADDRESS.load(deps.storage)?; | ||
IN_PROGRESS_RECOVER_ADDRESS.remove(deps.storage); | ||
println!("IN PROG {}", in_progress_recover_address); |
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.
remove debug log
|
||
// Set ack_id to be the channel id and sequence id from the response as a tuple | ||
let ack_id: AckID = (&in_progress_channel_id, resp.sequence); | ||
println!("ACKID {:?}", ack_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.
remove debug log
Ok(memo) | ||
} | ||
|
||
fn register_tokens( |
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.
q for my understanding: Can you link me to documentation or give me a tldr on what registering a token does?
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.
For snip20 tokens, you need a viewing key to see your balance, and you need to "register receive" so that the snip20 knows the code hash of the contract and can call the receive TX when tokens are sent to it.
Per our discussion we maybe don't need viewing keys, but unless theres a good reason to remove it being able to see the balances of the contract will be helpful in debugging/troubleshooting.
msg: ExecuteMsg, | ||
) -> ContractResult<Response> { | ||
match msg { | ||
ExecuteMsg::Receive(snip20_msg) => receive_snip20(deps, env, info, snip20_msg), |
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.
This is because Shade Protocol only supports snip20 tokens, 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.
Correct, the only tokens coming in will be from the receive TX called by the sent snip20
return_denom, | ||
)?), | ||
// Tokens must be registered before they can be swapped | ||
ExecuteMsg::RegisterTokens { contracts } => register_tokens(deps, env, contracts), |
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.
It's intended for this method to be callable by anyone, yeah? In practice will Shade register all the tokens once the contracts are deployed?
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.
We certainly can, it will be good for you guys to be able to do it as well but I'd be happy to seed the data with all the tokens we know about
Co-authored-by: Not Jeremy Liu <[email protected]>
Co-authored-by: Not Jeremy Liu <[email protected]>
Shade Swap adapter building, needs testing
Secret entry point roughed out, not building needs lots more work
Hoping to get early eyes on this as the implementation is pretty messy to work around incompatibility issues with the
packages/skip
using vanilla cosmwasm and the secret code needing secret-cosmwasm-std.