osmosis
osmosis copied to clipboard
Define x/TokenFactory BeforeSend hook sentinel error
The BeforeSend hook implementation returns an error gained from the smart contract execution and depends on the info provided with the SC implementation.
Artifacts:
Analysis summary:
https://github.com/osmosis-labs/osmosis/blob/f09305e60b5b23fec761ea14446ee33556313e69/x/tokenfactory/keeper/beforesend.go#L105-L110
Suggestion: Token factory module should ensure that the error returned from the module holds a unique error code, that will explain what happened.
- Define a sentinel error that will hold information about the denomination triggering the hook
- and wrap the error returned from the smart contract as well, in order to get the information about the reason - if provided in the smart contract (blocked from/to account address; the contract is frozen,...).
Tagging audit collaboration team, to review issues as agreed. @ValarDragon @sunnya97
Agreed, we should wrap these error types, and make more meaningful wrapping info to indicate this is the source
Nice point!
hey @alexanderbez are you stabbing this rn? If not, I'd like to PR this change with the other audit items!
hey @alexanderbez are you stabbing this rn? If not, I'd like to PR this change with the other audit items!
@mattverse go for it homie!
I'll be happy to review