You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a permissionless tokenfactory module based on the standard used by Osmosis, Juno, Injective, and other networks.
"This is important for cosmwasm applications on osmosis to thrive." - osmosis#1029
Rationale
Sending CW20 asssets that use the factory can be simple
"/cosmos.bank.v1beta1.MsgSend" tx msgs. This makes it much easier to transfer tokens at the CLI without invoking multiple wasm contracts.
The x/bank module is well-tested and exists on every Cosmos-SDK chain, whereas CW20 only exists on chains with CosmWasm.
All smart contracts can access the bank module messages and queries by default, and this will continue to be the case even if we have ERC-20 assets with EVM support next year.
Way more efficient query via x/bank with built-in total supply tracking. No need to do paginated CW20 queries and then filter the pages.
Factory tokens can automatically be displayed in popular tools like explorers (Mintscan), Leap, Keplr, etc.
Saves us from needing to migrate to the bank standard in the future like Juno.
Completion Tracking
Impl tokenfactory/types
Impl the tokenfactory state with collections
Impl tokenfactory/keeper business logic (and wire module to app)
test(cw-nibiru): Create an e2e test using the tokenfactory wasm bindings
Core Functionality
For smart contracts, the Public API for the transaction messages of this module could look something like this.
use cosmwasm_std::Int256;typeSdkInt = Int256;// alias for cosmos-sdk/types.Int/// `TokenfactoryExecuteMsg` describes the different messages that the token/// factory can accept.enumTokenfactoryExecutMsg{/// CreateDenom creates a token factory denomination of the form: /// "factory/{contract-address}/{subdenom}"./// Contracts can create denoms, namespaced under the contract's address./// A contract may create any number of independent sub-denoms.CreateDenom{/// `subdenom` can be of length at most 44 characters, in [0-9a-zA-Z./]/// The `(creating contract address, subdenom)` pair must be unique./// The created denom's admin is the creating contract address.subdenom:String,},/// Contracts can change the admin of a denom that they are the admin of.ChangeAdmin{denom:String,/// If the `new_admin_address` is empty, the denom has no admin.new_admin_address:String,},/// Contracts can mint native tokens for an existing factory denom/// that they are the admin of.MintTokens{denom:String,amount:SdkInt,mint_to_address:String,},/// Contracts can burn native tokens for an existing factory denom/// that they are the admin of./// Currently, the `burn_from_address` must be set to `""`.BurnTokens{denom:String,amount:SdkInt,burn_from_address:String,},}
Context
Implement a permissionless
tokenfactory
module based on the standard used by Osmosis, Juno, Injective, and other networks.Rationale
"/cosmos.bank.v1beta1.MsgSend" tx msgs. This makes it much easier to transfer tokens at the CLI without invoking multiple wasm contracts.
x/bank
module is well-tested and exists on every Cosmos-SDK chain, whereas CW20 only exists on chains with CosmWasm.bank
standard in the future like Juno.Completion Tracking
tokenfactory/types
tokenfactory
state with collectionstokenfactory/keeper
business logic (and wire module to app)tokenfactory
tokenfactory
tokenfactory
wasm bindingsCore Functionality
For smart contracts, the Public API for the transaction messages of this module could look something like this.
For queries, let's include bindings similar to those of
bindings.OsmosisQuery
.References
denom_creation_fee
from @larry0xThe text was updated successfully, but these errors were encountered: