Contracts
Project Registrars
ProjectRegistrar

Solidity API

ProjectRegistrar

Entry point for users claiming chips. Responsible for setting the ers name for each chip in its enrollment as [chip].project.tsm.ers. The TSM Registrar sets the root node of the ProjectRegistrar when addProject is called on the TSMRegistrar The owner of the contract can set the claim app URL

RootNodeSet

event RootNodeSet(bytes32 _rootNode)

onlyTSMRegistrar

modifier onlyTSMRegistrar()

chipRegistry

contract IChipRegistry chipRegistry

ers

contract IERS ers

tsmRegistrar

contract ITSMRegistrar tsmRegistrar

maxBlockWindow

uint256 maxBlockWindow

rootNode

bytes32 rootNode

constructor

constructor(address _projectManager, contract IChipRegistry _chipRegistry, contract IERS _ers, contract ITSMRegistrar _tsmRegistrar, uint256 _maxBlockWindow) public

Parameters

NameTypeDescription
_projectManageraddressThe address that will be set as the owner
_chipRegistrycontract IChipRegistryThe chip registry of the ERS system being used
_erscontract IERSThe ERS registry of the ERS system being used
_tsmRegistrarcontract ITSMRegistrarThe TSMRegistrar that made this project
_maxBlockWindowuint256The maximum amount of blocks a signature used for updating chip table is valid for

claimChip

function claimChip(address _chipId, bytes32 _nameHash, struct IChipRegistry.TSMMerkleInfo _claimData, struct IChipRegistry.ManufacturerValidation _manufacturerValidation, uint256 _commitBlock, bytes _ownershipProof, bytes _tsmCertificate, bytes _custodyProof) external

Allow a chip holder to name chip to the ERS and enroll it to the Chip Registry. Chip owner will be set as the msg.sender. Will revert if invalid proof of ownership is given or ownership proof is expired. Will revert if chip is msg.sender since it cannot own itself.

Parameters

NameTypeDescription
_chipIdaddressAddress of the chip being claimed
_nameHashbytes32Keccak256 hash of the human-readable name for the chip being claimed
_claimDatastruct IChipRegistry.TSMMerkleInfoStruct containing chip info
_manufacturerValidationstruct IChipRegistry.ManufacturerValidationStruct with needed info for chip's manufacturer validation
_commitBlockuint256The block the signature is tied to (used to put a time limit on the signature)
_ownershipProofbytesChip signature of the chainId, _commitBlock, _nameHash, and msg.sender packed together
_tsmCertificatebytesChip's public key/ID signed by the projectPublicKey
_custodyProofbytesProof that the chip was in custody of the TSM, the projectPublicKey signed by the chip

setRootNode

function setRootNode(bytes32 _rootNode) external

ONLY TSM REGISTRAR: Set the root node for this project (ie project.tsm.ers)

Parameters

NameTypeDescription
_rootNodebytes32The root node for this project