syntax = "proto3";
package osmosis.tokenfactory.v1beta1;

import "gogoproto/gogo.proto";
import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/bank/v1beta1/bank.proto";

option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";

// Msg defines the tokefactory module's gRPC message service.
service Msg {
  rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse);
  rpc Mint(MsgMint) returns (MsgMintResponse);
  rpc Burn(MsgBurn) returns (MsgBurnResponse);
  rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse);
  rpc SetDenomMetadata(MsgSetDenomMetadata)
      returns (MsgSetDenomMetadataResponse);

  // ForceTransfer is deactivated for now because we need to think through edge
  // cases rpc ForceTransfer(MsgForceTransfer) returns
  // (MsgForceTransferResponse);
}

// MsgCreateDenom defines the message structure for the CreateDenom gRPC service
// method. It allows an account to create a new denom. It requires a sender
// address and a sub denomination. The (sender_address, sub_denomination) tuple
// must be unique and cannot be re-used.
//
// The resulting denom created is defined as
// <factory/{creatorAddress}/{subdenom}>. The resulting denom's admin is
// originally set to be the creator, but this can be changed later. The token
// denom does not indicate the current admin.
message MsgCreateDenom {
  option (amino.name) = "osmosis/tokenfactory/create-denom";

  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
  // subdenom can be up to 44 "alphanumeric" characters long.
  string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ];
}

// MsgCreateDenomResponse is the return value of MsgCreateDenom
// It returns the full string of the newly created denom
message MsgCreateDenomResponse {
  string new_token_denom = 1
      [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ];
}

// MsgMint is the sdk.Msg type for allowing an admin account to mint
// more of a token.  For now, we only support minting to the sender account
message MsgMint {
  option (amino.name) = "osmosis/tokenfactory/mint";

  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
  cosmos.base.v1beta1.Coin amount = 2 [
    (gogoproto.moretags) = "yaml:\"amount\"",
    (gogoproto.nullable) = false
  ];
}

message MsgMintResponse {}

// MsgBurn is the sdk.Msg type for allowing an admin account to burn
// a token.  For now, we only support burning from the sender account.
message MsgBurn {
  option (amino.name) = "osmosis/tokenfactory/burn";

  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
  cosmos.base.v1beta1.Coin amount = 2 [
    (gogoproto.moretags) = "yaml:\"amount\"",
    (gogoproto.nullable) = false
  ];
}

message MsgBurnResponse {}

// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
// adminship of a denom to a new account
message MsgChangeAdmin {
  option (amino.name) = "osmosis/tokenfactory/change-admin";

  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
  string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
  string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
}

// MsgChangeAdminResponse defines the response structure for an executed
// MsgChangeAdmin message.
message MsgChangeAdminResponse {}

// message MsgForceTransfer {
//   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\"" ];
// }

// message MsgForceTransferResponse {}

// 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
  ];
}

// MsgSetDenomMetadataResponse defines the response structure for an executed
// MsgSetDenomMetadata message.
message MsgSetDenomMetadataResponse {}