Module WorkerManager

Module WorkerManager 

Source
Expand description

Generated by the following Solidity interface…

library Common {
    struct CIDV1 {
        bytes4 prefixes;
        bytes32 hash;
    }
}

library IConfig {
    type AccessType is uint8;
}

library IWorkerManager {
    struct Worker {
        bytes32 offchainId;
        bytes32 onchainId;
        bytes32 peerId;
        address provider;
        uint256 joinedEpoch;
        bytes32[] computeUnitIds;
    }
}

interface WorkerManager {
    error InvalidInitialization();
    error NotInitializing();
    error OwnableInvalidOwner(address owner);
    error OwnableUnauthorizedAccount(address account);

    event AppCIDChanged(Common.CIDV1 newAppCID);
    event Initialized(uint64 version);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event ProviderAddedToAccessList(address provider);
    event ProviderRemovedFromAccessList(address provider);
    event ProvidersAccessTypeChanged(IConfig.AccessType newAccessType);
    event WorkerIdUpdated(bytes32 onchainWorkerId, bytes32 offchainWorkerId);
    event WorkerJoined(bytes32 indexed peerId, bytes32 onchainId);
    event WorkerRemoved(bytes32 indexed peerId, bytes32 onchainId);

    function addProviderToAccessList(address provider) external;
    function appCID() external view returns (Common.CIDV1 memory);
    function changeProvidersAccessType(IConfig.AccessType accessType) external;
    function computePeerUsed(bytes32 peerId) external view returns (bool);
    function creationBlock() external view returns (uint256);
    function cuCountPerWorker() external view returns (uint256);
    function effectors() external view returns (Common.CIDV1[] memory);
    function getActivatedWorkerCount() external view returns (uint256);
    function getWorker(bytes32 onchainWorkerId) external view returns (IWorkerManager.Worker memory);
    function getWorkerCount() external view returns (uint256);
    function getWorkerCount(address provider) external view returns (uint256);
    function getWorkers() external view returns (IWorkerManager.Worker[] memory);
    function isProviderAllowed(address account) external view returns (bool);
    function maxWorkersPerProvider() external view returns (uint256);
    function minWorkers() external view returns (uint256);
    function owner() external view returns (address);
    function paymentToken() external view returns (address);
    function pricePerCuPerEpoch() external view returns (uint256);
    function providersAccessType() external view returns (IConfig.AccessType);
    function removeProviderFromAccessList(address provider) external;
    function renounceOwnership() external;
    function setAppCID(Common.CIDV1 memory appCID_) external;
    function targetWorkers() external view returns (uint256);
    function transferOwnership(address newOwner) external;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "function",
    "name": "addProviderToAccessList",
    "inputs": [
      {
        "name": "provider",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "appCID",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Common.CIDV1",
        "components": [
          {
            "name": "prefixes",
            "type": "bytes4",
            "internalType": "bytes4"
          },
          {
            "name": "hash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "changeProvidersAccessType",
    "inputs": [
      {
        "name": "accessType",
        "type": "uint8",
        "internalType": "enum IConfig.AccessType"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "computePeerUsed",
    "inputs": [
      {
        "name": "peerId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "creationBlock",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "cuCountPerWorker",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "effectors",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "tuple[]",
        "internalType": "struct Common.CIDV1[]",
        "components": [
          {
            "name": "prefixes",
            "type": "bytes4",
            "internalType": "bytes4"
          },
          {
            "name": "hash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getActivatedWorkerCount",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getWorker",
    "inputs": [
      {
        "name": "onchainWorkerId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct IWorkerManager.Worker",
        "components": [
          {
            "name": "offchainId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "onchainId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "peerId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "provider",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "joinedEpoch",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "computeUnitIds",
            "type": "bytes32[]",
            "internalType": "bytes32[]"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getWorkerCount",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getWorkerCount",
    "inputs": [
      {
        "name": "provider",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getWorkers",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "tuple[]",
        "internalType": "struct IWorkerManager.Worker[]",
        "components": [
          {
            "name": "offchainId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "onchainId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "peerId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "provider",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "joinedEpoch",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "computeUnitIds",
            "type": "bytes32[]",
            "internalType": "bytes32[]"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isProviderAllowed",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "maxWorkersPerProvider",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "minWorkers",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "owner",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "paymentToken",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "pricePerCuPerEpoch",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "providersAccessType",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "enum IConfig.AccessType"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "removeProviderFromAccessList",
    "inputs": [
      {
        "name": "provider",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "renounceOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setAppCID",
    "inputs": [
      {
        "name": "appCID_",
        "type": "tuple",
        "internalType": "struct Common.CIDV1",
        "components": [
          {
            "name": "prefixes",
            "type": "bytes4",
            "internalType": "bytes4"
          },
          {
            "name": "hash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "targetWorkers",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "AppCIDChanged",
    "inputs": [
      {
        "name": "newAppCID",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Common.CIDV1",
        "components": [
          {
            "name": "prefixes",
            "type": "bytes4",
            "internalType": "bytes4"
          },
          {
            "name": "hash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "version",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProviderAddedToAccessList",
    "inputs": [
      {
        "name": "provider",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProviderRemovedFromAccessList",
    "inputs": [
      {
        "name": "provider",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProvidersAccessTypeChanged",
    "inputs": [
      {
        "name": "newAccessType",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum IConfig.AccessType"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "WorkerIdUpdated",
    "inputs": [
      {
        "name": "onchainWorkerId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      },
      {
        "name": "offchainWorkerId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "WorkerJoined",
    "inputs": [
      {
        "name": "peerId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "onchainId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "WorkerRemoved",
    "inputs": [
      {
        "name": "peerId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "onchainId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "InvalidInitialization",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotInitializing",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OwnableInvalidOwner",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "OwnableUnauthorizedAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  }
]

Structs§

AppCIDChanged
Event with signature AppCIDChanged((bytes4,bytes32)) and selector 0xc820a66d3bdd50a45cf12cda6dc8ec9e94fb5123edd7da736eea18316f8523a0.
Initialized
Event with signature Initialized(uint64) and selector 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
InvalidInitialization
Custom error with signature InvalidInitialization() and selector 0xf92ee8a9.
NotInitializing
Custom error with signature NotInitializing() and selector 0xd7e6bcf8.
OwnableInvalidOwner
Custom error with signature OwnableInvalidOwner(address) and selector 0x1e4fbdf7.
OwnableUnauthorizedAccount
Custom error with signature OwnableUnauthorizedAccount(address) and selector 0x118cdaa7.
OwnershipTransferred
Event with signature OwnershipTransferred(address,address) and selector 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
ProviderAddedToAccessList
Event with signature ProviderAddedToAccessList(address) and selector 0x4c26e4de691e265be6cf03e639754839907bf74687cd524a6734851331527ffd.
ProviderRemovedFromAccessList
Event with signature ProviderRemovedFromAccessList(address) and selector 0x38fb081a0b484406977bd94ff8edb79be44b5ca514130361182516b39e2c4528.
ProvidersAccessTypeChanged
Event with signature ProvidersAccessTypeChanged(uint8) and selector 0x1f5a251428f76335a835fcae94ab6a9bcf09ac33bd3c782eb6a81bdf878a7393.
WorkerIdUpdated
Event with signature WorkerIdUpdated(bytes32,bytes32) and selector 0xcf79e0e27c8c35d39bd9b727f35e6f79573597f660c88baf483fc1511c49203c.
WorkerJoined
Event with signature WorkerJoined(bytes32,bytes32) and selector 0x9cd57cfa2e12a37215cabc6897396db265419bd7f06adad06227a2b163ecd6a3.
WorkerManagerInstance
A WorkerManager instance.
WorkerRemoved
Event with signature WorkerRemoved(bytes32,bytes32) and selector 0x2931f8975c0ce3cdf8ebe0cac36f06048736d46d6df66ac21cfe717b9ee71006.
addProviderToAccessListCall
Function with signature addProviderToAccessList(address) and selector 0x73134c15.
addProviderToAccessListReturn
Container type for the return parameters of the addProviderToAccessList(address) function.
appCIDCall
Function with signature appCID() and selector 0x9bc66868.
appCIDReturn
Container type for the return parameters of the appCID() function.
changeProvidersAccessTypeCall
Function with signature changeProvidersAccessType(uint8) and selector 0x636fcefb.
changeProvidersAccessTypeReturn
Container type for the return parameters of the changeProvidersAccessType(uint8) function.
computePeerUsedCall
Function with signature computePeerUsed(bytes32) and selector 0xbd1926e0.
computePeerUsedReturn
Container type for the return parameters of the computePeerUsed(bytes32) function.
creationBlockCall
Function with signature creationBlock() and selector 0x17634514.
creationBlockReturn
Container type for the return parameters of the creationBlock() function.
cuCountPerWorkerCall
Function with signature cuCountPerWorker() and selector 0x15a0f31a.
cuCountPerWorkerReturn
Container type for the return parameters of the cuCountPerWorker() function.
effectorsCall
Function with signature effectors() and selector 0xfc1e5e2a.
effectorsReturn
Container type for the return parameters of the effectors() function.
getActivatedWorkerCountCall
Function with signature getActivatedWorkerCount() and selector 0xade0a202.
getActivatedWorkerCountReturn
Container type for the return parameters of the getActivatedWorkerCount() function.
getWorkerCall
Function with signature getWorker(bytes32) and selector 0xaba93a10.
getWorkerCount_0Call
Function with signature getWorkerCount() and selector 0x4d7599f1.
getWorkerCount_0Return
Container type for the return parameters of the getWorkerCount() function.
getWorkerCount_1Call
Function with signature getWorkerCount(address) and selector 0x59c4afc0.
getWorkerCount_1Return
Container type for the return parameters of the getWorkerCount(address) function.
getWorkerReturn
Container type for the return parameters of the getWorker(bytes32) function.
getWorkersCall
Function with signature getWorkers() and selector 0xc1499f71.
getWorkersReturn
Container type for the return parameters of the getWorkers() function.
isProviderAllowedCall
Function with signature isProviderAllowed(address) and selector 0x3e8ae1ae.
isProviderAllowedReturn
Container type for the return parameters of the isProviderAllowed(address) function.
maxWorkersPerProviderCall
Function with signature maxWorkersPerProvider() and selector 0x8a0c725b.
maxWorkersPerProviderReturn
Container type for the return parameters of the maxWorkersPerProvider() function.
minWorkersCall
Function with signature minWorkers() and selector 0x2db31193.
minWorkersReturn
Container type for the return parameters of the minWorkers() function.
ownerCall
Function with signature owner() and selector 0x8da5cb5b.
ownerReturn
Container type for the return parameters of the owner() function.
paymentTokenCall
Function with signature paymentToken() and selector 0x3013ce29.
paymentTokenReturn
Container type for the return parameters of the paymentToken() function.
pricePerCuPerEpochCall
Function with signature pricePerCuPerEpoch() and selector 0x70220a9b.
pricePerCuPerEpochReturn
Container type for the return parameters of the pricePerCuPerEpoch() function.
providersAccessTypeCall
Function with signature providersAccessType() and selector 0xd4773ff0.
providersAccessTypeReturn
Container type for the return parameters of the providersAccessType() function.
removeProviderFromAccessListCall
Function with signature removeProviderFromAccessList(address) and selector 0x444e6a5a.
removeProviderFromAccessListReturn
Container type for the return parameters of the removeProviderFromAccessList(address) function.
renounceOwnershipCall
Function with signature renounceOwnership() and selector 0x715018a6.
renounceOwnershipReturn
Container type for the return parameters of the renounceOwnership() function.
setAppCIDCall
Function with signature setAppCID((bytes4,bytes32)) and selector 0x176474cf.
setAppCIDReturn
Container type for the return parameters of the setAppCID((bytes4,bytes32)) function.
targetWorkersCall
Function with signature targetWorkers() and selector 0x2943dcab.
targetWorkersReturn
Container type for the return parameters of the targetWorkers() function.
transferOwnershipCall
Function with signature transferOwnership(address) and selector 0xf2fde38b.
transferOwnershipReturn
Container type for the return parameters of the transferOwnership(address) function.

Enums§

WorkerManagerCalls
Container for all the WorkerManager function calls.
WorkerManagerErrors
Container for all the WorkerManager custom errors.
WorkerManagerEvents
Container for all the WorkerManager events.

Statics§

BYTECODE
The creation / init bytecode of the contract.
DEPLOYED_BYTECODE
The runtime bytecode of the contract, as deployed on the network.

Functions§

deploy
Deploys this contract using the given provider and constructor arguments, if any.
deploy_builder
Creates a RawCallBuilder for deploying this contract using the given provider and constructor arguments, if any.
new
Creates a new wrapper around an on-chain WorkerManager contract instance.