-
Notifications
You must be signed in to change notification settings - Fork 607
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
[Feature]: Option 2: Add message as argument to TokenFactory send hooks #6389
Comments
@apollo-sturdy follow on question, would these message fields be useful in the Track/Block AfterSend fields as well? Or just the BeforeSend fields? |
@czarcas7ic AFAIK this is a alternative to the after send hooks |
Yes, I think for full flexibility would be good to have it in both. |
Closing, if this is still an issue ask here => https://github.com/strangelove-ventures/tokenfactory |
Summary
Add field
message: CosmosMsg
toSudoMsg::TrackBeforeSend
andSudoMsg::BlockBeforeSend
enum variants.Problem Definition
No response
Proposed Feature
There are currently two before send bank hooks for TokenFactory,
BlockBeforeSend
andTrackBeforeSend
. These both have the arguments/fieldsfrom: String
,to: String
, andamount: Coin
. It would be great if a fourth fieldmessage
could be added with typeCosmosMsg
. When a user sends coins in a CosmosMsg, this message would be included in theBlockBeforeSend
andTrackBeforeSend
hooks. This would allow contracts to conditionally perform actions depending on the kind of message.Example
User calls a contract with
and sends coins with the funds field. Before executing the contract and transfering the coins to it, the chain would call
BlockBeforeSend
andTrackBeforeSend
with the CosmosMsg as a field. The hook contract could then match on the message, see that it is a contract execution, check which contract is being executed and what action is being performed on the contract. If it is a specific action, it could for example block the send, deduct a tax from the user, or similar action.The text was updated successfully, but these errors were encountered: