Injective | Documentation
InjectiveGithub
Injective | 中文文档
Injective | 中文文档
  • 关于 Injective
  • 快速入门
    • 钱包
      • 创建钱包
      • 账户
      • 质押
      • 治理
      • 拍卖
    • 代币标准
      • INJ 代币
      • Token Factory
      • CW20 标准
    • 交易
      • Gas 和 Fees
  • 指南
    • 创建钱包
    • 桥接
      • From Ethereum
      • Using Wormhole
      • Using IBC
      • From Solana
    • 发布代币
    • 发布市场
    • Denom 元数据
    • 获取INJ
  • 工具包
    • injectived
      • 安装 injectived
      • 使用 injectived
      • 指令
    • Injective TS SDK
    • Injective Go SDK
    • Injective Python SDK
    • Injective CW SDK
    • The Graph
  • 参考
  • 术语表
  • 开发者
    • 快速入门
      • 指南
        • 测试网提案
        • 转换地址
        • 计算
          • 最低价格刻度
          • 最低数量刻度
    • 交易所开发者
      • 构建 DEX
      • 预言机提供方
    • Cosmwasm 开发者
      • 您的首个智能合约
      • 指南
        • 本地开发
        • 主网开发
        • 给部署地址白名单
        • 创建您的 Swap 合约
        • 创建 UIs
      • CW20 适配器
      • Injective Test Tube
    • 模块
      • Injective
        • 拍卖(Auction)
          • State
          • 消息
          • EndBlock
          • 事件
          • 参数
        • 交易所(Exchange)
          • 衍生品市场概念
          • 现货市场概念
          • 二元期权市场概念
          • 其他概念
          • 状态
          • 状态转换
          • 消息
          • 提案
          • BeginBlock
          • EndBlock
          • 事件
          • 参数
          • MsgPrivilegedExecuteContract
        • 保险(Insurance)
          • 状态
          • 状态转换
          • 消息
          • EndBlock
          • 事件
          • 参数
          • 改进
        • OCR
          • 概念
          • 状态
          • 消息
          • 提案
          • BeginBlock
          • 钩子(Hooks)
          • 事件
          • 参数
        • 预言机(Oracle)
          • 状态
          • Keeper
          • 消息
          • 提案
          • 事件
          • 改进
        • Peggy
          • 定义
          • 工作流
          • 状态
          • 消息
          • 处罚
          • EndBlock
          • 事件
          • 参数
          • 中继语义
          • 改进
        • 权限(Permissions)
          • 概念
          • 状态
          • 状态转换
        • 代币工厂(TokenFactory)
          • 概念
          • 状态
          • 消息
          • 事件
          • 参数
        • WasmX
          • 概念
          • 数据
          • 提案
          • 消息
          • 参数
      • 核心
        • Auth
        • AuthZ
        • 银行(Bank)
        • 共识(Consensus)
        • 危机(Crisis)
        • 分发(Distribution)
        • 证据(Evidence)
        • 费用授权(Feegrant)
        • 治理(Gov)
        • 群组(Group)
        • 铸造(Mint)
        • NFT
        • 参数(Params)
        • 惩罚(Slashing)
        • 质押(Staking)
        • 升级(Upgrade)
        • Circuit
        • Genutils
    • dApps 开发文档
  • 节点
    • 快速入门
      • 和节点交互
      • 运行节点
        • 设置密钥环
        • 加入网络
        • Cosmovisor
        • 升级您的节点
    • 验证者
      • 主网
        • Peggo
        • 规范链升级
          • Upgrade to 10002-rc1
          • Upgrade to 10002-rc2
          • Upgrade to 10003-rc1
          • Upgrade to 10004-rc1
          • Upgrade to 10004-rc1-patch
          • Upgrade to 10005-rc1
          • Upgrade to 10006-rc1
          • Upgrade to 10007-rc1
          • Upgrade to 10008 - Camelot
          • Upgrade to 10009
          • Upgrade to v1.10
          • Upgrade to v1.11
          • Upgrade to v1.12.0 - Volan
          • Upgrade to v1.12.1
          • Upgrade to v1.13.0 - Altaris
          • Upgrade to v1.13.2
          • Upgrade to v1.13.3
          • Upgrade to v1.14.0
          • Upgrade to v1.14.1
      • 测试网
        • 测试网 Peggo
    • 公共端点
    • 高级端点
    • Injective 索引器设置
  • 交易员
    • 快速入门
    • 文档
    • API 参考
  • 常用链接
    • Injective 101
    • Injective Hub
    • Injective 浏览器
    • Chain API Reference
    • Indexer API Reference
    • 测试网水龙头
Powered by GitBook
On this page
  • Create Namespace
  • Delete Namespace
  • Update Namespace
  • Update Namespace Roles
  • Revoke Namespace Roles
  • Claim Voucher
  • Update Params
Export as PDF
  1. 开发者
  2. 模块
  3. Injective
  4. 权限(Permissions)

状态转换

本文档描述了以下与状态转换相关的操作:

  • 创建命名空间(Create namespace)

  • 删除命名空间(Delete namespace)

  • 更新命名空间(Update namespace)

  • 更新命名空间角色(Update namespace roles)

  • 撤销命名空间角色(Revoke namespace roles)

  • 领取 Voucher(Claim Voucher)

  • 更新参数(Update params)

Create Namespace

命名空间可用于实现不同的角色和操作。

message MsgCreateNamespace {
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  Namespace namespace = 2 [ (gogoproto.nullable) = false ];
}

// Namespace defines a permissions namespace
message Namespace {
  string denom = 1; // tokenfactory denom to which this namespace applies to
  string wasm_hook =
      2; // address of smart contract to apply code-based restrictions

  bool mints_paused = 3;
  bool sends_paused = 4;
  bool burns_paused = 5;

  repeated Role role_permissions = 6; // permissions for each role

  repeated AddressRoles address_roles = 7;
}

message AddressRoles {
  string address = 1;
  repeated string roles = 2;
}

message Role {
  string role = 1;
  uint32 permissions = 2;
}

步骤

  1. 创建新的 Denom。

  2. 创建 MsgCreateNamespace 消息,其中包含 Denom、RolePermissions 和 AddressRoles。

  3. 验证 MsgCreateNamespace 对象。

  4. 发送创建命名空间消息。

Delete Namespace

删除命名空间将移除该命名空间及其关联的角色和权限。

message MsgDeleteNamespace {
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  string namespace_denom = 2;
}

步骤

  1. 创建 MsgDeleteNamespace 消息,指定要删除的命名空间 NamespaceDenom。

  2. 验证 MsgDeleteNamespace 对象。

  3. 发送删除命名空间消息。

Update Namespace

更新命名空间允许修改其关联的角色和权限。

message MsgUpdateNamespace {
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  string namespace_denom =
      2; // namespace denom to which this updates are applied

  message MsgSetWasmHook { string new_value = 1; }
  MsgSetWasmHook wasm_hook =
      3; // address of smart contract to apply code-based restrictions

  message MsgSetMintsPaused { bool new_value = 1; }
  MsgSetMintsPaused mints_paused = 4;

  message MsgSetSendsPaused { bool new_value = 1; }
  MsgSetSendsPaused sends_paused = 5;

  message MsgSetBurnsPaused { bool new_value = 1; }
  MsgSetBurnsPaused burns_paused = 6;
}

步骤

  1. 创建 MsgUpdateNamespace 消息,包含 NamespaceDenom 以及新的 MintsPaused、BurnsPaused 和 SendsPaused 值。

  2. 验证 MsgUpdateNamespace 对象。

  3. 发送更新命名空间消息。

Update Namespace Roles

更新命名空间角色允许修改命名空间内的角色及其权限。

message MsgUpdateNamespaceRoles {
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  string namespace_denom =
      2; // namespace denom to which this updates are applied

  repeated Role role_permissions =
      3; // new role definitions or updated permissions for existing roles
  repeated AddressRoles address_roles =
      4; // new addresses to add or new roles for existing addresses to
  // overwrite current roles
}

步骤

  1. 创建 MsgUpdateNamespaceRoles 消息,包含 NamespaceDenom、新的 RolePermissions 和 AddressRoles。

  2. 验证 MsgUpdateNamespaceRoles 对象。

  3. 发送更新命名空间角色消息。

Revoke Namespace Roles

撤销命名空间角色将移除命名空间内地址的某些角色。

message MsgRevokeNamespaceRoles {
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  string namespace_denom =
      2; // namespace denom to which this updates are applied
  repeated AddressRoles address_roles_to_revoke =
      3; // {"address" => array of roles to revoke from this address}
}

步骤

  1. 创建 MsgRevokeNamespaceRoles 消息,包含 NamespaceDenom 和 AddressRolesToRevoke。

  2. 验证 MsgRevokeNamespaceRoles 对象。

  3. 发送撤销命名空间角色消息。

Claim Voucher

message MsgClaimVoucher {
  option (amino.name) = "permissions/MsgClaimVoucher";
  option (cosmos.msg.v1.signer) = "sender";
  string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

  string denom = 2;
}

Update Params

message MsgUpdateParams {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the governance account.
  string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

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

message Params {
  option (gogoproto.equal) = true;

  uint64 wasm_hook_query_max_gas = 1;
}
Previous状态Next代币工厂(TokenFactory)

Last updated 2 months ago