IBC transfer 应用模块包含以下参数:
名称类型默认值
SendEnabledbooltrue
ReceiveEnabledbooltrue
IBC transfer 模块会将其参数存储在自己的 StoreKey 下。

SendEnabled

SendEnabled 参数控制所有同质化代币的跨链转账发送能力。 如果要阻止某一种代币从当前链转出,请将 SendEnabled 参数设为 true,然后根据 Cosmos SDK 版本执行以下操作之一:
  • 对于 Cosmos SDK v0.46.x 或更早版本,将该面额在 bank 模块中的 SendEnabled 参数 设为 false。
  • 对于高于 v0.46.x 的 Cosmos SDK 版本,使用 MsgSetSendEnabled 作为治理提案,将该面额在 bank 模块中的 SendEnabled 条目设为 false。
这样会阻止该代币在区块链中的任意账户之间进行转移。

ReceiveEnabled

ReceiveEnabled 参数控制所有同质化代币的跨链转账接收能力。 如果要阻止某一种代币转入当前链,请将 ReceiveEnabled 参数设为 true,然后根据 Cosmos SDK 版本执行以下操作之一:
  • 对于 Cosmos SDK v0.46.x 或更早版本,将该面额在 bank 模块中的 SendEnabled 参数 设为 false。
  • 对于高于 v0.46.x 的 Cosmos SDK 版本,使用 MsgSetSendEnabled 作为治理提案,将该面额在 bank 模块中的 SendEnabled 条目设为 false。
这样会阻止该代币在区块链中的任意账户之间进行转移。

查询

当前参数值可以通过查询消息获取。
/ proto/ibc/applications/transfer/v1/query.proto

/ QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}

/ QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
  / params defines the parameters of the module.
  Params params = 1;
}
要在 simd 中执行查询,可以使用以下命令:
simd query ibc-transfer params

修改参数

要修改参数值,必须提交一个执行 MsgUpdateParams 消息的治理提案。
/ proto/ibc/applications/transfer/v1/tx.proto

/ MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
  / signer address (it may be the address that controls the module, which defaults to x/gov unless overwritten).
  string signer = 1;

  / params defines the transfer parameters to update.
  /
  / NOTE: All parameters must be supplied.
  Params params = 2 [(gogoproto.nullable) = false];
}

/ MsgUpdateParamsResponse defines the response structure for executing a
/ MsgUpdateParams message.
message MsgUpdateParamsResponse {}

The IBC transfer application module contains the following parameters:
NameTypeDefault Value
SendEnabledbooltrue
ReceiveEnabledbooltrue
The IBC transfer module stores its parameters under its StoreKey

SendEnabled

The SendEnabled parameter controls send cross-chain transfer capabilities for all fungible tokens. To prevent a single token from being transferred from the chain, set the SendEnabled parameter to true and then, depending on the Cosmos SDK version, do one of the following:
  • For Cosmos SDK v0.46.x or earlier, set the bank module’s SendEnabled parameter for the denomination to false.
  • For Cosmos SDK versions above v0.46.x, set the bank module’s SendEnabled entry for the denomination to false using MsgSetSendEnabled as a governance proposal.
Doing so will prevent the token from being transferred between any accounts in the blockchain.

ReceiveEnabled

The transfers enabled parameter controls receive cross-chain transfer capabilities for all fungible tokens. To prevent a single token from being transferred to the chain, set the ReceiveEnabled parameter to true and then, depending on the Cosmos SDK version, do one of the following:
  • For Cosmos SDK v0.46.x or earlier, set the bank module’s SendEnabled parameter for the denomination to false.
  • For Cosmos SDK versions above v0.46.x, set the bank module’s SendEnabled entry for the denomination to false using MsgSetSendEnabled as a governance proposal.
Doing so will prevent the token from being transferred between any accounts in the blockchain.

Queries

Current parameter values can be queried via a query message.
/ proto/ibc/applications/transfer/v1/query.proto

/ QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}

/ QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
  / params defines the parameters of the module.
  Params params = 1;
}
To execute the query in simd, you use the following command:
simd query ibc-transfer params

Changing Parameters

To change the parameter values, you must make a governance proposal that executes the MsgUpdateParams message.
/ proto/ibc/applications/transfer/v1/tx.proto

/ MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
  / signer address (it may be the address that controls the module, which defaults to x/gov unless overwritten).
  string signer = 1;

  / params defines the transfer parameters to update.
  /
  / NOTE: All parameters must be supplied.
  Params params = 2 [(gogoproto.nullable) = false];
}

/ MsgUpdateParamsResponse defines the response structure for executing a
/ MsgUpdateParams message.
message MsgUpdateParamsResponse {}