-
Notifications
You must be signed in to change notification settings - Fork 341
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 query to determine if address contains a contract #896
Comments
I'd implement more or less this query into x/wasm: https://github.com/cosmos/cosmjs/blob/v0.25.0-alpha.2/packages/cosmwasm-stargate/src/cosmwasmclient.ts#L288-L305. Instead of throwing we turn the result into a |
I think this can already be implemented in contracts today by using a copy of this code, an arbitrary key and handling |
Hmmm... maybe we will want this |
Closed by #1089 |
Resolves a large part of #893
Sometime a contract wants to know if it is called by a pubkey (external user) or another contract. Or if we are given a cw20-contract address, we can quickly check if it is really a contract or someone faking this.
Let's add
is_contract(&self, addr: &str) -> bool
onQuerierWrapper
, such that it returns true iff addr is a valid address and there is a cosmwasm contract stored at that address. Add appropriate variant toQueryRequest
and wasmd as well.@webmaster128 what do you think of this? May be small enough to fit in 0.14? Just need to figure out where to place it. wasmd implementation should not be hard.
This is somewhat related to ideas in #143. Maybe we want to provide more info than just
bool
? We can also push to 0.14.1 or later if you think it is worthwhile to return more info and we should reflect on that someThe text was updated successfully, but these errors were encountered: