Messages
CreateDenom
Creates a denom of factory/{creator address}/{subdenom} given the denom creator address and the subdenom. Subdenoms can contain [a-zA-Z0-9./].
message MsgCreateDenom {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ];
}
State Modifications:
- Fund Neutron DAO Treasury with the denom creation fee from the creator address, specified in
Params; - Consume an amount of gas corresponding to the
DenomCreationGasConsumeparameter specified inParams; - Set
DenomMetaDatavia bank keeper; - Set
AuthorityMetadatafor the given denom to store the admin for the created denomfactory/{creator address}/{subdenom}. Admin is automatically set as the Msg sender; - Add denom to the
CreatorPrefixStore, where a state of denoms created per creator is kept.
Mint
Minting of a specific denom is only allowed for the creator of the denom registered during CreateDenom
message MsgMint {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
}
State Modifications:
- Safety check the following
- Check that the denom minting is created via
tokenfactorymodule - Check that the sender of the message is the admin of the denom
- Check that the denom minting is created via
- Mint designated amount of tokens for the denom via
bankmodule
Burn
Burning of a specific denom is only allowed for the creator of the denom registered during CreateDenom
message MsgBurn {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
}
State Modifications:
- Safety check the following
- Check that the denom has been created via
tokenfactorymodule - Check that the sender of the message is the admin of the denom
- Check that the denom has been created via
- Burn designated amount of tokens for the denom via
bankmodule
ForceTransfer
Force transferring of a specific denom is only allowed for the creator of the denom registered during CreateDenom.
message MsgForceTransfer {
option (amino.name) = "osmosis/tokenfactory/force-transfer";
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
string transferFromAddress = 3
[ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
string transferToAddress = 4
[ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ];
}
State Modifications:
- Safety check the following
- Check that the denom has been created via
tokenfactorymodule - Check that the sender of the message is the admin of the denom
- Check that the denom has been created via
- Send designated amount of tokens for the denom via
bankmodule fromtransferFromAddresstotransferToAddress
ChangeAdmin
Change the admin of a denom. Note, this is only allowed to be called by the current admin of the denom.
message MsgChangeAdmin {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
string newAdmin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
}
SetDenomMetadata
Setting of metadata for a specific denom is only allowed for the admin of the denom. It allows the overwriting of the denom metadata in the bank module.
// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
// the denom's bank metadata
message MsgSetDenomMetadata {
string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""];
cosmos.bank.v1beta1.Metadata metadata = 2 [
(gogoproto.moretags) = "yaml:\"metadata\"",
(gogoproto.nullable) = false
];
}
State Modifications:
- Check that sender of the message is the admin of denom;
- Modify
Metadatastate entry inbankmodule to change the metadata for the denom;
SetBeforeSendHook
Allowing to assign a CosmWasm contract to call with a BeforeSend hook for a specific denom is only allowed for the creator of the denom registered during CreateDenom.
message MsgSetBeforeSendHook {
option (amino.name) = "osmosis/tokenfactory/set-beforesend-hook";
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
string contract_addr = 3
[ (gogoproto.moretags) = "yaml:\"contract_addr\"" ];
}
State Modifications:
- Safety check the following
- Check that the denom has been created via
tokenfactorymodule - Check that the sender of the message is the admin of the denom
- Check that the denom has been created via
- Sets a bank hook for specified
denomandcontract_addr
UpdateParams
Updates params of the module.
message MsgChangeAdmin {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.bank.v1beta1.Metadata metadata = 2 [ (gogoproto.moretags) = "yaml:\"metadata\"", (gogoproto.nullable) = false ];
}
State Modifications:
- Check that sender of the message is the
Authorityof the module. Currently it's an address of Neutron's AdminModule - Modify
Paramsstate entry to update params of the module