Skip to content
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

cw_tokenfactory_issuer should allowlist x/tokenfactory module on instantiation #754

Open
JakeHartnell opened this issue Oct 10, 2023 · 0 comments

Comments

@JakeHartnell
Copy link
Member

A small bit of cleanup from the Audit Report:

The x/tokenfactory module address should be whitelisted upon contract instantiation to ensure token mints work as intended. When minting funds to the recipient, the sender will be the x/tokenfactory module address (https://github.com/osmosis-labs/osmosis/blob/b90dfad7f2ab8ecdd2806cb51dfa9a72fb80a469/x/tokenfactory/keeper/bankactions.go#L26). If the address is not whitelisted, the mint transaction will fail in the beforesend_hook function (

check_is_not_frozen(deps.as_ref(), &from, &coin.denom)?;
).

In order to retrieve the x/tokenfactory module address in the contract, a QueryModuleAccountByNameRequest query (https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/auth/v1beta1/query.proto#L147) needs to be implemented to return the module address by its name. However, this requires Osmosis to whitelist the (https://github.com/osmosis-labs/osmosis/blob/v19.2.0/wasmbinding/stargate_whitelist.go#L45-L170)Stargate query first, which they have not (https://github.com/osmosis-labs/osmosis/blob/v19.2.0/wasmbinding/stargate_whitelist.go#L45-L170). There is a merged pull request that whitelists the query (osmosis-labs/osmosis#6586), so QueryModuleAccountByNameRequest will likely be available in the next release.

As the feature is not yet ready and not critical, we're acknowledging it for now. When upstream deps have support for the QueryModuleAccountByNameRequest query, we can make the UX a bit better for this particular edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant