KIP Management

  • This is a special contract dedicated to KIP Protocol's business team for managing the ecosystem. It is used as the KIP Ecosystem Governance contract, which manages:

    • The Treasury wallet that receives incoming fees.

    • The payment acceptance token used in the ecosystem.

    • A list of special actors granted specific privileges in the ecosystem:

      • DEFAULT_ADMIN_ROLE

      • OPERATOR_ROLE

      • MINTER_ROLE

  • Deployed KIPManagement contract:

  • Constant settings:

    • DEFAULT_ADMIN_ROLE:

      bytes32 DEFAULT_ADMIN_ROLE = 0x0000000000000000000000000000000000000000000000000000000000000000;
    • OPERATOR_ROLE:

      ///  OPERATOR_ROLE = keccak256("OPERATOR_ROLE")
      bytes32 OPERATOR_ROLE = 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929;
    • MINTER_ROLE:

      ///  MINTER_ROLE = keccak256("MINTER_ROLE")
      bytes32 MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6;

Contract Interfaces

Getter functions:

function treasury() external view returns (address);
  • Purpose: Query the current address of the Treasury wallet

  • Parameters: None

  • Return:

    • Type: address

    • Value: The address of the Treasury wallet

function token() external view returns (address);
  • Purpose: Query the current address of the payment acceptance token in the ecosystem

  • Parameters: None

  • Return:

    • Type: address

    • Value: The address of the payment acceptance token

function getRoleMemberCount(bytes32 role) external view returns (uint256);
  • Purpose: Query the total number of members assigned to the role

  • Parameter:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

  • Return:

    • Type: uint256

    • Value: The total number of members assigned to the role

function getRoleMember(
  bytes32 role,
  uint256 index
) external view returns (address);
  • Purpose: Query the address of the role member at the specified index in the list

  • Parameters:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

    • index:

      • Type: uint256

      • Value: The index value to query

  • Return:

    • Type: address

    • Value: The address of the role member

function hasRole(bytes32 role, address account) external view returns (bool);
  • Purpose: Check whether account has been assigned role

  • Parameters:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

    • account:

      • Type: address

      • Value: The address to verify its role

  • Return:

    • Type: bool

    • Value: true or false

Setter functions:

function setTreasury(address newTreasury) external;
  • Purpose: Set or Update the Treasury wallet

  • Requirements:

    • Caller must have DEFAULT_ADMIN_ROLE

    • The new Treasury wallet address should not be 0x0

  • Parameter:

    • newTreasury:

      • Type: address

      • Value: The address of the new Treasury wallet

function grantRole(bytes32 role, address account) external;
  • Purpose: Grant a special role to account

  • Requirement:

    • Caller must have DEFAULT_ADMIN_ROLE

  • Parameters:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

    • account:

      • Type: address

      • Value: The address that will be assigned the role

function revokeRole(bytes32 role, address account) external;
  • Purpose: Revoke the assigned role from account

  • Requirement:

    • Caller must have DEFAULT_ADMIN_ROLE

  • Parameters:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

    • account:

      • Type: address

      • Value: The address that will have its role revoked

function renounceRole(bytes32 role, address callerConfirmation) external;
  • Purpose: Renounce the assigned role from account

  • Requirement:

    • Caller (msg.sender) must be the same as callerConfirmation

  • Parameters:

    • role:

      • Type: bytes32

      • Value: The unique ID assigned to the role

      • Example: 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929

    • callerConfirmation:

      • Type: address

      • Value: The address of the account that will renounce its role

Last updated