KIP Service

  • The contract is used to manage payment-related features in the ecosystem.

  • The current version of the contract supports several features:

    • As the App Owner | Model Owner | Data Owner:

      • Set a listing price for their items.

      • Set a payment pool to receive the accumulated revenue

      • Claim the revenue generated by their items.

    • As the User (payer)

      • Make a payment for using an app

  • Deployed KIPService contract:

  • Supported roles/actors/users (msg.sender):

    • DEFAULT_ADMIN_ROLE:

      bytes32 DEFAULT_ADMIN_ROLE = 0x0000000000000000000000000000000000000000000000000000000000000000;
    • OPERATOR_ROLE:

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

      • App Owner

      • Model Owner

      • Dataset Owner

      • Payer

Contract Interfaces

Getter functions:

function KIPManagement() external view returns (address);
  • Purpose: Query the current address of the KIPManagement contract.

  • Parameters: None

  • Return:

    • Type: address

    • Value: The address of the KIPManagement contract

function KIPIdentification() external view returns (address);
  • Purpose: Query the current address of the KIPIdentification contract.

  • Parameters: None

  • Return:

    • Type: address

    • Value: The address of the KIPIdentification contract

function KIPRegister() external view returns (address);
  • Purpose: Query the current address of the KIPRegistration contract.

  • Parameters: None

  • Return:

    • Type: address

    • Value: The address of the KIPRegistration contract

function feeRate() external view returns (uint256);
  • Purpose: Query the current setting rate of the commission fee.

  • Parameters: None

  • Return:

    • Type: uint256

    • Value: The commission fee's rate.

function accumulatedFee() external view returns (uint256);
  • Purpose: Query the total amount of the accumulated commission fee.

  • Parameters: None

  • Return:

    • Type: uint256

    • Value: The commission fee's total amount.

function listingPrices(uint256 tokenId) external view returns (uint256);
  • Purpose: Query the current listing price of the tokenId.

  • Parameter:

    • tokenId:

      • Type: uint256

      • Value: The unique ID assigned to the app, model or dataset

  • Return:

    • Type: uint256

    • Value: The listing price of the tokenId

function revenues(uint256 tokenId) external view returns (uint256);
  • Purpose: Query the accumulated revenues acquired per tokenId.

  • Parameter:

    • tokenId:

      • Type: uint256

      • Value: The unique ID assigned to the app, model or dataset

  • Return:

    • Type: uint256

    • Value: The tokenId's accumulated revenue

function pools(uint256 tokenId) external view returns (address);
  • Purpose: Query the designated address, set by the tokenId's owner, to receive the accumulated revenue.

  • Parameter:

    • tokenId:

      • Type: uint256

      • Value: The unique ID assigned to the app, model or dataset.

  • Return:

    • Type: address

    • Value: The receiver's address to whom the accumulated revenue is transferred.

Setter functions:

function setManagement(address management) external;
  • Purpose: Update the address of KIPManagement contract

  • Requirement:

    • Caller must have DEFAULT_ADMIN_ROLE

  • Parameter:

    • management:

      • Type: address

      • Value: The address of the KIPManagement contract.

function setFeeRate(uint256 newFee) external;
  • Purpose: Update the new rate of the commission fee.

  • Requirement:

    • Caller must have OPERATOR_ROLE

  • Parameter:

    • newFee:

      • Type: uint256

      • Value: The new rate of the commission fee.

function payment(uint256 appId) external;
  • Purpose: Make a payment for the appId.

  • Requirements:

    • The provided appId should be valid

    • msg.sender should meet following requirements:

      • Have sufficient balance

      • Have already approved a sufficient amount to KIPService contract.

  • Parameter:

    • appId:

      • Type: uint256

      • Value: The unique ID assigned to the app.

function setPrice(uint256 tokenId, uint256 idType, uint256 price) external;
  • Purpose: Set a listing price for tokenId.

  • Requirements:

    • Caller must be the owner of the tokenId

    • The provided idType should match the tokenId's classification

  • Parameters:

    • tokenID:

      • Type: uint256

      • Value: The unique ID assigned to the app, model, and dataset.

    • idType:

      • Type: uint256

      • Value: The classification of the tokenId.

    • price:

      • Type: uint256

      • Value: The expected listing price for the item.

function setPaymentPool(uint256 tokenId, address pool) external;
  • Purpose: Set a designated address to receive the accumulated revenue.

  • Requirements:

    • Caller must be the owner of the tokenId

    • The provided pool address should not be 0x0

  • Parameters:

    • tokenID:

      • Type: uint256

      • Value: The unique ID assigned to the app, model, and dataset.

    • pool:

      • Type: address

      • Value: The receiver's address.

function setPriceAndPool(
  uint256 tokenId,
  uint256 idType,
  uint256 price,
  address pool
) external;
  • Purpose: Set a listing price and receiver's address for the tokenId.

  • Requirements:

    • Caller must be the owner of the tokenId

    • The provided idType should match the tokenId's classification

    • The provided pool address should not be 0x0

  • Parameters:

    • tokenID:

      • Type: uint256

      • Value: The unique ID assigned to the app, model, and dataset.

    • idType:

      • Type: uint256

      • Value: The classification of the tokenId.

    • price:

      • Type: uint256

      • Value: The expected listing price for the item.

    • pool:

      • Type: address

      • Value: The receiver's address.

function claimFee() external;
  • Purpose: Call to transfer the accumulated fee to the Treasury wallet.

  • Requirement:

    • Caller can be ANY

  • Parameters: None

function claimRevenue(uint256 tokenId) external;
  • Purpose: Call to transfer the accumulated revenue to a designated receiver address set by the tokenId's owner.

  • Requirements:

    • Caller can be ANY

  • Parameter:

    • tokenID:

      • Type: uint256

      • Value: The unique ID assigned to the app, model, and dataset.

Last updated