KIP Protocol Developer Guide
  • Introduction
    • High-level Architecture
  • Features
    • Assets Tokenization
    • Monetization
    • Friendly User Experience
    • Integration Flexibility
    • Security and Sovereignty
    • Fraud and Scam Protection
  • How to Build DeAI Products Using KIP
    • App Makers
    • Model Trainers
    • Dataset Owners
    • Users
  • Developer Guide
    • Standard APIs
      • User - App
      • App - Generation Model
      • App - Embedding Model
      • App - Dataset
    • KIP Ecosystem Core Contracts
      • KIP Management
      • KIP Identification
      • KIP Registration
      • KIP Service
    • Account Abstraction
      • Particle Network
    • Fetch Blockchain Data
      • Using RPC Node
        • RPC Node Providers
          • Alchemy
          • Infura
        • Fetch Data Example
      • Using Subgraph
        • Deploy Subgraph
        • Query using Subgraph
    • KIP Checker Node Execution Guide
      • Checker Node Guide
Powered by GitBook
On this page
  • Contract Interfaces
  • Getter functions:
  • Setter functions:
  1. Developer Guide
  2. KIP Ecosystem Core Contracts

KIP Management

PreviousKIP Ecosystem Core ContractsNextKIP Identification

Last updated 10 months ago

  • 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:

    • Network Sepolia Base:

  • 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

0xfb801502E5f12c6050C355C5595B0e7Cf8EE321B