-
Notifications
You must be signed in to change notification settings - Fork 181
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
check_can_send(): expose for query and helper #148
Comments
query should be expose in helpers.rs here: https://github.com/CosmWasm/cw-nfts/blob/main/contracts/cw721-base/src/helpers.rs |
Actually for 3rd party contracts it is quite tedious, since it needs to check and query, sender being:
|
I found this issue when trying to send nfts between chains. Right after owner of nft allows some operators (contracts) to transfer/send his token, other person can send a message with their information to contract and steal the token. |
partially solved in v19, by exposing functions |
check_can_send()
can rn only be used internally. But externals, 3rd party contract, might benefit from this as well. Use case:Even contract is approved to do so, it needs to check whether sender is owner and eligible to do so on contract.
This is boilerplate and covered by
check_can_send()
:https://github.com/CosmWasm/cw-nfts/blob/588868d74bda898fe4b93ddbb3a74b74e94ca948/contracts/cw721-base/src/execute.rs#L376-L395
we just need to change input param from
info: &MessageInfo
tosender: String
and return a bool, then we can expose this function.The text was updated successfully, but these errors were encountered: