diff --git a/frontend/src/artifacts/DeviceManager.json b/frontend/src/artifacts/DeviceManager.json new file mode 100644 index 0000000..ae29b92 --- /dev/null +++ b/frontend/src/artifacts/DeviceManager.json @@ -0,0 +1,18100 @@ +{ + "contractName": "DeviceManager", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "metadataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "firmwareHash", + "type": "bytes32" + } + ], + "name": "DeviceCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "property", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "newValue", + "type": "bytes32" + } + ], + "name": "DevicePropertyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "signatureId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiryTime", + "type": "uint256" + } + ], + "name": "DeviceSigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "DeviceTransfered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "newData", + "type": "string" + } + ], + "name": "EntityDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "signatureId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + } + ], + "name": "SignatureRevoked", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_identifier", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_metadataHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_firmwareHash", + "type": "bytes32" + } + ], + "name": "createDevice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "deviceSignatureCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "devices", + "outputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "metadataHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "firmwareHash", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + } + ], + "name": "getActiveSignaturesForDevice", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "getDevicesByOwner", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + } + ], + "name": "isDeviceAnEntity", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_signature", + "type": "bytes" + } + ], + "name": "isValidEthMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_firmwareHash", + "type": "bytes32" + } + ], + "name": "isValidFirmwareHash", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "_proof", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "_leaf", + "type": "bytes32" + } + ], + "name": "isValidMetadataMember", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "ownerDeviceCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "ownerToEntity", + "outputs": [ + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_signatureId", + "type": "uint256" + } + ], + "name": "revokeSignature", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_expiryTime", + "type": "uint256" + } + ], + "name": "signDevice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "signatures", + "outputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deviceId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiryTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "revoked", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + } + ], + "name": "transferDevice", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "_data", + "type": "string" + } + ], + "name": "updateEntityData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_newFirmwareHash", + "type": "bytes32" + } + ], + "name": "updateFirmwareHash", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_newIdentifier", + "type": "bytes32" + } + ], + "name": "updateIdentifier", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_deviceId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_newMetadataHash", + "type": "bytes32" + } + ], + "name": "updateMetadataHash", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"identifier\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"firmwareHash\",\"type\":\"bytes32\"}],\"name\":\"DeviceCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"property\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newValue\",\"type\":\"bytes32\"}],\"name\":\"DevicePropertyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"signatureId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expiryTime\",\"type\":\"uint256\"}],\"name\":\"DeviceSigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"DeviceTransfered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newData\",\"type\":\"string\"}],\"name\":\"EntityDataUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"signatureId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"}],\"name\":\"SignatureRevoked\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_identifier\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_metadataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_firmwareHash\",\"type\":\"bytes32\"}],\"name\":\"createDevice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"deviceSignatureCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"devices\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"identifier\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"firmwareHash\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"}],\"name\":\"getActiveSignaturesForDevice\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"getDevicesByOwner\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"}],\"name\":\"isDeviceAnEntity\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"}],\"name\":\"isValidEthMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_firmwareHash\",\"type\":\"bytes32\"}],\"name\":\"isValidFirmwareHash\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"_proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"_leaf\",\"type\":\"bytes32\"}],\"name\":\"isValidMetadataMember\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"ownerDeviceCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"ownerToEntity\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"data\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_signatureId\",\"type\":\"uint256\"}],\"name\":\"revokeSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_expiryTime\",\"type\":\"uint256\"}],\"name\":\"signDevice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"signatures\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deviceId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"revoked\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"transferDevice\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"_data\",\"type\":\"string\"}],\"name\":\"updateEntityData\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newFirmwareHash\",\"type\":\"bytes32\"}],\"name\":\"updateFirmwareHash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newIdentifier\",\"type\":\"bytes32\"}],\"name\":\"updateIdentifier\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deviceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newMetadataHash\",\"type\":\"bytes32\"}],\"name\":\"updateMetadataHash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"createDevice(bytes32,bytes32,bytes32)\":{\"params\":{\"_firmwareHash\":\"Hash of actual firmware hash.\",\"_identifier\":\"Unique device identifier, such as fingerprint of RSA/ECC public key or Ethereum address (recommended).\",\"_metadataHash\":\"Merkle root hash of metadata (recommended) or simple hash of concatenated metadata.\"},\"return\":\"Created device ID.\"},\"getActiveSignaturesForDevice(uint256)\":{\"details\":\"Use this function instead of filtering DeviceSigned event since signatures could have been revoked.\",\"params\":{\"_deviceId\":\"ID of a device.\"},\"return\":\"Array of signature IDs.\"},\"getDevicesByOwner(address)\":{\"details\":\"Use this function instead of filtering DeviceCreated event since devices could have been transferred between owners.\",\"params\":{\"_owner\":\"Owner address.\"},\"return\":\"Array of device IDs.\"},\"isDeviceAnEntity(uint256)\":{\"params\":{\"_deviceId\":\"ID of a device.\"},\"return\":\"Boolean status.\"},\"isValidEthMessage(uint256,bytes32,bytes)\":{\"params\":{\"_deviceId\":\"ID of a device that signed the message.\",\"_messageHash\":\"Hash of sent message.\",\"_signature\":\"Signature generated using web3.eth.sign().\"},\"return\":\"Boolean status.\"},\"isValidFirmwareHash(uint256,bytes32)\":{\"params\":{\"_deviceId\":\"ID of a device containing firmware hash.\",\"_firmwareHash\":\"Firmware hash (not the actual hash).\"},\"return\":\"Boolean status.\"},\"isValidMetadataMember(uint256,bytes32[],bytes32)\":{\"params\":{\"_deviceId\":\"ID of a device containing metadata hash.\",\"_leaf\":\"Leaf of Merkle tree.\",\"_proof\":\"Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree.\"},\"return\":\"Boolean status.\"},\"revokeSignature(uint256)\":{\"params\":{\"_signatureId\":\"ID of to be revoked signature.\"}},\"signDevice(uint256,uint256)\":{\"params\":{\"_deviceId\":\"ID of to be signed device.\",\"_expiryTime\":\"Expiry time in Unix seconds.\"},\"return\":\"Created signature ID.\"},\"transferDevice(uint256,address)\":{\"params\":{\"_deviceId\":\"ID of to be transfered device.\",\"_to\":\"Address of new owner.\"}},\"updateEntityData(string)\":{\"params\":{\"_data\":\"Entity data.\"}},\"updateFirmwareHash(uint256,bytes32)\":{\"params\":{\"_deviceId\":\"ID of a device.\",\"_newFirmwareHash\":\"New firmware hash.\"}},\"updateIdentifier(uint256,bytes32)\":{\"params\":{\"_deviceId\":\"ID of a device.\",\"_newIdentifier\":\"New identifier.\"}},\"updateMetadataHash(uint256,bytes32)\":{\"params\":{\"_deviceId\":\"ID of a device.\",\"_newMetadataHash\":\"New metadata hash.\"}}},\"title\":\"Device manager core contract.\"},\"userdoc\":{\"methods\":{\"createDevice(bytes32,bytes32,bytes32)\":{\"notice\":\"Creates and saves device into storage. Emits DeviceCreated. \"},\"getActiveSignaturesForDevice(uint256)\":{\"notice\":\"Gets all signatures for specific device. \"},\"getDevicesByOwner(address)\":{\"notice\":\"Gets all devices owned by specified address. \"},\"isDeviceAnEntity(uint256)\":{\"notice\":\"Checks if device is also an entity. \"},\"isValidEthMessage(uint256,bytes32,bytes)\":{\"notice\":\"Validate authenticity of message signed by Etherium private key. On-chain validation is available only for Ethereum signed messages.\"},\"isValidFirmwareHash(uint256,bytes32)\":{\"notice\":\"Checks if provided firmware hash is equal to firmware hash device property. \"},\"isValidMetadataMember(uint256,bytes32[],bytes32)\":{\"notice\":\"Checks if provided leaf is a member of metadata contained in Merkle tree. Assumes that each pair of leaves and each pair of pre-images are sorted.\"},\"revokeSignature(uint256)\":{\"notice\":\"Revokes a signature. Emits SignatureRevoked. \"},\"signDevice(uint256,uint256)\":{\"notice\":\"Signs a device and signature into storage. Emits DeviceSigned. \"},\"transferDevice(uint256,address)\":{\"notice\":\"Transfer device ownership from one external account to another. Emits DeviceTransfered.\"},\"updateEntityData(string)\":{\"notice\":\"Update entity data.\"},\"updateFirmwareHash(uint256,bytes32)\":{\"notice\":\"Update device with new firmware hash. Emits DevicePropertyUpdated.\"},\"updateIdentifier(uint256,bytes32)\":{\"notice\":\"Update device with new identifier. Emits DevicePropertyUpdated.\"},\"updateMetadataHash(uint256,bytes32)\":{\"notice\":\"Update device with new metadata hash. Emits DevicePropertyUpdated.\"}}}},\"settings\":{\"compilationTarget\":{\"project:/contracts/DeviceManager.sol\":\"DeviceManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/DeviceManager.sol\":{\"keccak256\":\"0x614e3853acaa8bd59abff3834a5401b911e909933c564718fc95c7acc51a43f8\",\"urls\":[\"bzz-raw://55f16f1f9a115ec382c124e26884177aac1ed1993de70122561d81ecafa2746b\",\"dweb:/ipfs/QmUxzgkGToWAFsbY4iJPDtt57BoHtVa68Kogt3QLcXHbqD\"]},\"project:/contracts/ECRecovery.sol\":{\"keccak256\":\"0x3655e91e9a4ffd73fbc66c4f0856982bedc06b8fe032f3c97ecf598361321203\",\"urls\":[\"bzz-raw://71765afd98711a1036d17dac73a570171bdaa7dfa86e9e9179a74ca1cefafdab\",\"dweb:/ipfs/QmQcY87BQ6YuoYw14R2fMssiGCFeHToca2EvWKWB6VgNCA\"]},\"project:/contracts/MerkleProof.sol\":{\"keccak256\":\"0xa45ef04076a6968b1b228d7b30d6d1811c72d280e2cf6cfe1e82b02d0948c8ff\",\"urls\":[\"bzz-raw://f7c40e87d2176dcf2eedc3738127c42faa23c73678f77887382b32fa3d23b864\",\"dweb:/ipfs/QmSz69PghkpkioregwXQFoaHqZcCuUWHGGxqm6b7oTK7QH\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061210a806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636231fb0b116100ad578063acbcb50711610071578063acbcb50714610704578063b0bd9fda146107c1578063b22d439d14610803578063c40613df14610853578063ee2357831461093757610121565b80636231fb0b1461048f5780638be10194146104c75780638e9075be1461054e5780639de9662d14610635578063aa554c9d146106b857610121565b80633da1f79a116100f45780633da1f79a1461027f5780634840c63b146102ad57806351b0e98714610303578063533293ab1461039c5780635a3f79d2146103d457610121565b806307f63700146101265780630bcb88e81461015e57806310ff8e31146101a45780632a08e60114610227575b600080fd5b61015c6004803603604081101561013c57600080fd5b810190808035906020019092919080359060200190929190505050610985565b005b61018a6004803603602081101561017457600080fd5b8101908080359060200190929190505050610b71565b604051808215151515815260200191505060405180910390f35b6101d0600480360360208110156101ba57600080fd5b8101908080359060200190929190505050610c08565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b6102696004803603602081101561023d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c65565b6040518082815260200191505060405180910390f35b6102ab6004803603602081101561029557600080fd5b8101908080359060200190929190505050610c7d565b005b6102ed600480360360608110156102c357600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610e61565b6040518082815260200191505060405180910390f35b6103456004803603602081101561031957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561038857808201518184015260208101905061036d565b505050509050019250505060405180910390f35b6103d2600480360360408110156103b257600080fd5b810190808035906020019092919080359060200190929190505050611131565b005b61048d600480360360208110156103ea57600080fd5b810190808035906020019064010000000081111561040757600080fd5b82018360208201111561041957600080fd5b8035906020019184600183028401116401000000008311171561043b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061131d565b005b6104c5600480360360408110156104a557600080fd5b810190808035906020019092919080359060200190929190505050611429565b005b6104f3600480360360208110156104dd57600080fd5b8101908080359060200190929190505050611615565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018215151515815260200194505050505060405180910390f35b61061b6004803603606081101561056457600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561059557600080fd5b8201836020820111156105a757600080fd5b803590602001918460018302840111640100000000831117156105c957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061167f565b604051808215151515815260200191505060405180910390f35b6106616004803603602081101561064b57600080fd5b81019080803590602001909291905050506116e3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106a4578082015181840152602081019050610689565b505050509050019250505060405180910390f35b6106ee600480360360408110156106ce57600080fd5b8101908080359060200190929190803590602001909291905050506117de565b6040518082815260200191505060405180910390f35b6107466004803603602081101561071a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611954565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078657808201518184015260208101905061076b565b50505050905090810190601f1680156107b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107ed600480360360208110156107d757600080fd5b8101908080359060200190929190505050611a0a565b6040518082815260200191505060405180910390f35b6108396004803603604081101561081957600080fd5b810190808035906020019092919080359060200190929190505050611a22565b604051808215151515815260200191505060405180910390f35b61091d6004803603606081101561086957600080fd5b81019080803590602001909291908035906020019064010000000081111561089057600080fd5b8201836020820111156108a257600080fd5b803590602001918460208302840111640100000000831117156108c457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611a4d565b604051808215151515815260200191505060405180910390f35b6109836004803603604081101561094d57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a81565b005b813373ffffffffffffffffffffffffffffffffffffffff16600182815481106109aa57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414610aef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b8260018581548110610afd57fe5b9060005260206000209060040201600201819055507f6d65746164617461000000000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b600060018281548110610b8057fe5b90600052602060002090600402016001015460001c73ffffffffffffffffffffffffffffffffffffffff1660018381548110610bb857fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b60018181548110610c1557fe5b90600052602060002090600402016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154905084565b60026020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff1660038281548110610ca157fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120916021913960400191505060405180910390fd5b6000151560038281548110610d5057fe5b906000526020600020906004020160030160009054906101000a900460ff16151514610dc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806120b26024913960400191505060405180910390fd5b600060038281548110610dd657fe5b9060005260206000209060040201905060018160030160006101000a81548160ff021916908315150217905550600460008260010154815260200190815260200160002060008154809291906001900391905055508060010154827ff93d5095ac7696e643e1fa0aa35d622f4a13e11f4e199f30794679dcdcdb973760405160405180910390a35050565b6000610e6b611f64565b60405180608001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481525090506000600180839080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301555050039050600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff16817f093aad13dfa930f4f2311a7f59be1c3674ccc072b729756c22447948a2c0520088888860405180848152602001838152602001828152602001935050505060405180910390a380925050509392505050565b606080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460405190808252806020026020018201604052801561106a5781602001602082028038833980820191505090505b509050600080905060008090505b600180549050811015611126578473ffffffffffffffffffffffffffffffffffffffff16600182815481106110a957fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611119578083838151811061110457fe5b60200260200101818152505081806001019250505b8080600101915050611078565b508192505050919050565b813373ffffffffffffffffffffffffffffffffffffffff166001828154811061115657fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b82600060046000838152602001908152602001600020541461129b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b82600185815481106112a957fe5b9060005260206000209060040201600101819055507f6964656e74696669657200000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190611372929190611fab565b503373ffffffffffffffffffffffffffffffffffffffff167f53d207b6cf416d44764c48a52a7e64ffa2793f67215d452a032a11e0dd34bd2c826040518080602001828103825283818151815260200191508051906020019080838360005b838110156113ec5780820151818401526020810190506113d1565b50505050905090810190601f1680156114195780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b813373ffffffffffffffffffffffffffffffffffffffff166001828154811061144e57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611509576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414611593576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b82600185815481106115a157fe5b9060005260206000209060040201600301819055507f6669726d77617265000000000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b6003818154811061162257fe5b90600052602060002090600402016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900460ff16905084565b60006001848154811061168e57fe5b90600052602060002090600402016001015460001c73ffffffffffffffffffffffffffffffffffffffff166116c38484611dc9565b73ffffffffffffffffffffffffffffffffffffffff161490509392505050565b60608060046000848152602001908152602001600020546040519080825280602002602001820160405280156117285781602001602082028038833980820191505090505b509050600080905060008090505b6003805490508110156117d357846003828154811061175157fe5b90600052602060002090600402016001015414801561179f5750600015156003828154811061177c57fe5b906000526020600020906004020160030160009054906101000a900460ff161515145b156117c657808383815181106117b157fe5b60200260200101818152505081806001019250505b8080600101915050611736565b508192505050919050565b60006117e861202b565b60405180608001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152509050600060016003839080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908315150217905550505003905060046000868152602001908152602001600020600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff1685827f3739f348a11e3a029a385b4746ea6edba7f01ceec207010638e9d17862b78c40876040518082815260200191505060405180910390a4809250505092915050565b6000602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b5050505050905081565b60046020528060005260406000206000915090505481565b60008160018481548110611a3257fe5b90600052602060002090600402016003015414905092915050565b6000611a788360018681548110611a6057fe5b90600052602060002090600402016002015484611eab565b90509392505050565b813373ffffffffffffffffffffffffffffffffffffffff1660018281548110611aa657fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414611beb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b600060018581548110611bfa57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508360018681548110611c3c57fe5b906000526020600020906004020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550847f848155b8e733cfd6e7258639111d906437ddb051818f4061fc4c7cfbc575cb2e8286604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a25050505050565b6000806000806041855114611de45760009350505050611ea5565b6020850151925060408501519150606085015160001a9050601b8160ff161015611e0f57601b810190505b601b8160ff1614158015611e275750601c8160ff1614155b15611e385760009350505050611ea5565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611e95573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008082905060008090505b8551811015611f56576000868281518110611ece57fe5b6020026020010151905080831015611f165782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250611f48565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b508080600101915050611eb7565b508381149150509392505050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000801916815260200160008019168152602001600080191681525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fec57805160ff191683800117855561201a565b8280016001018555821561201a579182015b82811115612019578251825591602001919060010190611ffe565b5b509050612027919061206b565b5090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000151581525090565b61208d91905b80821115612089576000816000905550600101612071565b5090565b9056fe4f6e6c7920666f722063726561746f72206f6620746865207369676e61747572655369676e6174757265206d7573746e2774206265207265766f6b656420616c7265616479a265627a7a72315820cce429ce141aebbd104146e76ccfc3b3ec0ffafef989e9642e5d3a0828c0ce5864736f6c63430005100032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101215760003560e01c80636231fb0b116100ad578063acbcb50711610071578063acbcb50714610704578063b0bd9fda146107c1578063b22d439d14610803578063c40613df14610853578063ee2357831461093757610121565b80636231fb0b1461048f5780638be10194146104c75780638e9075be1461054e5780639de9662d14610635578063aa554c9d146106b857610121565b80633da1f79a116100f45780633da1f79a1461027f5780634840c63b146102ad57806351b0e98714610303578063533293ab1461039c5780635a3f79d2146103d457610121565b806307f63700146101265780630bcb88e81461015e57806310ff8e31146101a45780632a08e60114610227575b600080fd5b61015c6004803603604081101561013c57600080fd5b810190808035906020019092919080359060200190929190505050610985565b005b61018a6004803603602081101561017457600080fd5b8101908080359060200190929190505050610b71565b604051808215151515815260200191505060405180910390f35b6101d0600480360360208110156101ba57600080fd5b8101908080359060200190929190505050610c08565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b6102696004803603602081101561023d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c65565b6040518082815260200191505060405180910390f35b6102ab6004803603602081101561029557600080fd5b8101908080359060200190929190505050610c7d565b005b6102ed600480360360608110156102c357600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610e61565b6040518082815260200191505060405180910390f35b6103456004803603602081101561031957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561038857808201518184015260208101905061036d565b505050509050019250505060405180910390f35b6103d2600480360360408110156103b257600080fd5b810190808035906020019092919080359060200190929190505050611131565b005b61048d600480360360208110156103ea57600080fd5b810190808035906020019064010000000081111561040757600080fd5b82018360208201111561041957600080fd5b8035906020019184600183028401116401000000008311171561043b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061131d565b005b6104c5600480360360408110156104a557600080fd5b810190808035906020019092919080359060200190929190505050611429565b005b6104f3600480360360208110156104dd57600080fd5b8101908080359060200190929190505050611615565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018215151515815260200194505050505060405180910390f35b61061b6004803603606081101561056457600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561059557600080fd5b8201836020820111156105a757600080fd5b803590602001918460018302840111640100000000831117156105c957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061167f565b604051808215151515815260200191505060405180910390f35b6106616004803603602081101561064b57600080fd5b81019080803590602001909291905050506116e3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106a4578082015181840152602081019050610689565b505050509050019250505060405180910390f35b6106ee600480360360408110156106ce57600080fd5b8101908080359060200190929190803590602001909291905050506117de565b6040518082815260200191505060405180910390f35b6107466004803603602081101561071a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611954565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078657808201518184015260208101905061076b565b50505050905090810190601f1680156107b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107ed600480360360208110156107d757600080fd5b8101908080359060200190929190505050611a0a565b6040518082815260200191505060405180910390f35b6108396004803603604081101561081957600080fd5b810190808035906020019092919080359060200190929190505050611a22565b604051808215151515815260200191505060405180910390f35b61091d6004803603606081101561086957600080fd5b81019080803590602001909291908035906020019064010000000081111561089057600080fd5b8201836020820111156108a257600080fd5b803590602001918460208302840111640100000000831117156108c457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611a4d565b604051808215151515815260200191505060405180910390f35b6109836004803603604081101561094d57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a81565b005b813373ffffffffffffffffffffffffffffffffffffffff16600182815481106109aa57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414610aef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b8260018581548110610afd57fe5b9060005260206000209060040201600201819055507f6d65746164617461000000000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b600060018281548110610b8057fe5b90600052602060002090600402016001015460001c73ffffffffffffffffffffffffffffffffffffffff1660018381548110610bb857fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b60018181548110610c1557fe5b90600052602060002090600402016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154905084565b60026020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff1660038281548110610ca157fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120916021913960400191505060405180910390fd5b6000151560038281548110610d5057fe5b906000526020600020906004020160030160009054906101000a900460ff16151514610dc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806120b26024913960400191505060405180910390fd5b600060038281548110610dd657fe5b9060005260206000209060040201905060018160030160006101000a81548160ff021916908315150217905550600460008260010154815260200190815260200160002060008154809291906001900391905055508060010154827ff93d5095ac7696e643e1fa0aa35d622f4a13e11f4e199f30794679dcdcdb973760405160405180910390a35050565b6000610e6b611f64565b60405180608001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481525090506000600180839080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301555050039050600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff16817f093aad13dfa930f4f2311a7f59be1c3674ccc072b729756c22447948a2c0520088888860405180848152602001838152602001828152602001935050505060405180910390a380925050509392505050565b606080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460405190808252806020026020018201604052801561106a5781602001602082028038833980820191505090505b509050600080905060008090505b600180549050811015611126578473ffffffffffffffffffffffffffffffffffffffff16600182815481106110a957fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611119578083838151811061110457fe5b60200260200101818152505081806001019250505b8080600101915050611078565b508192505050919050565b813373ffffffffffffffffffffffffffffffffffffffff166001828154811061115657fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b82600060046000838152602001908152602001600020541461129b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b82600185815481106112a957fe5b9060005260206000209060040201600101819055507f6964656e74696669657200000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190611372929190611fab565b503373ffffffffffffffffffffffffffffffffffffffff167f53d207b6cf416d44764c48a52a7e64ffa2793f67215d452a032a11e0dd34bd2c826040518080602001828103825283818151815260200191508051906020019080838360005b838110156113ec5780820151818401526020810190506113d1565b50505050905090810190601f1680156114195780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b813373ffffffffffffffffffffffffffffffffffffffff166001828154811061144e57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611509576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414611593576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b82600185815481106115a157fe5b9060005260206000209060040201600301819055507f6669726d77617265000000000000000000000000000000000000000000000000847f67ace838aca3988a026b61036d72b93a8316d05feecb6ee10316e8d59f0e687f856040518082815260200191505060405180910390a350505050565b6003818154811061162257fe5b90600052602060002090600402016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900460ff16905084565b60006001848154811061168e57fe5b90600052602060002090600402016001015460001c73ffffffffffffffffffffffffffffffffffffffff166116c38484611dc9565b73ffffffffffffffffffffffffffffffffffffffff161490509392505050565b60608060046000848152602001908152602001600020546040519080825280602002602001820160405280156117285781602001602082028038833980820191505090505b509050600080905060008090505b6003805490508110156117d357846003828154811061175157fe5b90600052602060002090600402016001015414801561179f5750600015156003828154811061177c57fe5b906000526020600020906004020160030160009054906101000a900460ff161515145b156117c657808383815181106117b157fe5b60200260200101818152505081806001019250505b8080600101915050611736565b508192505050919050565b60006117e861202b565b60405180608001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152509050600060016003839080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908315150217905550505003905060046000868152602001908152602001600020600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff1685827f3739f348a11e3a029a385b4746ea6edba7f01ceec207010638e9d17862b78c40876040518082815260200191505060405180910390a4809250505092915050565b6000602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b5050505050905081565b60046020528060005260406000206000915090505481565b60008160018481548110611a3257fe5b90600052602060002090600402016003015414905092915050565b6000611a788360018681548110611a6057fe5b90600052602060002090600402016002015484611eab565b90509392505050565b813373ffffffffffffffffffffffffffffffffffffffff1660018281548110611aa657fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920666f7220646576696365206f776e6572000000000000000000000081525060200191505060405180910390fd5b826000600460008381526020019081526020016000205414611beb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d757374206e6f74206265207369676e6564000000000000000000000000000081525060200191505060405180910390fd5b600060018581548110611bfa57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508360018681548110611c3c57fe5b906000526020600020906004020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550847f848155b8e733cfd6e7258639111d906437ddb051818f4061fc4c7cfbc575cb2e8286604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a25050505050565b6000806000806041855114611de45760009350505050611ea5565b6020850151925060408501519150606085015160001a9050601b8160ff161015611e0f57601b810190505b601b8160ff1614158015611e275750601c8160ff1614155b15611e385760009350505050611ea5565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611e95573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008082905060008090505b8551811015611f56576000868281518110611ece57fe5b6020026020010151905080831015611f165782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250611f48565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b508080600101915050611eb7565b508381149150509392505050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000801916815260200160008019168152602001600080191681525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fec57805160ff191683800117855561201a565b8280016001018555821561201a579182015b82811115612019578251825591602001919060010190611ffe565b5b509050612027919061206b565b5090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000151581525090565b61208d91905b80821115612089576000816000905550600101612071565b5090565b9056fe4f6e6c7920666f722063726561746f72206f6620746865207369676e61747572655369676e6174757265206d7573746e2774206265207265766f6b656420616c7265616479a265627a7a72315820cce429ce141aebbd104146e76ccfc3b3ec0ffafef989e9642e5d3a0828c0ce5864736f6c63430005100032", + "sourceMap": "13187:90:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;13187:90:0;;;;;;;", + "deployedSourceMap": "13187:90:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;13187:90:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12397:270;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12397:270:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5193:179;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5193:179:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2790:23;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2790:23:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2884:49;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2884:49:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;9263:483;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9263:483:0;;;;;;;;;;;;;;;;;:::i;:::-;;3799:434;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3799:434:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4631:409;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4631:409:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;4631:409:0;;;;;;;;;;;;;;;;;11934:262;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11934:262:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;685:165;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;685:165:0;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;685:165:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;685:165:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;685:165:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;685:165:0;;;;;;;;;;;;;;;:::i;:::-;;12868:270;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12868:270:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;7800:29;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7800:29:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6893:247;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6893:247:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;6893:247:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;6893:247:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;6893:247:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;6893:247:0;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;10140:482;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10140:482:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;10140:482:0;;;;;;;;;;;;;;;;;8728:388;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8728:388:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;426:48;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;426:48:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;426:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7904:50;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7904:50:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;6325:169;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6325:169:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;5831:211;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5831:211:0;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;5831:211:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;5831:211:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;5831:211:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;5831:211:0;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;11390:350;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11390:350:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;12397:270;12486:9;3303:10;3275:38;;:7;3283:9;3275:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;:38;;;3267:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12507:9;8432:1;8397:20;:31;8418:9;8397:31;;;;;;;;;;;;:36;8389:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12563:16;12529:7;12537:9;12529:18;;;;;;;;;;;;;;;;;;:31;;:50;;;;12597:62;12619:9;12597:62;12642:16;12597:62;;;;;;;;;;;;;;;;;;3350:1;12397:270;;;:::o;5193:179::-;5256:4;5332:7;5340:9;5332:18;;;;;;;;;;;;;;;;;;:29;;;5324:38;;5280:84;;:7;5288:9;5280:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;:84;;;5273:91;;5193:179;;;:::o;2790:23::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2884:49::-;;;;;;;;;;;;;;;;;:::o;9263:483::-;9368:10;9333:45;;:10;9344:12;9333:24;;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;:45;;;9325:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9471:5;9435:41;;:10;9446:12;9435:24;;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;9427:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9528:27;9558:10;9569:12;9558:24;;;;;;;;;;;;;;;;;;9528:54;;9613:4;9593:9;:17;;;:24;;;;;;;;;;;;;;;;;;9628:20;:40;9649:9;:18;;;9628:40;;;;;;;;;;;;:42;;;;;;;;;;;;;;9719:9;:18;;;9705:12;9688:50;;;;;;;;;;9263:483;;:::o;3799:434::-;3904:4;3921:23;;:::i;:::-;3947:61;;;;;;;;3954:10;3947:61;;;;;;3966:11;3947:61;;;;3979:13;3947:61;;;;3994:13;3947:61;;;3921:87;;4019:13;4061:1;4035:7;4048:9;4035:23;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;4035:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:27;4019:43;;4073:16;:28;4090:10;4073:28;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;;4145:10;4121:78;;4135:8;4121:78;4157:11;4170:13;4185;4121:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4217:8;4210:15;;;;3799:434;;;;;:::o;4631:409::-;4695:13;4721:23;4758:16;:24;4775:6;4758:24;;;;;;;;;;;;;;;;4747:36;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;4747:36:0;;;;4721:62;;4794:12;4809:1;4794:16;;4826:6;4835:1;4826:10;;4821:185;4842:7;:14;;;;4838:1;:18;4821:185;;;4902:6;4882:26;;:7;4890:1;4882:10;;;;;;;;;;;;;;;;;;:16;;;;;;;;;;;;:26;;;4878:117;;;4950:1;4929:9;4939:7;4929:18;;;;;;;;;;;;;:22;;;;;4970:9;;;;;;;4878:117;4858:3;;;;;;;4821:185;;;;5023:9;5016:16;;;;4631:409;;;:::o;11934:262::-;12019:9;3303:10;3275:38;;:7;3283:9;3275:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;:38;;;3267:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12040:9;8432:1;8397:20;:31;8418:9;8397:31;;;;;;;;;;;;:36;8389:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12094:14;12062:7;12070:9;12062:18;;;;;;;;;;;;;;;;;;:29;;:46;;;;12126:62;12148:9;12126:62;12173:14;12126:62;;;;;;;;;;;;;;;;;;3350:1;11934:262;;;:::o;685:165::-;783:5;750:13;:25;764:10;750:25;;;;;;;;;;;;;;;:30;;:38;;;;;;;;;;;;:::i;:::-;;824:10;806:36;;;836:5;806:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;806:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;685:165;:::o;12868:270::-;12957:9;3303:10;3275:38;;:7;3283:9;3275:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;:38;;;3267:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12978:9;8432:1;8397:20;:31;8418:9;8397:31;;;;;;;;;;;;:36;8389:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13034:16;13000:7;13008:9;13000:18;;;;;;;;;;;;;;;;;;:31;;:50;;;;13068:62;13090:9;13068:62;13113:16;13068:62;;;;;;;;;;;;;;;;;;3350:1;12868:270;;;:::o;7800:29::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6893:247::-;7004:4;7100:7;7108:9;7100:18;;;;;;;;;;;;;;;;;;:29;;;7092:38;;7028:104;;:44;7047:12;7061:10;7028:18;:44::i;:::-;:104;;;7021:111;;6893:247;;;;;:::o;10140:482::-;10215:13;10241:26;10281:20;:31;10302:9;10281:31;;;;;;;;;;;;10270:43;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10270:43:0;;;;10241:72;;10324:12;10339:1;10324:16;;10356:6;10365:1;10356:10;;10351:234;10372:10;:17;;;;10368:1;:21;10351:234;;;10441:9;10415:10;10426:1;10415:13;;;;;;;;;;;;;;;;;;:22;;;:35;:69;;;;;10479:5;10454:30;;:10;10465:1;10454:13;;;;;;;;;;;;;;;;;;:21;;;;;;;;;;;;:30;;;10415:69;10411:163;;;10529:1;10505:12;10518:7;10505:21;;;;;;;;;;;;;:25;;;;;10549:9;;;;;;;10411:163;10391:3;;;;;;;10351:234;;;;10602:12;10595:19;;;;10140:482;;;:::o;8728:388::-;8798:4;8815:26;;:::i;:::-;8844:52;;;;;;;;8854:10;8844:52;;;;;;8866:9;8844:52;;;;8877:11;8844:52;;;;8890:5;8844:52;;;;;8815:81;;8907:16;8955:1;8926:10;8942:9;8926:26;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;8926:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:30;8907:49;;8967:20;:31;8988:9;8967:31;;;;;;;;;;;;:33;;;;;;;;;;;;;9055:10;9018:61;;9044:9;9031:11;9018:61;9067:11;9018:61;;;;;;;;;;;;;;;;;;9097:11;9090:18;;;;8728:388;;;;:::o;426:48::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7904:50::-;;;;;;;;;;;;;;;;;:::o;6325:169::-;6414:4;6473:13;6438:7;6446:9;6438:18;;;;;;;;;;;;;;;;;;:31;;;:48;6431:55;;6325:169;;;;:::o;5831:211::-;5939:4;5963:71;5987:6;5995:7;6003:9;5995:18;;;;;;;;;;;;;;;;;;:31;;;6028:5;5963:23;:71::i;:::-;5956:78;;5831:211;;;;;:::o;11390:350::-;11462:9;3303:10;3275:38;;:7;3283:9;3275:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;:38;;;3267:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11483:9;8432:1;8397:20;:31;8418:9;8397:31;;;;;;;;;;;;:36;8389:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11505:20;11528:7;11536:9;11528:18;;;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;11505:47;;11590:3;11563:7;11571:9;11563:18;;;;;;;;;;;;;;;;;;:24;;;:30;;;;;;;;;;;;;;;;;;11604:16;:28;11621:10;11604:28;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;;;11645:16;:21;11662:3;11645:21;;;;;;;;;;;;;;;;:23;;;;;;;;;;;;;11703:9;11686:46;11714:12;11728:3;11686:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8467:1;3350;11390:350;;;:::o;732:1152:1:-;839:7;864:9;884;904:7;988:2;967:10;:17;:23;963:75;;1023:1;1007:19;;;;;;;963:75;1348:2;1336:10;1332:19;1326:26;1321:31;;1393:2;1381:10;1377:19;1371:26;1366:31;;1446:2;1434:10;1430:19;1424:26;1421:1;1416:35;1411:40;;1574:2;1570:1;:6;;;1566:46;;;1598:2;1593:7;;;;1566:46;1697:2;1692:1;:7;;;;:18;;;;;1708:2;1703:1;:7;;;;1692:18;1688:189;;;1743:1;1727:19;;;;;;;1688:189;1840:25;1850:5;1857:1;1860;1863;1840:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1840:25:1;;;;;;;;1833:32;;;;;732:1152;;;;;:::o;696:873:2:-;856:4;878:20;901:5;878:28;;924:9;936:1;924:13;;919:526;943:6;:13;939:1;:17;919:526;;;978:20;1001:6;1008:1;1001:9;;;;;;;;;;;;;;978:32;;1046:12;1031;:27;1027:407;;;1200:12;1214;1183:44;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1183:44:2;;;1173:55;;;;;;1158:70;;1027:407;;;1390:12;1404;1373:44;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1373:44:2;;;1363:55;;;;;;1348:70;;1027:407;919:526;958:3;;;;;;;919:526;;;;1556:5;1540:12;:21;1533:28;;;696:873;;;;;:::o;13187:90:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.5.0;\r\n\r\nimport \"./MerkleProof.sol\";\r\nimport \"./ECRecovery.sol\";\r\n\r\n/**\r\n * @title Provides base functionalities for entities.\r\n */\r\ncontract EntityBase {\r\n /// @dev Entity in the device management system.\r\n struct Entity {\r\n // Arbitary data in case entity wants to have some public information available.\r\n string data;\r\n }\r\n\r\n /// @notice Maps owner to an Entity structure.\r\n mapping (address => Entity) public ownerToEntity;\r\n\r\n /// @dev Fired on entity data update.\r\n event EntityDataUpdated(address indexed owner, string newData);\r\n\r\n /**\r\n * @notice Update entity data.\r\n * @param _data Entity data.\r\n */\r\n function updateEntityData(string memory _data) public {\r\n ownerToEntity[msg.sender].data = _data;\r\n\r\n emit EntityDataUpdated(msg.sender, _data);\r\n }\r\n}\r\n\r\n/**\r\n * @title Provides base functionalities for devices.\r\n */\r\ncontract DeviceBase {\r\n /// @dev Main device structucture.\r\n struct Device {\r\n // Ethereum address of a device owner.\r\n address owner;\r\n\r\n // Unique device identifier. Can hold anything that fits into 32 bytes. Different from device ID.\r\n // Supposed to be a public key or a representation of one, such as fingerprint of RSA/ECC \r\n // public key or simply an Ethereum address. To make identifier be an Ethereum address, \r\n // use secp256k1 curve to generate public and private key pair, run keccak256 hash function\r\n // on public key and take last 20 bytes of generated hash to get Ethereum address.\r\n // If a device wants to be it's own entity, use same address as in owner property.\r\n bytes32 identifier;\r\n \r\n // Merkle root hash of metadata or simple hash of concatenated data.\r\n // It is recommended to use Merkle tree to store information on device as it enables to \r\n // prove membership of specific data by providing Merkle proof without revealing whole dataset.\r\n bytes32 metadataHash;\r\n\r\n // Holds a hash of actual firmware hash. Actual firmware hash is not supposed to be stored.\r\n // Plain text or hash would expose data that is meant to be private, so \"hash of hash\" principle \r\n // gives privacy and makes integrity verification possible.\r\n bytes32 firmwareHash;\r\n\r\n // Additional data linked to device. Can be used to store hash of encrypted firmware on IPFS.\r\n //string offchainLink;\r\n\r\n // Full public key (even though parties can exchange public key other ways then use\r\n // blockchain to verify.)\r\n //string publicKey;\r\n }\r\n \r\n /// @notice State variable for storing devices. Index in the array is also a device ID.\r\n /// Array can hold a maximum of 2^256-1 entries.\r\n Device[] public devices;\r\n\r\n /// @notice Keeps track of total devices for each owner.\r\n mapping (address => uint) public ownerDeviceCount;\r\n\r\n /// @dev Fired on creation of new device.\r\n event DeviceCreated(uint indexed deviceId, address indexed owner, bytes32 identifier, bytes32 metadataHash, bytes32 firmwareHash);\r\n\r\n /// @dev Modifier for ensuring that the message sender is owner of provided device ID.\r\n modifier onlyOwnerOf(uint _deviceId) {\r\n require(devices[_deviceId].owner == msg.sender, \"Only for device owner\");\r\n _;\r\n }\r\n\r\n /**\r\n * @notice Creates and saves device into storage. Emits DeviceCreated. \r\n * @param _identifier Unique device identifier, such as fingerprint of RSA/ECC public key or Ethereum address (recommended).\r\n * @param _metadataHash Merkle root hash of metadata (recommended) or simple hash of concatenated metadata.\r\n * @param _firmwareHash Hash of actual firmware hash.\r\n * @return Created device ID.\r\n */\r\n function createDevice(bytes32 _identifier, bytes32 _metadataHash, bytes32 _firmwareHash) public returns (uint) {\r\n Device memory newDevice = Device(msg.sender, _identifier, _metadataHash, _firmwareHash);\r\n uint deviceId = devices.push(newDevice) - 1;\r\n ownerDeviceCount[msg.sender]++;\r\n\r\n emit DeviceCreated(deviceId, msg.sender, _identifier, _metadataHash, _firmwareHash);\r\n return deviceId;\r\n }\r\n}\r\n\r\n/**\r\n * @title Provides extra functionalities for devices.\r\n */\r\ncontract DeviceHelper is DeviceBase {\r\n /**\r\n * @notice Gets all devices owned by specified address. \r\n * @dev Use this function instead of filtering DeviceCreated event since devices could have been transferred between owners.\r\n * @param _owner Owner address.\r\n * @return Array of device IDs.\r\n */\r\n function getDevicesByOwner(address _owner) public view returns (uint[] memory) {\r\n uint[] memory deviceIds = new uint[](ownerDeviceCount[_owner]);\r\n uint counter = 0;\r\n for (uint i = 0; i < devices.length; i++) {\r\n if (devices[i].owner == _owner) {\r\n deviceIds[counter] = i;\r\n counter++;\r\n }\r\n }\r\n return deviceIds;\r\n }\r\n\r\n /**\r\n * @notice Checks if device is also an entity. \r\n * @param _deviceId ID of a device.\r\n * @return Boolean status.\r\n */\r\n function isDeviceAnEntity(uint _deviceId) public view returns (bool) {\r\n return devices[_deviceId].owner == address(uint160(uint256(devices[_deviceId].identifier)));\r\n }\r\n\r\n /**\r\n * @notice Checks if provided leaf is a member of metadata contained in Merkle tree. \r\n * Assumes that each pair of leaves and each pair of pre-images are sorted.\r\n * @param _deviceId ID of a device containing metadata hash.\r\n * @param _proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree.\r\n * @param _leaf Leaf of Merkle tree.\r\n * @return Boolean status.\r\n */\r\n function isValidMetadataMember(uint _deviceId, bytes32[] memory _proof, bytes32 _leaf) public view returns (bool) {\r\n return MerkleProof.verifyProof(_proof, devices[_deviceId].metadataHash, _leaf);\r\n }\r\n\r\n /**\r\n * @notice Checks if provided firmware hash is equal to firmware hash device property. \r\n * @param _deviceId ID of a device containing firmware hash.\r\n * @param _firmwareHash Firmware hash (not the actual hash).\r\n * @return Boolean status.\r\n */\r\n function isValidFirmwareHash(uint _deviceId, bytes32 _firmwareHash) public view returns (bool) {\r\n return devices[_deviceId].firmwareHash == _firmwareHash;\r\n }\r\n\r\n /**\r\n * @notice Validate authenticity of message signed by Etherium private key.\r\n * On-chain validation is available only for Ethereum signed messages.\r\n * @param _deviceId ID of a device that signed the message.\r\n * @param _messageHash Hash of sent message.\r\n * @param _signature Signature generated using web3.eth.sign().\r\n * @return Boolean status.\r\n */\r\n function isValidEthMessage(uint _deviceId, bytes32 _messageHash, bytes memory _signature) public view returns (bool) {\r\n return ECRecovery.recover(_messageHash, _signature) == address(uint160(uint256(devices[_deviceId].identifier)));\r\n }\r\n}\r\n\r\n/**\r\n * @title Provides base functionalities for signatures.\r\n */\r\ncontract SignatureBase {\r\n /// @dev Main signature structucture.\r\n struct Signature {\r\n // Ethereum address of the signer.\r\n address signer;\r\n\r\n // ID of device to sign.\r\n uint deviceId;\r\n\r\n // Using 256 bits ensures no overflow on year 2038 (Unix seconds).\r\n uint expiryTime;\r\n\r\n // Updates to true once signer decides to revoke signature.\r\n bool revoked;\r\n }\r\n\r\n /// @notice State variable for storing signatures. Index in the array is also a signature ID.\r\n /// Array can hold a maximum of 2^256-1 entries.\r\n Signature[] public signatures;\r\n\r\n /// @notice Keeps track of total signatures for each device.\r\n mapping (uint => uint) public deviceSignatureCount;\r\n \r\n /// @dev Fired when an address signs a device.\r\n event DeviceSigned(uint indexed signatureId, uint indexed deviceId, address indexed signer, uint expiryTime);\r\n\r\n /// @dev Fired when signature is revoked.\r\n event SignatureRevoked(uint indexed signatureId, uint indexed deviceId);\r\n\r\n /// @dev Modifier for ensuring that the device hasn't been signed already.\r\n modifier notSigned(uint _deviceId) {\r\n require(deviceSignatureCount[_deviceId] == 0, \"Must not be signed\");\r\n _;\r\n }\r\n\r\n /**\r\n * @notice Signs a device and signature into storage. Emits DeviceSigned. \r\n * @param _deviceId ID of to be signed device.\r\n * @param _expiryTime Expiry time in Unix seconds.\r\n * @return Created signature ID.\r\n */\r\n function signDevice(uint _deviceId, uint _expiryTime) public returns (uint) {\r\n Signature memory signature = Signature(msg.sender, _deviceId, _expiryTime, false);\r\n uint signatureId = signatures.push(signature) - 1;\r\n deviceSignatureCount[_deviceId]++;\r\n\r\n emit DeviceSigned(signatureId, _deviceId, msg.sender, _expiryTime);\r\n return signatureId;\r\n }\r\n\r\n /**\r\n * @notice Revokes a signature. Emits SignatureRevoked. \r\n * @param _signatureId ID of to be revoked signature.\r\n */\r\n function revokeSignature(uint _signatureId) public {\r\n require(signatures[_signatureId].signer == msg.sender, \"Only for creator of the signature\");\r\n require(signatures[_signatureId].revoked == false, \"Signature mustn't be revoked already\");\r\n Signature storage signature = signatures[_signatureId];\r\n signature.revoked = true;\r\n deviceSignatureCount[signature.deviceId]--;\r\n\r\n emit SignatureRevoked(_signatureId, signature.deviceId);\r\n }\r\n}\r\n\r\n/**\r\n * @title Provides extra functionalities for signatures.\r\n */\r\ncontract SignatureHelper is SignatureBase {\r\n /**\r\n * @notice Gets all signatures for specific device. \r\n * @dev Use this function instead of filtering DeviceSigned event since signatures could have been revoked.\r\n * @param _deviceId ID of a device.\r\n * @return Array of signature IDs.\r\n */\r\n function getActiveSignaturesForDevice(uint _deviceId) public view returns (uint[] memory) {\r\n uint[] memory signatureIds = new uint[](deviceSignatureCount[_deviceId]);\r\n uint counter = 0;\r\n for (uint i = 0; i < signatures.length; i++) {\r\n if (signatures[i].deviceId == _deviceId && signatures[i].revoked == false) {\r\n signatureIds[counter] = i;\r\n counter++;\r\n }\r\n }\r\n return signatureIds;\r\n }\r\n}\r\n\r\n/**\r\n * @title Enriches devices giving them option to be updated only if not signed already.\r\n */\r\ncontract DeviceUpdatable is DeviceHelper, SignatureHelper {\r\n /// @dev Fired on device ownership transfer, keeps track of historical device owners.\r\n event DeviceTransfered(uint indexed deviceId, address oldOwner, address newOwner);\r\n \r\n /// @dev Fired on device property update, keeps track of historical property values.\r\n event DevicePropertyUpdated(uint indexed deviceId, bytes32 indexed property, bytes32 newValue);\r\n\r\n /**\r\n * @notice Transfer device ownership from one external account to another. Emits DeviceTransfered.\r\n * @param _deviceId ID of to be transfered device.\r\n * @param _to Address of new owner.\r\n */\r\n function transferDevice(uint _deviceId, address _to) public onlyOwnerOf(_deviceId) notSigned(_deviceId) {\r\n address currentOwner = devices[_deviceId].owner;\r\n devices[_deviceId].owner = _to;\r\n ownerDeviceCount[msg.sender]--;\r\n ownerDeviceCount[_to]++;\r\n\r\n emit DeviceTransfered(_deviceId, currentOwner, _to);\r\n } \r\n\r\n /**\r\n * @notice Update device with new identifier. Emits DevicePropertyUpdated.\r\n * @param _deviceId ID of a device.\r\n * @param _newIdentifier New identifier.\r\n */\r\n function updateIdentifier(uint _deviceId, bytes32 _newIdentifier) public onlyOwnerOf(_deviceId) notSigned(_deviceId) {\r\n devices[_deviceId].identifier = _newIdentifier;\r\n\r\n emit DevicePropertyUpdated(_deviceId, \"identifier\", _newIdentifier);\r\n }\r\n\r\n /**\r\n * @notice Update device with new metadata hash. Emits DevicePropertyUpdated.\r\n * @param _deviceId ID of a device.\r\n * @param _newMetadataHash New metadata hash.\r\n */\r\n function updateMetadataHash(uint _deviceId, bytes32 _newMetadataHash) public onlyOwnerOf(_deviceId) notSigned(_deviceId) {\r\n devices[_deviceId].metadataHash = _newMetadataHash;\r\n\r\n emit DevicePropertyUpdated(_deviceId, \"metadata\", _newMetadataHash);\r\n }\r\n\r\n /**\r\n * @notice Update device with new firmware hash. Emits DevicePropertyUpdated.\r\n * @param _deviceId ID of a device.\r\n * @param _newFirmwareHash New firmware hash.\r\n */\r\n function updateFirmwareHash(uint _deviceId, bytes32 _newFirmwareHash) public onlyOwnerOf(_deviceId) notSigned(_deviceId) {\r\n devices[_deviceId].firmwareHash = _newFirmwareHash;\r\n\r\n emit DevicePropertyUpdated(_deviceId, \"firmware\", _newFirmwareHash);\r\n }\r\n}\r\n\r\n/// @title Device manager core contract.\r\ncontract DeviceManager is EntityBase, DeviceUpdatable {\r\n /// @dev Merges contracts.\r\n}\r\n", + "sourcePath": "D:\\iot-device-management\\contracts\\DeviceManager.sol", + "ast": { + "absolutePath": "project:/contracts/DeviceManager.sol", + "exportedSymbols": { + "DeviceBase": [ + 131 + ], + "DeviceHelper": [ + 284 + ], + "DeviceManager": [ + 646 + ], + "DeviceUpdatable": [ + 641 + ], + "EntityBase": [ + 37 + ], + "SignatureBase": [ + 427 + ], + "SignatureHelper": [ + 494 + ] + }, + "id": 647, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "absolutePath": "project:/contracts/MerkleProof.sol", + "file": "./MerkleProof.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 647, + "sourceUnit": 797, + "src": "27:27:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "project:/contracts/ECRecovery.sol", + "file": "./ECRecovery.sol", + "id": 3, + "nodeType": "ImportDirective", + "scope": 647, + "sourceUnit": 728, + "src": "56:26:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for entities.", + "fullyImplemented": true, + "id": 37, + "linearizedBaseContracts": [ + 37 + ], + "name": "EntityBase", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "EntityBase.Entity", + "id": 6, + "members": [ + { + "constant": false, + "id": 5, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "347:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 4, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "347:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Entity", + "nodeType": "StructDefinition", + "scope": 37, + "src": "232:134:0", + "visibility": "public" + }, + { + "constant": false, + "id": 10, + "name": "ownerToEntity", + "nodeType": "VariableDeclaration", + "scope": 37, + "src": "426:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Entity_$6_storage_$", + "typeString": "mapping(address => struct EntityBase.Entity)" + }, + "typeName": { + "id": 9, + "keyType": { + "id": 7, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "435:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "426:27:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Entity_$6_storage_$", + "typeString": "mapping(address => struct EntityBase.Entity)" + }, + "valueType": { + "contractScope": null, + "id": 8, + "name": "Entity", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 6, + "src": "446:6:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Entity_$6_storage_ptr", + "typeString": "struct EntityBase.Entity" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "anonymous": false, + "documentation": "@dev Fired on entity data update.", + "id": 16, + "name": "EntityDataUpdated", + "nodeType": "EventDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12, + "indexed": true, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "550:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 11, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "550:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 14, + "indexed": false, + "name": "newData", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "573:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 13, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "573:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "549:39:0" + }, + "src": "526:63:0" + }, + { + "body": { + "id": 35, + "nodeType": "Block", + "src": "739:111:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 21, + "name": "ownerToEntity", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10, + "src": "750:13:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Entity_$6_storage_$", + "typeString": "mapping(address => struct EntityBase.Entity storage ref)" + } + }, + "id": 24, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 22, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "764:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 23, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "764:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "750:25:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Entity_$6_storage", + "typeString": "struct EntityBase.Entity storage ref" + } + }, + "id": 25, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "data", + "nodeType": "MemberAccess", + "referencedDeclaration": 5, + "src": "750:30:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 26, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "783:5:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "750:38:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 28, + "nodeType": "ExpressionStatement", + "src": "750:38:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 30, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "824:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 31, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "824:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 32, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "836:5:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 29, + "name": "EntityDataUpdated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16, + "src": "806:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (address,string memory)" + } + }, + "id": 33, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "806:36:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 34, + "nodeType": "EmitStatement", + "src": "801:41:0" + } + ] + }, + "documentation": "@notice Update entity data.\n@param _data Entity data.", + "id": 36, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "updateEntityData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 19, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 18, + "name": "_data", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "711:19:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 17, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "711:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "710:21:0" + }, + "returnParameters": { + "id": 20, + "nodeType": "ParameterList", + "parameters": [], + "src": "739:0:0" + }, + "scope": 37, + "src": "685:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "151:702:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for devices.", + "fullyImplemented": true, + "id": 131, + "linearizedBaseContracts": [ + 131 + ], + "name": "DeviceBase", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "DeviceBase.Device", + "id": 46, + "members": [ + { + "constant": false, + "id": 39, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "1061:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 38, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1061:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 41, + "name": "identifier", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "1677:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 40, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1677:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 43, + "name": "metadataHash", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "1997:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 42, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1997:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 45, + "name": "firmwareHash", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "2307:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 44, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2307:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Device", + "nodeType": "StructDefinition", + "scope": 131, + "src": "988:1643:0", + "visibility": "public" + }, + { + "constant": false, + "id": 49, + "name": "devices", + "nodeType": "VariableDeclaration", + "scope": 131, + "src": "2790:23:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device[]" + }, + "typeName": { + "baseType": { + "contractScope": null, + "id": 47, + "name": "Device", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 46, + "src": "2790:6:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage_ptr", + "typeString": "struct DeviceBase.Device" + } + }, + "id": 48, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2790:8:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage_ptr", + "typeString": "struct DeviceBase.Device[]" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 53, + "name": "ownerDeviceCount", + "nodeType": "VariableDeclaration", + "scope": 131, + "src": "2884:49:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 52, + "keyType": { + "id": 50, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2893:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2884:25:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueType": { + "id": 51, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2904:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "anonymous": false, + "documentation": "@dev Fired on creation of new device.", + "id": 65, + "name": "DeviceCreated", + "nodeType": "EventDefinition", + "parameters": { + "id": 64, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 55, + "indexed": true, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 65, + "src": "3009:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 54, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3009:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 57, + "indexed": true, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 65, + "src": "3032:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 56, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3032:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 59, + "indexed": false, + "name": "identifier", + "nodeType": "VariableDeclaration", + "scope": 65, + "src": "3055:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 58, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3055:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 61, + "indexed": false, + "name": "metadataHash", + "nodeType": "VariableDeclaration", + "scope": 65, + "src": "3075:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 60, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3075:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 63, + "indexed": false, + "name": "firmwareHash", + "nodeType": "VariableDeclaration", + "scope": 65, + "src": "3097:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 62, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3097:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3008:110:0" + }, + "src": "2989:130:0" + }, + { + "body": { + "id": 81, + "nodeType": "Block", + "src": "3256:103:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 76, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 70, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "3275:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 72, + "indexExpression": { + "argumentTypes": null, + "id": 71, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 67, + "src": "3283:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3275:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 73, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "3275:24:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 74, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "3303:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 75, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3303:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "3275:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4f6e6c7920666f7220646576696365206f776e6572", + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3315:23:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d8ad1a9c023f2f7865aaab44a294ffd93a7c2360d9cdcaf7cddf830addfb9fc6", + "typeString": "literal_string \"Only for device owner\"" + }, + "value": "Only for device owner" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_d8ad1a9c023f2f7865aaab44a294ffd93a7c2360d9cdcaf7cddf830addfb9fc6", + "typeString": "literal_string \"Only for device owner\"" + } + ], + "id": 69, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "src": "3267:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 78, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3267:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 79, + "nodeType": "ExpressionStatement", + "src": "3267:72:0" + }, + { + "id": 80, + "nodeType": "PlaceholderStatement", + "src": "3350:1:0" + } + ] + }, + "documentation": "@dev Modifier for ensuring that the message sender is owner of provided device ID.", + "id": 82, + "name": "onlyOwnerOf", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 68, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 67, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "3240:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 66, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3240:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3239:16:0" + }, + "src": "3219:140:0", + "visibility": "internal" + }, + { + "body": { + "id": 129, + "nodeType": "Block", + "src": "3910:323:0", + "statements": [ + { + "assignments": [ + 94 + ], + "declarations": [ + { + "constant": false, + "id": 94, + "name": "newDevice", + "nodeType": "VariableDeclaration", + "scope": 129, + "src": "3921:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_memory_ptr", + "typeString": "struct DeviceBase.Device" + }, + "typeName": { + "contractScope": null, + "id": 93, + "name": "Device", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 46, + "src": "3921:6:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage_ptr", + "typeString": "struct DeviceBase.Device" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 102, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 96, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "3954:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 97, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3954:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 98, + "name": "_identifier", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "3966:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 99, + "name": "_metadataHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 86, + "src": "3979:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 100, + "name": "_firmwareHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3994:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 95, + "name": "Device", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "3947:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Device_$46_storage_ptr_$", + "typeString": "type(struct DeviceBase.Device storage pointer)" + } + }, + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3947:61:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_memory", + "typeString": "struct DeviceBase.Device memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3921:87:0" + }, + { + "assignments": [ + 104 + ], + "declarations": [ + { + "constant": false, + "id": 104, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 129, + "src": "4019:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 103, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4019:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 111, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 107, + "name": "newDevice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4048:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_memory_ptr", + "typeString": "struct DeviceBase.Device memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Device_$46_memory_ptr", + "typeString": "struct DeviceBase.Device memory" + } + ], + "expression": { + "argumentTypes": null, + "id": 105, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "4035:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4035:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_Device_$46_storage_$returns$_t_uint256_$", + "typeString": "function (struct DeviceBase.Device storage ref) returns (uint256)" + } + }, + "id": 108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4035:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4061:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "4035:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4019:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "4073:30:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 112, + "name": "ownerDeviceCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4073:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 115, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 113, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "4090:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4090:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "4073:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 117, + "nodeType": "ExpressionStatement", + "src": "4073:30:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 119, + "name": "deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 104, + "src": "4135:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 120, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "4145:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4145:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 122, + "name": "_identifier", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "4157:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 123, + "name": "_metadataHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 86, + "src": "4170:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 124, + "name": "_firmwareHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "4185:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 118, + "name": "DeviceCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "4121:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_address_$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$__$", + "typeString": "function (uint256,address,bytes32,bytes32,bytes32)" + } + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4121:78:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 126, + "nodeType": "EmitStatement", + "src": "4116:83:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 127, + "name": "deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 104, + "src": "4217:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 92, + "id": 128, + "nodeType": "Return", + "src": "4210:15:0" + } + ] + }, + "documentation": "@notice Creates and saves device into storage. Emits DeviceCreated. \n@param _identifier Unique device identifier, such as fingerprint of RSA/ECC public key or Ethereum address (recommended).\n@param _metadataHash Merkle root hash of metadata (recommended) or simple hash of concatenated metadata.\n@param _firmwareHash Hash of actual firmware hash.\n@return Created device ID.", + "id": 130, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "createDevice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 89, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 84, + "name": "_identifier", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "3821:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 83, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3821:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 86, + "name": "_metadataHash", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "3842:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 85, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3842:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 88, + "name": "_firmwareHash", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "3865:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 87, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3865:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3820:67:0" + }, + "returnParameters": { + "id": 92, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 91, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "3904:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 90, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3904:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3903:6:0" + }, + "scope": 131, + "src": "3799:434:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "921:3315:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 132, + "name": "DeviceBase", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 131, + "src": "4330:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_DeviceBase_$131", + "typeString": "contract DeviceBase" + } + }, + "id": 133, + "nodeType": "InheritanceSpecifier", + "src": "4330:10:0" + } + ], + "contractDependencies": [ + 131 + ], + "contractKind": "contract", + "documentation": "@title Provides extra functionalities for devices.", + "fullyImplemented": true, + "id": 284, + "linearizedBaseContracts": [ + 284, + 131 + ], + "name": "DeviceHelper", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 189, + "nodeType": "Block", + "src": "4710:330:0", + "statements": [ + { + "assignments": [ + 144 + ], + "declarations": [ + { + "constant": false, + "id": 144, + "name": "deviceIds", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "4721:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 142, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4721:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 143, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4721:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 152, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 148, + "name": "ownerDeviceCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4758:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 150, + "indexExpression": { + "argumentTypes": null, + "id": 149, + "name": "_owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4775:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4758:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "4747:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 145, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4751:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 146, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4751:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4747:36:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4721:62:0" + }, + { + "assignments": [ + 154 + ], + "declarations": [ + { + "constant": false, + "id": 154, + "name": "counter", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "4794:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 153, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4794:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 156, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4809:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "4794:16:0" + }, + { + "body": { + "id": 185, + "nodeType": "Block", + "src": "4863:143:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 168, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "4882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 170, + "indexExpression": { + "argumentTypes": null, + "id": 169, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "4890:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4882:10:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "4882:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 172, + "name": "_owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4902:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4882:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 184, + "nodeType": "IfStatement", + "src": "4878:117:0", + "trueBody": { + "id": 183, + "nodeType": "Block", + "src": "4910:85:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 174, + "name": "deviceIds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4929:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 176, + "indexExpression": { + "argumentTypes": null, + "id": 175, + "name": "counter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 154, + "src": "4939:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "4929:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 177, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "4950:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4929:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 179, + "nodeType": "ExpressionStatement", + "src": "4929:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "4970:9:0", + "subExpression": { + "argumentTypes": null, + "id": 180, + "name": "counter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 154, + "src": "4970:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 182, + "nodeType": "ExpressionStatement", + "src": "4970:9:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 164, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 161, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "4838:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 162, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "4842:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 163, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4842:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4838:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 186, + "initializationExpression": { + "assignments": [ + 158 + ], + "declarations": [ + { + "constant": false, + "id": 158, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 186, + "src": "4826:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 157, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4826:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 160, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4835:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "4826:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "4858:3:0", + "subExpression": { + "argumentTypes": null, + "id": 165, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "4858:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 167, + "nodeType": "ExpressionStatement", + "src": "4858:3:0" + }, + "nodeType": "ForStatement", + "src": "4821:185:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 187, + "name": "deviceIds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "5023:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "functionReturnParameters": 140, + "id": 188, + "nodeType": "Return", + "src": "5016:16:0" + } + ] + }, + "documentation": "@notice Gets all devices owned by specified address. \n@dev Use this function instead of filtering DeviceCreated event since devices could have been transferred between owners.\n@param _owner Owner address.\n@return Array of device IDs.", + "id": 190, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDevicesByOwner", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 136, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 135, + "name": "_owner", + "nodeType": "VariableDeclaration", + "scope": 190, + "src": "4658:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 134, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4658:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4657:16:0" + }, + "returnParameters": { + "id": 140, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 139, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 190, + "src": "4695:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 137, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4695:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 138, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4695:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4694:15:0" + }, + "scope": 284, + "src": "4631:409:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 213, + "nodeType": "Block", + "src": "5262:110:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 197, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "5280:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 199, + "indexExpression": { + "argumentTypes": null, + "id": 198, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "5288:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5280:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 200, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "5280:24:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 204, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "5332:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 206, + "indexExpression": { + "argumentTypes": null, + "id": 205, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "5340:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5332:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 207, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "identifier", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "5332:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 203, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5324:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5324:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5316:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": "uint160" + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5316:47:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5308:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5308:56:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "5280:84:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 196, + "id": 212, + "nodeType": "Return", + "src": "5273:91:0" + } + ] + }, + "documentation": "@notice Checks if device is also an entity. \n@param _deviceId ID of a device.\n@return Boolean status.", + "id": 214, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isDeviceAnEntity", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 192, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 214, + "src": "5219:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 191, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5219:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5218:16:0" + }, + "returnParameters": { + "id": 196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 195, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 214, + "src": "5256:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 194, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5255:6:0" + }, + "scope": 284, + "src": "5193:179:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 236, + "nodeType": "Block", + "src": "5945:97:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 228, + "name": "_proof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "5987:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", + "typeString": "bytes32[] memory" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 229, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "5995:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 231, + "indexExpression": { + "argumentTypes": null, + "id": 230, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 216, + "src": "6003:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5995:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 232, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "metadataHash", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "5995:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 233, + "name": "_leaf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 221, + "src": "6028:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", + "typeString": "bytes32[] memory" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 226, + "name": "MerkleProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 796, + "src": "5963:11:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_MerkleProof_$796_$", + "typeString": "type(library MerkleProof)" + } + }, + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "verifyProof", + "nodeType": "MemberAccess", + "referencedDeclaration": 795, + "src": "5963:23:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_array$_t_bytes32_$dyn_memory_ptr_$_t_bytes32_$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32[] memory,bytes32,bytes32) pure returns (bool)" + } + }, + "id": 234, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5963:71:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 225, + "id": 235, + "nodeType": "Return", + "src": "5956:78:0" + } + ] + }, + "documentation": "@notice Checks if provided leaf is a member of metadata contained in Merkle tree. \nAssumes that each pair of leaves and each pair of pre-images are sorted.\n@param _deviceId ID of a device containing metadata hash.\n@param _proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree.\n@param _leaf Leaf of Merkle tree.\n@return Boolean status.", + "id": 237, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isValidMetadataMember", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 222, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 216, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 237, + "src": "5862:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 215, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5862:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 219, + "name": "_proof", + "nodeType": "VariableDeclaration", + "scope": 237, + "src": "5878:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", + "typeString": "bytes32[]" + }, + "typeName": { + "baseType": { + "id": 217, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5878:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 218, + "length": null, + "nodeType": "ArrayTypeName", + "src": "5878:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", + "typeString": "bytes32[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 221, + "name": "_leaf", + "nodeType": "VariableDeclaration", + "scope": 237, + "src": "5903:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 220, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5903:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5861:56:0" + }, + "returnParameters": { + "id": 225, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 224, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 237, + "src": "5939:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 223, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5939:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5938:6:0" + }, + "scope": 284, + "src": "5831:211:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 253, + "nodeType": "Block", + "src": "6420:74:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 251, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 246, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "6438:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 248, + "indexExpression": { + "argumentTypes": null, + "id": 247, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 239, + "src": "6446:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6438:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 249, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "firmwareHash", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "6438:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 250, + "name": "_firmwareHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 241, + "src": "6473:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "6438:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 245, + "id": 252, + "nodeType": "Return", + "src": "6431:55:0" + } + ] + }, + "documentation": "@notice Checks if provided firmware hash is equal to firmware hash device property. \n@param _deviceId ID of a device containing firmware hash.\n@param _firmwareHash Firmware hash (not the actual hash).\n@return Boolean status.", + "id": 254, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isValidFirmwareHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 242, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 239, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 254, + "src": "6354:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 238, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6354:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 241, + "name": "_firmwareHash", + "nodeType": "VariableDeclaration", + "scope": 254, + "src": "6370:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 240, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6370:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6353:39:0" + }, + "returnParameters": { + "id": 245, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 244, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 254, + "src": "6414:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 243, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6414:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6413:6:0" + }, + "scope": 284, + "src": "6325:169:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 282, + "nodeType": "Block", + "src": "7010:130:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 267, + "name": "_messageHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "7047:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 268, + "name": "_signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 260, + "src": "7061:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "argumentTypes": null, + "id": 265, + "name": "ECRecovery", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 727, + "src": "7028:10:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ECRecovery_$727_$", + "typeString": "type(library ECRecovery)" + } + }, + "id": 266, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "recover", + "nodeType": "MemberAccess", + "referencedDeclaration": 710, + "src": "7028:18:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes32,bytes memory) pure returns (address)" + } + }, + "id": 269, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7028:44:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 273, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "7100:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 275, + "indexExpression": { + "argumentTypes": null, + "id": 274, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 256, + "src": "7108:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7100:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 276, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "identifier", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "7100:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 272, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7092:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7092:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7084:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": "uint160" + }, + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7084:47:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7076:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7076:56:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "7028:104:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 264, + "id": 281, + "nodeType": "Return", + "src": "7021:111:0" + } + ] + }, + "documentation": "@notice Validate authenticity of message signed by Etherium private key.\nOn-chain validation is available only for Ethereum signed messages.\n@param _deviceId ID of a device that signed the message.\n@param _messageHash Hash of sent message.\n@param _signature Signature generated using web3.eth.sign().\n@return Boolean status.", + "id": 283, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isValidEthMessage", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 261, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 256, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 283, + "src": "6920:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 255, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6920:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 258, + "name": "_messageHash", + "nodeType": "VariableDeclaration", + "scope": 283, + "src": "6936:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 257, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6936:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 260, + "name": "_signature", + "nodeType": "VariableDeclaration", + "scope": 283, + "src": "6958:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 259, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6958:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6919:63:0" + }, + "returnParameters": { + "id": 264, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 263, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 283, + "src": "7004:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 262, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7004:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7003:6:0" + }, + "scope": 284, + "src": "6893:247:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "4305:2838:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for signatures.", + "fullyImplemented": true, + "id": 427, + "linearizedBaseContracts": [ + 427 + ], + "name": "SignatureBase", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "SignatureBase.Signature", + "id": 293, + "members": [ + { + "constant": false, + "id": 286, + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 293, + "src": "7359:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 285, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7359:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 288, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 293, + "src": "7420:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 287, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7420:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 290, + "name": "expiryTime", + "nodeType": "VariableDeclaration", + "scope": 293, + "src": "7522:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 289, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7522:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 292, + "name": "revoked", + "nodeType": "VariableDeclaration", + "scope": 293, + "src": "7619:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 291, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7619:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Signature", + "nodeType": "StructDefinition", + "scope": 427, + "src": "7287:352:0", + "visibility": "public" + }, + { + "constant": false, + "id": 296, + "name": "signatures", + "nodeType": "VariableDeclaration", + "scope": 427, + "src": "7800:29:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature[]" + }, + "typeName": { + "baseType": { + "contractScope": null, + "id": 294, + "name": "Signature", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 293, + "src": "7800:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature" + } + }, + "id": 295, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7800:11:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage_ptr", + "typeString": "struct SignatureBase.Signature[]" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 300, + "name": "deviceSignatureCount", + "nodeType": "VariableDeclaration", + "scope": 427, + "src": "7904:50:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + }, + "typeName": { + "id": 299, + "keyType": { + "id": 297, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7913:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "7904:22:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + }, + "valueType": { + "id": 298, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7921:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "anonymous": false, + "documentation": "@dev Fired when an address signs a device.", + "id": 310, + "name": "DeviceSigned", + "nodeType": "EventDefinition", + "parameters": { + "id": 309, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 302, + "indexed": true, + "name": "signatureId", + "nodeType": "VariableDeclaration", + "scope": 310, + "src": "8038:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 301, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8038:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 304, + "indexed": true, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 310, + "src": "8064:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 303, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8064:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 306, + "indexed": true, + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 310, + "src": "8087:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 305, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8087:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 308, + "indexed": false, + "name": "expiryTime", + "nodeType": "VariableDeclaration", + "scope": 310, + "src": "8111:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 307, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8111:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8037:90:0" + }, + "src": "8019:109:0" + }, + { + "anonymous": false, + "documentation": "@dev Fired when signature is revoked.", + "id": 316, + "name": "SignatureRevoked", + "nodeType": "EventDefinition", + "parameters": { + "id": 315, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 312, + "indexed": true, + "name": "signatureId", + "nodeType": "VariableDeclaration", + "scope": 316, + "src": "8206:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 311, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8206:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 314, + "indexed": true, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 316, + "src": "8232:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 313, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8232:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8205:49:0" + }, + "src": "8183:72:0" + }, + { + "body": { + "id": 330, + "nodeType": "Block", + "src": "8378:98:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 325, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 321, + "name": "deviceSignatureCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "8397:20:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + } + }, + "id": 323, + "indexExpression": { + "argumentTypes": null, + "id": 322, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 318, + "src": "8418:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8397:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 324, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8432:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8397:36:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4d757374206e6f74206265207369676e6564", + "id": 326, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8435:20:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_73fc55a17986bff1b99557baa412a11f76b8a2a98ee4458c73a848ffe7b97e84", + "typeString": "literal_string \"Must not be signed\"" + }, + "value": "Must not be signed" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_73fc55a17986bff1b99557baa412a11f76b8a2a98ee4458c73a848ffe7b97e84", + "typeString": "literal_string \"Must not be signed\"" + } + ], + "id": 320, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "src": "8389:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 327, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8389:67:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 328, + "nodeType": "ExpressionStatement", + "src": "8389:67:0" + }, + { + "id": 329, + "nodeType": "PlaceholderStatement", + "src": "8467:1:0" + } + ] + }, + "documentation": "@dev Modifier for ensuring that the device hasn't been signed already.", + "id": 331, + "name": "notSigned", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 319, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 318, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 331, + "src": "8362:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 317, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8362:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8361:16:0" + }, + "src": "8343:133:0", + "visibility": "internal" + }, + { + "body": { + "id": 374, + "nodeType": "Block", + "src": "8804:312:0", + "statements": [ + { + "assignments": [ + 341 + ], + "declarations": [ + { + "constant": false, + "id": 341, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "8815:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_memory_ptr", + "typeString": "struct SignatureBase.Signature" + }, + "typeName": { + "contractScope": null, + "id": 340, + "name": "Signature", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 293, + "src": "8815:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 349, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 343, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "8854:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8854:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 345, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 333, + "src": "8866:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 346, + "name": "_expiryTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 335, + "src": "8877:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 347, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8890:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 342, + "name": "Signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 293, + "src": "8844:9:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Signature_$293_storage_ptr_$", + "typeString": "type(struct SignatureBase.Signature storage pointer)" + } + }, + "id": 348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8844:52:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_memory", + "typeString": "struct SignatureBase.Signature memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8815:81:0" + }, + { + "assignments": [ + 351 + ], + "declarations": [ + { + "constant": false, + "id": 351, + "name": "signatureId", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "8907:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 350, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8907:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 358, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 354, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 341, + "src": "8942:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_memory_ptr", + "typeString": "struct SignatureBase.Signature memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Signature_$293_memory_ptr", + "typeString": "struct SignatureBase.Signature memory" + } + ], + "expression": { + "argumentTypes": null, + "id": 352, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "8926:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8926:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_Signature_$293_storage_$returns$_t_uint256_$", + "typeString": "function (struct SignatureBase.Signature storage ref) returns (uint256)" + } + }, + "id": 355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8926:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 356, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8955:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8926:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8907:49:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "8967:33:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 359, + "name": "deviceSignatureCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "8967:20:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + } + }, + "id": 361, + "indexExpression": { + "argumentTypes": null, + "id": 360, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 333, + "src": "8988:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8967:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 363, + "nodeType": "ExpressionStatement", + "src": "8967:33:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 365, + "name": "signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 351, + "src": "9031:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 366, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 333, + "src": "9044:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 367, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "9055:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9055:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 369, + "name": "_expiryTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 335, + "src": "9067:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 364, + "name": "DeviceSigned", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 310, + "src": "9018:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,address,uint256)" + } + }, + "id": 370, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9018:61:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 371, + "nodeType": "EmitStatement", + "src": "9013:66:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 372, + "name": "signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 351, + "src": "9097:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 339, + "id": 373, + "nodeType": "Return", + "src": "9090:18:0" + } + ] + }, + "documentation": "@notice Signs a device and signature into storage. Emits DeviceSigned. \n@param _deviceId ID of to be signed device.\n@param _expiryTime Expiry time in Unix seconds.\n@return Created signature ID.", + "id": 375, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "signDevice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 336, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 333, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 375, + "src": "8748:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 332, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8748:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 335, + "name": "_expiryTime", + "nodeType": "VariableDeclaration", + "scope": 375, + "src": "8764:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 334, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8764:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8747:34:0" + }, + "returnParameters": { + "id": 339, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 338, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 375, + "src": "8798:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 337, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8798:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8797:6:0" + }, + "scope": 427, + "src": "8728:388:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 425, + "nodeType": "Block", + "src": "9314:432:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 381, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "9333:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 383, + "indexExpression": { + "argumentTypes": null, + "id": 382, + "name": "_signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 377, + "src": "9344:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9333:24:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage", + "typeString": "struct SignatureBase.Signature storage ref" + } + }, + "id": 384, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "signer", + "nodeType": "MemberAccess", + "referencedDeclaration": 286, + "src": "9333:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 385, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "9368:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9368:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "9333:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4f6e6c7920666f722063726561746f72206f6620746865207369676e6174757265", + "id": 388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9380:35:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3aaaa87a777306387460c3ec7c037c21271b7d2e0f37fa494722618006dc0cdb", + "typeString": "literal_string \"Only for creator of the signature\"" + }, + "value": "Only for creator of the signature" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3aaaa87a777306387460c3ec7c037c21271b7d2e0f37fa494722618006dc0cdb", + "typeString": "literal_string \"Only for creator of the signature\"" + } + ], + "id": 380, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "src": "9325:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9325:91:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 390, + "nodeType": "ExpressionStatement", + "src": "9325:91:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 397, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 392, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "9435:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 394, + "indexExpression": { + "argumentTypes": null, + "id": 393, + "name": "_signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 377, + "src": "9446:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9435:24:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage", + "typeString": "struct SignatureBase.Signature storage ref" + } + }, + "id": 395, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "revoked", + "nodeType": "MemberAccess", + "referencedDeclaration": 292, + "src": "9435:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 396, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9471:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "9435:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "5369676e6174757265206d7573746e2774206265207265766f6b656420616c7265616479", + "id": 398, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9478:38:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e22c32ac6c26626aeef51dc165bb8bcbe4c9684fc645b2cda8fe482fe7423f3d", + "typeString": "literal_string \"Signature mustn't be revoked already\"" + }, + "value": "Signature mustn't be revoked already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e22c32ac6c26626aeef51dc165bb8bcbe4c9684fc645b2cda8fe482fe7423f3d", + "typeString": "literal_string \"Signature mustn't be revoked already\"" + } + ], + "id": 391, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "src": "9427:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 399, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9427:90:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 400, + "nodeType": "ExpressionStatement", + "src": "9427:90:0" + }, + { + "assignments": [ + 402 + ], + "declarations": [ + { + "constant": false, + "id": 402, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 425, + "src": "9528:27:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature" + }, + "typeName": { + "contractScope": null, + "id": 401, + "name": "Signature", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 293, + "src": "9528:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 406, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 403, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "9558:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 405, + "indexExpression": { + "argumentTypes": null, + "id": 404, + "name": "_signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 377, + "src": "9569:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9558:24:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage", + "typeString": "struct SignatureBase.Signature storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9528:54:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 407, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 402, + "src": "9593:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature storage pointer" + } + }, + "id": 409, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "revoked", + "nodeType": "MemberAccess", + "referencedDeclaration": 292, + "src": "9593:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 410, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9613:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "9593:24:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "9593:24:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 417, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "9628:42:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 413, + "name": "deviceSignatureCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "9628:20:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + } + }, + "id": 416, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 414, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 402, + "src": "9649:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature storage pointer" + } + }, + "id": 415, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "deviceId", + "nodeType": "MemberAccess", + "referencedDeclaration": 288, + "src": "9649:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "9628:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 418, + "nodeType": "ExpressionStatement", + "src": "9628:42:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 420, + "name": "_signatureId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 377, + "src": "9705:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 421, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 402, + "src": "9719:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage_ptr", + "typeString": "struct SignatureBase.Signature storage pointer" + } + }, + "id": 422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "deviceId", + "nodeType": "MemberAccess", + "referencedDeclaration": 288, + "src": "9719:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 419, + "name": "SignatureRevoked", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 316, + "src": "9688:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9688:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 424, + "nodeType": "EmitStatement", + "src": "9683:55:0" + } + ] + }, + "documentation": "@notice Revokes a signature. Emits SignatureRevoked. \n@param _signatureId ID of to be revoked signature.", + "id": 426, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "revokeSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 378, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 377, + "name": "_signatureId", + "nodeType": "VariableDeclaration", + "scope": 426, + "src": "9288:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 376, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9288:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9287:19:0" + }, + "returnParameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [], + "src": "9314:0:0" + }, + "scope": 427, + "src": "9263:483:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "7214:2535:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 428, + "name": "SignatureBase", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 427, + "src": "9849:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureBase_$427", + "typeString": "contract SignatureBase" + } + }, + "id": 429, + "nodeType": "InheritanceSpecifier", + "src": "9849:13:0" + } + ], + "contractDependencies": [ + 427 + ], + "contractKind": "contract", + "documentation": "@title Provides extra functionalities for signatures.", + "fullyImplemented": true, + "id": 494, + "linearizedBaseContracts": [ + 494, + 427 + ], + "name": "SignatureHelper", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 492, + "nodeType": "Block", + "src": "10230:392:0", + "statements": [ + { + "assignments": [ + 440 + ], + "declarations": [ + { + "constant": false, + "id": 440, + "name": "signatureIds", + "nodeType": "VariableDeclaration", + "scope": 492, + "src": "10241:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 438, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10241:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 439, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10241:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 448, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 444, + "name": "deviceSignatureCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "10281:20:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", + "typeString": "mapping(uint256 => uint256)" + } + }, + "id": 446, + "indexExpression": { + "argumentTypes": null, + "id": 445, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 431, + "src": "10302:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10281:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "10270:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 441, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10274:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 442, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10274:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10270:43:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10241:72:0" + }, + { + "assignments": [ + 450 + ], + "declarations": [ + { + "constant": false, + "id": 450, + "name": "counter", + "nodeType": "VariableDeclaration", + "scope": 492, + "src": "10324:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 449, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10324:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 452, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 451, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10339:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "10324:16:0" + }, + { + "body": { + "id": 488, + "nodeType": "Block", + "src": "10396:189:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 464, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "10415:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 466, + "indexExpression": { + "argumentTypes": null, + "id": 465, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 454, + "src": "10426:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10415:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage", + "typeString": "struct SignatureBase.Signature storage ref" + } + }, + "id": 467, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "deviceId", + "nodeType": "MemberAccess", + "referencedDeclaration": 288, + "src": "10415:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 468, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 431, + "src": "10441:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10415:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 470, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "10454:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 472, + "indexExpression": { + "argumentTypes": null, + "id": 471, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 454, + "src": "10465:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10454:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Signature_$293_storage", + "typeString": "struct SignatureBase.Signature storage ref" + } + }, + "id": 473, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "revoked", + "nodeType": "MemberAccess", + "referencedDeclaration": 292, + "src": "10454:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 474, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10479:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "10454:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "10415:69:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 487, + "nodeType": "IfStatement", + "src": "10411:163:0", + "trueBody": { + "id": 486, + "nodeType": "Block", + "src": "10486:88:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 477, + "name": "signatureIds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 440, + "src": "10505:12:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 479, + "indexExpression": { + "argumentTypes": null, + "id": 478, + "name": "counter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 450, + "src": "10518:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10505:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 480, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 454, + "src": "10529:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10505:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 482, + "nodeType": "ExpressionStatement", + "src": "10505:25:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 484, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10549:9:0", + "subExpression": { + "argumentTypes": null, + "id": 483, + "name": "counter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 450, + "src": "10549:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 485, + "nodeType": "ExpressionStatement", + "src": "10549:9:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 460, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 457, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 454, + "src": "10368:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 458, + "name": "signatures", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "10372:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Signature_$293_storage_$dyn_storage", + "typeString": "struct SignatureBase.Signature storage ref[] storage ref" + } + }, + "id": 459, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10372:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10368:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 489, + "initializationExpression": { + "assignments": [ + 454 + ], + "declarations": [ + { + "constant": false, + "id": 454, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 489, + "src": "10356:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 453, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10356:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 456, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 455, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10365:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "10356:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 462, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10391:3:0", + "subExpression": { + "argumentTypes": null, + "id": 461, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 454, + "src": "10391:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 463, + "nodeType": "ExpressionStatement", + "src": "10391:3:0" + }, + "nodeType": "ForStatement", + "src": "10351:234:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 490, + "name": "signatureIds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 440, + "src": "10602:12:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "functionReturnParameters": 436, + "id": 491, + "nodeType": "Return", + "src": "10595:19:0" + } + ] + }, + "documentation": "@notice Gets all signatures for specific device. \n@dev Use this function instead of filtering DeviceSigned event since signatures could have been revoked.\n@param _deviceId ID of a device.\n@return Array of signature IDs.", + "id": 493, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getActiveSignaturesForDevice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 432, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 431, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 493, + "src": "10178:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 430, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10178:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10177:16:0" + }, + "returnParameters": { + "id": 436, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 435, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 493, + "src": "10215:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 433, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10215:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 434, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10215:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10214:15:0" + }, + "scope": 494, + "src": "10140:482:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "9821:804:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 495, + "name": "DeviceHelper", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 284, + "src": "10756:12:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_DeviceHelper_$284", + "typeString": "contract DeviceHelper" + } + }, + "id": 496, + "nodeType": "InheritanceSpecifier", + "src": "10756:12:0" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 497, + "name": "SignatureHelper", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 494, + "src": "10770:15:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureHelper_$494", + "typeString": "contract SignatureHelper" + } + }, + "id": 498, + "nodeType": "InheritanceSpecifier", + "src": "10770:15:0" + } + ], + "contractDependencies": [ + 131, + 284, + 427, + 494 + ], + "contractKind": "contract", + "documentation": "@title Enriches devices giving them option to be updated only if not signed already.", + "fullyImplemented": true, + "id": 641, + "linearizedBaseContracts": [ + 641, + 494, + 427, + 284, + 131 + ], + "name": "DeviceUpdatable", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": "@dev Fired on device ownership transfer, keeps track of historical device owners.", + "id": 506, + "name": "DeviceTransfered", + "nodeType": "EventDefinition", + "parameters": { + "id": 505, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 500, + "indexed": true, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 506, + "src": "10907:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 499, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10907:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 502, + "indexed": false, + "name": "oldOwner", + "nodeType": "VariableDeclaration", + "scope": 506, + "src": "10930:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 501, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10930:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 504, + "indexed": false, + "name": "newOwner", + "nodeType": "VariableDeclaration", + "scope": 506, + "src": "10948:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 503, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10948:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10906:59:0" + }, + "src": "10884:82:0" + }, + { + "anonymous": false, + "documentation": "@dev Fired on device property update, keeps track of historical property values.", + "id": 514, + "name": "DevicePropertyUpdated", + "nodeType": "EventDefinition", + "parameters": { + "id": 513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 508, + "indexed": true, + "name": "deviceId", + "nodeType": "VariableDeclaration", + "scope": 514, + "src": "11096:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 507, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11096:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 510, + "indexed": true, + "name": "property", + "nodeType": "VariableDeclaration", + "scope": 514, + "src": "11119:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 509, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11119:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 512, + "indexed": false, + "name": "newValue", + "nodeType": "VariableDeclaration", + "scope": 514, + "src": "11145:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 511, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11145:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11095:67:0" + }, + "src": "11068:95:0" + }, + { + "body": { + "id": 558, + "nodeType": "Block", + "src": "11494:246:0", + "statements": [ + { + "assignments": [ + 528 + ], + "declarations": [ + { + "constant": false, + "id": 528, + "name": "currentOwner", + "nodeType": "VariableDeclaration", + "scope": 558, + "src": "11505:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 527, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11505:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 533, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 529, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "11528:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 531, + "indexExpression": { + "argumentTypes": null, + "id": 530, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "11536:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11528:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 532, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "11528:24:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11505:47:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 539, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 534, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "11563:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 536, + "indexExpression": { + "argumentTypes": null, + "id": 535, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "11571:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11563:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 537, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "11563:24:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 538, + "name": "_to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "11590:3:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "11563:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 540, + "nodeType": "ExpressionStatement", + "src": "11563:30:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "11604:30:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 541, + "name": "ownerDeviceCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "11604:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 544, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 542, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 868, + "src": "11621:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 543, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11621:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11604:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 546, + "nodeType": "ExpressionStatement", + "src": "11604:30:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11645:23:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 547, + "name": "ownerDeviceCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "11645:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 549, + "indexExpression": { + "argumentTypes": null, + "id": 548, + "name": "_to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "11662:3:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11645:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 551, + "nodeType": "ExpressionStatement", + "src": "11645:23:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 553, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "11703:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 554, + "name": "currentOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 528, + "src": "11714:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 555, + "name": "_to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "11728:3:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 552, + "name": "DeviceTransfered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 506, + "src": "11686:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_address_$_t_address_$returns$__$", + "typeString": "function (uint256,address,address)" + } + }, + "id": 556, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11686:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 557, + "nodeType": "EmitStatement", + "src": "11681:51:0" + } + ] + }, + "documentation": "@notice Transfer device ownership from one external account to another. Emits DeviceTransfered.\n@param _deviceId ID of to be transfered device.\n@param _to Address of new owner.", + "id": 559, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 521, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "11462:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 522, + "modifierName": { + "argumentTypes": null, + "id": 520, + "name": "onlyOwnerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 82, + "src": "11450:11:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "11450:22:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 524, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "11483:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 525, + "modifierName": { + "argumentTypes": null, + "id": 523, + "name": "notSigned", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 331, + "src": "11473:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "11473:20:0" + } + ], + "name": "transferDevice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 519, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 516, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 559, + "src": "11414:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 515, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11414:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 518, + "name": "_to", + "nodeType": "VariableDeclaration", + "scope": 559, + "src": "11430:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 517, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11430:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11413:29:0" + }, + "returnParameters": { + "id": 526, + "nodeType": "ParameterList", + "parameters": [], + "src": "11494:0:0" + }, + "scope": 641, + "src": "11390:350:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 585, + "nodeType": "Block", + "src": "12051:145:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 577, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 572, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "12062:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 574, + "indexExpression": { + "argumentTypes": null, + "id": 573, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "12070:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12062:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 575, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "identifier", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "12062:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 576, + "name": "_newIdentifier", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 563, + "src": "12094:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "12062:46:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 578, + "nodeType": "ExpressionStatement", + "src": "12062:46:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 580, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "12148:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "6964656e746966696572", + "id": 581, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12159:12:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c9c8fb0ee362b7a8868ca48cc94ee58e323adab92aeaba9c12b8aa7dca5fe466", + "typeString": "literal_string \"identifier\"" + }, + "value": "identifier" + }, + { + "argumentTypes": null, + "id": 582, + "name": "_newIdentifier", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 563, + "src": "12173:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_c9c8fb0ee362b7a8868ca48cc94ee58e323adab92aeaba9c12b8aa7dca5fe466", + "typeString": "literal_string \"identifier\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 579, + "name": "DevicePropertyUpdated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "12126:21:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_bytes32_$returns$__$", + "typeString": "function (uint256,bytes32,bytes32)" + } + }, + "id": 583, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12126:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 584, + "nodeType": "EmitStatement", + "src": "12121:67:0" + } + ] + }, + "documentation": "@notice Update device with new identifier. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newIdentifier New identifier.", + "id": 586, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 566, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "12019:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 567, + "modifierName": { + "argumentTypes": null, + "id": 565, + "name": "onlyOwnerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 82, + "src": "12007:11:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12007:22:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 569, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "12040:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 570, + "modifierName": { + "argumentTypes": null, + "id": 568, + "name": "notSigned", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 331, + "src": "12030:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12030:20:0" + } + ], + "name": "updateIdentifier", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 564, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 561, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 586, + "src": "11960:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 560, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11960:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 563, + "name": "_newIdentifier", + "nodeType": "VariableDeclaration", + "scope": 586, + "src": "11976:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 562, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11976:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11959:40:0" + }, + "returnParameters": { + "id": 571, + "nodeType": "ParameterList", + "parameters": [], + "src": "12051:0:0" + }, + "scope": 641, + "src": "11934:262:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 612, + "nodeType": "Block", + "src": "12518:149:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 604, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 599, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "12529:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 601, + "indexExpression": { + "argumentTypes": null, + "id": 600, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "12537:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12529:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 602, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "metadataHash", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "12529:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 603, + "name": "_newMetadataHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 590, + "src": "12563:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "12529:50:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 605, + "nodeType": "ExpressionStatement", + "src": "12529:50:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 607, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "12619:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "6d65746164617461", + "id": 608, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12630:10:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7a9d3a032b8ff274f09714b56ba8e5ed776ec9638ca303069bc3a3267bb22f65", + "typeString": "literal_string \"metadata\"" + }, + "value": "metadata" + }, + { + "argumentTypes": null, + "id": 609, + "name": "_newMetadataHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 590, + "src": "12642:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_7a9d3a032b8ff274f09714b56ba8e5ed776ec9638ca303069bc3a3267bb22f65", + "typeString": "literal_string \"metadata\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 606, + "name": "DevicePropertyUpdated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "12597:21:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_bytes32_$returns$__$", + "typeString": "function (uint256,bytes32,bytes32)" + } + }, + "id": 610, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12597:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 611, + "nodeType": "EmitStatement", + "src": "12592:67:0" + } + ] + }, + "documentation": "@notice Update device with new metadata hash. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newMetadataHash New metadata hash.", + "id": 613, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 593, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "12486:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 594, + "modifierName": { + "argumentTypes": null, + "id": 592, + "name": "onlyOwnerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 82, + "src": "12474:11:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12474:22:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 596, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "12507:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 597, + "modifierName": { + "argumentTypes": null, + "id": 595, + "name": "notSigned", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 331, + "src": "12497:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12497:20:0" + } + ], + "name": "updateMetadataHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 591, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 588, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 613, + "src": "12425:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 587, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12425:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 590, + "name": "_newMetadataHash", + "nodeType": "VariableDeclaration", + "scope": 613, + "src": "12441:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 589, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12441:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12424:42:0" + }, + "returnParameters": { + "id": 598, + "nodeType": "ParameterList", + "parameters": [], + "src": "12518:0:0" + }, + "scope": 641, + "src": "12397:270:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 639, + "nodeType": "Block", + "src": "12989:149:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 626, + "name": "devices", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 49, + "src": "13000:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_Device_$46_storage_$dyn_storage", + "typeString": "struct DeviceBase.Device storage ref[] storage ref" + } + }, + "id": 628, + "indexExpression": { + "argumentTypes": null, + "id": 627, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 615, + "src": "13008:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13000:18:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Device_$46_storage", + "typeString": "struct DeviceBase.Device storage ref" + } + }, + "id": 629, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "firmwareHash", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "13000:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 630, + "name": "_newFirmwareHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 617, + "src": "13034:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "13000:50:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 632, + "nodeType": "ExpressionStatement", + "src": "13000:50:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 634, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 615, + "src": "13090:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "6669726d77617265", + "id": 635, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13101:10:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_99ae24b5e16982fa6bd82ac48369a10e6c7145bd48234d69ccfd0f110eb2e630", + "typeString": "literal_string \"firmware\"" + }, + "value": "firmware" + }, + { + "argumentTypes": null, + "id": 636, + "name": "_newFirmwareHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 617, + "src": "13113:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_99ae24b5e16982fa6bd82ac48369a10e6c7145bd48234d69ccfd0f110eb2e630", + "typeString": "literal_string \"firmware\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 633, + "name": "DevicePropertyUpdated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "13068:21:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_bytes32_$returns$__$", + "typeString": "function (uint256,bytes32,bytes32)" + } + }, + "id": 637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13068:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 638, + "nodeType": "EmitStatement", + "src": "13063:67:0" + } + ] + }, + "documentation": "@notice Update device with new firmware hash. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newFirmwareHash New firmware hash.", + "id": 640, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 620, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 615, + "src": "12957:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 621, + "modifierName": { + "argumentTypes": null, + "id": 619, + "name": "onlyOwnerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 82, + "src": "12945:11:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12945:22:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 623, + "name": "_deviceId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 615, + "src": "12978:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 624, + "modifierName": { + "argumentTypes": null, + "id": 622, + "name": "notSigned", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 331, + "src": "12968:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "12968:20:0" + } + ], + "name": "updateFirmwareHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 618, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 615, + "name": "_deviceId", + "nodeType": "VariableDeclaration", + "scope": 640, + "src": "12896:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 614, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12896:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 617, + "name": "_newFirmwareHash", + "nodeType": "VariableDeclaration", + "scope": 640, + "src": "12912:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 616, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12912:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12895:42:0" + }, + "returnParameters": { + "id": 625, + "nodeType": "ParameterList", + "parameters": [], + "src": "12989:0:0" + }, + "scope": 641, + "src": "12868:270:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 647, + "src": "10728:2413:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 642, + "name": "EntityBase", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 37, + "src": "13213:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_EntityBase_$37", + "typeString": "contract EntityBase" + } + }, + "id": 643, + "nodeType": "InheritanceSpecifier", + "src": "13213:10:0" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 644, + "name": "DeviceUpdatable", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 641, + "src": "13225:15:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_DeviceUpdatable_$641", + "typeString": "contract DeviceUpdatable" + } + }, + "id": 645, + "nodeType": "InheritanceSpecifier", + "src": "13225:15:0" + } + ], + "contractDependencies": [ + 37, + 131, + 284, + 427, + 494, + 641 + ], + "contractKind": "contract", + "documentation": "@title Device manager core contract.", + "fullyImplemented": true, + "id": 646, + "linearizedBaseContracts": [ + 646, + 641, + 494, + 427, + 284, + 131, + 37 + ], + "name": "DeviceManager", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 647, + "src": "13187:90:0" + } + ], + "src": "0:13279:0" + }, + "legacyAST": { + "attributes": { + "absolutePath": "project:/contracts/DeviceManager.sol", + "exportedSymbols": { + "DeviceBase": [ + 131 + ], + "DeviceHelper": [ + 284 + ], + "DeviceManager": [ + 646 + ], + "DeviceUpdatable": [ + 641 + ], + "EntityBase": [ + 37 + ], + "SignatureBase": [ + 427 + ], + "SignatureHelper": [ + 494 + ] + } + }, + "children": [ + { + "attributes": { + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ] + }, + "id": 1, + "name": "PragmaDirective", + "src": "0:23:0" + }, + { + "attributes": { + "SourceUnit": 797, + "absolutePath": "project:/contracts/MerkleProof.sol", + "file": "./MerkleProof.sol", + "scope": 647, + "symbolAliases": [ + null + ], + "unitAlias": "" + }, + "id": 2, + "name": "ImportDirective", + "src": "27:27:0" + }, + { + "attributes": { + "SourceUnit": 728, + "absolutePath": "project:/contracts/ECRecovery.sol", + "file": "./ECRecovery.sol", + "scope": 647, + "symbolAliases": [ + null + ], + "unitAlias": "" + }, + "id": 3, + "name": "ImportDirective", + "src": "56:26:0" + }, + { + "attributes": { + "baseContracts": [ + null + ], + "contractDependencies": [ + null + ], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for entities.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 37 + ], + "name": "EntityBase", + "scope": 647 + }, + "children": [ + { + "attributes": { + "canonicalName": "EntityBase.Entity", + "name": "Entity", + "scope": 37, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "data", + "scope": 6, + "stateVariable": false, + "storageLocation": "default", + "type": "string", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string" + }, + "id": 4, + "name": "ElementaryTypeName", + "src": "347:6:0" + } + ], + "id": 5, + "name": "VariableDeclaration", + "src": "347:11:0" + } + ], + "id": 6, + "name": "StructDefinition", + "src": "232:134:0" + }, + { + "attributes": { + "constant": false, + "name": "ownerToEntity", + "scope": 37, + "stateVariable": true, + "storageLocation": "default", + "type": "mapping(address => struct EntityBase.Entity)", + "value": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "type": "mapping(address => struct EntityBase.Entity)" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 7, + "name": "ElementaryTypeName", + "src": "435:7:0" + }, + { + "attributes": { + "contractScope": null, + "name": "Entity", + "referencedDeclaration": 6, + "type": "struct EntityBase.Entity" + }, + "id": 8, + "name": "UserDefinedTypeName", + "src": "446:6:0" + } + ], + "id": 9, + "name": "Mapping", + "src": "426:27:0" + } + ], + "id": 10, + "name": "VariableDeclaration", + "src": "426:48:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired on entity data update.", + "name": "EntityDataUpdated" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "owner", + "scope": 16, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 11, + "name": "ElementaryTypeName", + "src": "550:7:0" + } + ], + "id": 12, + "name": "VariableDeclaration", + "src": "550:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "newData", + "scope": 16, + "stateVariable": false, + "storageLocation": "default", + "type": "string", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string" + }, + "id": 13, + "name": "ElementaryTypeName", + "src": "573:6:0" + } + ], + "id": 14, + "name": "VariableDeclaration", + "src": "573:14:0" + } + ], + "id": 15, + "name": "ParameterList", + "src": "549:39:0" + } + ], + "id": 16, + "name": "EventDefinition", + "src": "526:63:0" + }, + { + "attributes": { + "documentation": "@notice Update entity data.\n@param _data Entity data.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "updateEntityData", + "scope": 37, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_data", + "scope": 36, + "stateVariable": false, + "storageLocation": "memory", + "type": "string", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string" + }, + "id": 17, + "name": "ElementaryTypeName", + "src": "711:6:0" + } + ], + "id": 18, + "name": "VariableDeclaration", + "src": "711:19:0" + } + ], + "id": 19, + "name": "ParameterList", + "src": "710:21:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 20, + "name": "ParameterList", + "src": "739:0:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "string storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "data", + "referencedDeclaration": 5, + "type": "string storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct EntityBase.Entity storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 10, + "type": "mapping(address => struct EntityBase.Entity storage ref)", + "value": "ownerToEntity" + }, + "id": 21, + "name": "Identifier", + "src": "750:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 22, + "name": "Identifier", + "src": "764:3:0" + } + ], + "id": 23, + "name": "MemberAccess", + "src": "764:10:0" + } + ], + "id": 24, + "name": "IndexAccess", + "src": "750:25:0" + } + ], + "id": 25, + "name": "MemberAccess", + "src": "750:30:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 18, + "type": "string memory", + "value": "_data" + }, + "id": 26, + "name": "Identifier", + "src": "783:5:0" + } + ], + "id": 27, + "name": "Assignment", + "src": "750:38:0" + } + ], + "id": 28, + "name": "ExpressionStatement", + "src": "750:38:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 16, + "type": "function (address,string memory)", + "value": "EntityDataUpdated" + }, + "id": 29, + "name": "Identifier", + "src": "806:17:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 30, + "name": "Identifier", + "src": "824:3:0" + } + ], + "id": 31, + "name": "MemberAccess", + "src": "824:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 18, + "type": "string memory", + "value": "_data" + }, + "id": 32, + "name": "Identifier", + "src": "836:5:0" + } + ], + "id": 33, + "name": "FunctionCall", + "src": "806:36:0" + } + ], + "id": 34, + "name": "EmitStatement", + "src": "801:41:0" + } + ], + "id": 35, + "name": "Block", + "src": "739:111:0" + } + ], + "id": 36, + "name": "FunctionDefinition", + "src": "685:165:0" + } + ], + "id": 37, + "name": "ContractDefinition", + "src": "151:702:0" + }, + { + "attributes": { + "baseContracts": [ + null + ], + "contractDependencies": [ + null + ], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for devices.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 131 + ], + "name": "DeviceBase", + "scope": 647 + }, + "children": [ + { + "attributes": { + "canonicalName": "DeviceBase.Device", + "name": "Device", + "scope": 131, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "owner", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 38, + "name": "ElementaryTypeName", + "src": "1061:7:0" + } + ], + "id": 39, + "name": "VariableDeclaration", + "src": "1061:13:0" + }, + { + "attributes": { + "constant": false, + "name": "identifier", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 40, + "name": "ElementaryTypeName", + "src": "1677:7:0" + } + ], + "id": 41, + "name": "VariableDeclaration", + "src": "1677:18:0" + }, + { + "attributes": { + "constant": false, + "name": "metadataHash", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 42, + "name": "ElementaryTypeName", + "src": "1997:7:0" + } + ], + "id": 43, + "name": "VariableDeclaration", + "src": "1997:20:0" + }, + { + "attributes": { + "constant": false, + "name": "firmwareHash", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 44, + "name": "ElementaryTypeName", + "src": "2307:7:0" + } + ], + "id": 45, + "name": "VariableDeclaration", + "src": "2307:20:0" + } + ], + "id": 46, + "name": "StructDefinition", + "src": "988:1643:0" + }, + { + "attributes": { + "constant": false, + "name": "devices", + "scope": 131, + "stateVariable": true, + "storageLocation": "default", + "type": "struct DeviceBase.Device[]", + "value": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "struct DeviceBase.Device[]" + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Device", + "referencedDeclaration": 46, + "type": "struct DeviceBase.Device" + }, + "id": 47, + "name": "UserDefinedTypeName", + "src": "2790:6:0" + } + ], + "id": 48, + "name": "ArrayTypeName", + "src": "2790:8:0" + } + ], + "id": 49, + "name": "VariableDeclaration", + "src": "2790:23:0" + }, + { + "attributes": { + "constant": false, + "name": "ownerDeviceCount", + "scope": 131, + "stateVariable": true, + "storageLocation": "default", + "type": "mapping(address => uint256)", + "value": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "type": "mapping(address => uint256)" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 50, + "name": "ElementaryTypeName", + "src": "2893:7:0" + }, + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 51, + "name": "ElementaryTypeName", + "src": "2904:4:0" + } + ], + "id": 52, + "name": "Mapping", + "src": "2884:25:0" + } + ], + "id": 53, + "name": "VariableDeclaration", + "src": "2884:49:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired on creation of new device.", + "name": "DeviceCreated" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "deviceId", + "scope": 65, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 54, + "name": "ElementaryTypeName", + "src": "3009:4:0" + } + ], + "id": 55, + "name": "VariableDeclaration", + "src": "3009:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": true, + "name": "owner", + "scope": 65, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 56, + "name": "ElementaryTypeName", + "src": "3032:7:0" + } + ], + "id": 57, + "name": "VariableDeclaration", + "src": "3032:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "identifier", + "scope": 65, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 58, + "name": "ElementaryTypeName", + "src": "3055:7:0" + } + ], + "id": 59, + "name": "VariableDeclaration", + "src": "3055:18:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "metadataHash", + "scope": 65, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 60, + "name": "ElementaryTypeName", + "src": "3075:7:0" + } + ], + "id": 61, + "name": "VariableDeclaration", + "src": "3075:20:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "firmwareHash", + "scope": 65, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 62, + "name": "ElementaryTypeName", + "src": "3097:7:0" + } + ], + "id": 63, + "name": "VariableDeclaration", + "src": "3097:20:0" + } + ], + "id": 64, + "name": "ParameterList", + "src": "3008:110:0" + } + ], + "id": 65, + "name": "EventDefinition", + "src": "2989:130:0" + }, + { + "attributes": { + "documentation": "@dev Modifier for ensuring that the message sender is owner of provided device ID.", + "name": "onlyOwnerOf", + "visibility": "internal" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 82, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 66, + "name": "ElementaryTypeName", + "src": "3240:4:0" + } + ], + "id": 67, + "name": "VariableDeclaration", + "src": "3240:14:0" + } + ], + "id": 68, + "name": "ParameterList", + "src": "3239:16:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_d8ad1a9c023f2f7865aaab44a294ffd93a7c2360d9cdcaf7cddf830addfb9fc6", + "typeString": "literal_string \"Only for device owner\"" + } + ], + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "type": "function (bool,string memory) pure", + "value": "require" + }, + "id": 69, + "name": "Identifier", + "src": "3267:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "owner", + "referencedDeclaration": 39, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 70, + "name": "Identifier", + "src": "3275:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 67, + "type": "uint256", + "value": "_deviceId" + }, + "id": 71, + "name": "Identifier", + "src": "3283:9:0" + } + ], + "id": 72, + "name": "IndexAccess", + "src": "3275:18:0" + } + ], + "id": 73, + "name": "MemberAccess", + "src": "3275:24:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 74, + "name": "Identifier", + "src": "3303:3:0" + } + ], + "id": 75, + "name": "MemberAccess", + "src": "3303:10:0" + } + ], + "id": 76, + "name": "BinaryOperation", + "src": "3275:38:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "4f6e6c7920666f7220646576696365206f776e6572", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"Only for device owner\"", + "value": "Only for device owner" + }, + "id": 77, + "name": "Literal", + "src": "3315:23:0" + } + ], + "id": 78, + "name": "FunctionCall", + "src": "3267:72:0" + } + ], + "id": 79, + "name": "ExpressionStatement", + "src": "3267:72:0" + }, + { + "id": 80, + "name": "PlaceholderStatement", + "src": "3350:1:0" + } + ], + "id": 81, + "name": "Block", + "src": "3256:103:0" + } + ], + "id": 82, + "name": "ModifierDefinition", + "src": "3219:140:0" + }, + { + "attributes": { + "documentation": "@notice Creates and saves device into storage. Emits DeviceCreated. \n@param _identifier Unique device identifier, such as fingerprint of RSA/ECC public key or Ethereum address (recommended).\n@param _metadataHash Merkle root hash of metadata (recommended) or simple hash of concatenated metadata.\n@param _firmwareHash Hash of actual firmware hash.\n@return Created device ID.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "createDevice", + "scope": 131, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_identifier", + "scope": 130, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 83, + "name": "ElementaryTypeName", + "src": "3821:7:0" + } + ], + "id": 84, + "name": "VariableDeclaration", + "src": "3821:19:0" + }, + { + "attributes": { + "constant": false, + "name": "_metadataHash", + "scope": 130, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 85, + "name": "ElementaryTypeName", + "src": "3842:7:0" + } + ], + "id": 86, + "name": "VariableDeclaration", + "src": "3842:21:0" + }, + { + "attributes": { + "constant": false, + "name": "_firmwareHash", + "scope": 130, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 87, + "name": "ElementaryTypeName", + "src": "3865:7:0" + } + ], + "id": 88, + "name": "VariableDeclaration", + "src": "3865:21:0" + } + ], + "id": 89, + "name": "ParameterList", + "src": "3820:67:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 130, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 90, + "name": "ElementaryTypeName", + "src": "3904:4:0" + } + ], + "id": 91, + "name": "VariableDeclaration", + "src": "3904:4:0" + } + ], + "id": 92, + "name": "ParameterList", + "src": "3903:6:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 94 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "newDevice", + "scope": 129, + "stateVariable": false, + "storageLocation": "memory", + "type": "struct DeviceBase.Device", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Device", + "referencedDeclaration": 46, + "type": "struct DeviceBase.Device" + }, + "id": 93, + "name": "UserDefinedTypeName", + "src": "3921:6:0" + } + ], + "id": 94, + "name": "VariableDeclaration", + "src": "3921:23:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": true, + "lValueRequested": false, + "names": [ + null + ], + "type": "struct DeviceBase.Device memory", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 46, + "type": "type(struct DeviceBase.Device storage pointer)", + "value": "Device" + }, + "id": 95, + "name": "Identifier", + "src": "3947:6:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 96, + "name": "Identifier", + "src": "3954:3:0" + } + ], + "id": 97, + "name": "MemberAccess", + "src": "3954:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 84, + "type": "bytes32", + "value": "_identifier" + }, + "id": 98, + "name": "Identifier", + "src": "3966:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 86, + "type": "bytes32", + "value": "_metadataHash" + }, + "id": 99, + "name": "Identifier", + "src": "3979:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 88, + "type": "bytes32", + "value": "_firmwareHash" + }, + "id": 100, + "name": "Identifier", + "src": "3994:13:0" + } + ], + "id": 101, + "name": "FunctionCall", + "src": "3947:61:0" + } + ], + "id": 102, + "name": "VariableDeclarationStatement", + "src": "3921:87:0" + }, + { + "attributes": { + "assignments": [ + 104 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "deviceId", + "scope": 129, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 103, + "name": "ElementaryTypeName", + "src": "4019:4:0" + } + ], + "id": 104, + "name": "VariableDeclaration", + "src": "4019:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Device_$46_memory_ptr", + "typeString": "struct DeviceBase.Device memory" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "push", + "referencedDeclaration": null, + "type": "function (struct DeviceBase.Device storage ref) returns (uint256)" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 105, + "name": "Identifier", + "src": "4035:7:0" + } + ], + "id": 106, + "name": "MemberAccess", + "src": "4035:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 94, + "type": "struct DeviceBase.Device memory", + "value": "newDevice" + }, + "id": 107, + "name": "Identifier", + "src": "4048:9:0" + } + ], + "id": 108, + "name": "FunctionCall", + "src": "4035:23:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "31", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 1", + "value": "1" + }, + "id": 109, + "name": "Literal", + "src": "4061:1:0" + } + ], + "id": 110, + "name": "BinaryOperation", + "src": "4035:27:0" + } + ], + "id": 111, + "name": "VariableDeclarationStatement", + "src": "4019:43:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => uint256)", + "value": "ownerDeviceCount" + }, + "id": 112, + "name": "Identifier", + "src": "4073:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 113, + "name": "Identifier", + "src": "4090:3:0" + } + ], + "id": 114, + "name": "MemberAccess", + "src": "4090:10:0" + } + ], + "id": 115, + "name": "IndexAccess", + "src": "4073:28:0" + } + ], + "id": 116, + "name": "UnaryOperation", + "src": "4073:30:0" + } + ], + "id": 117, + "name": "ExpressionStatement", + "src": "4073:30:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 65, + "type": "function (uint256,address,bytes32,bytes32,bytes32)", + "value": "DeviceCreated" + }, + "id": 118, + "name": "Identifier", + "src": "4121:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 104, + "type": "uint256", + "value": "deviceId" + }, + "id": 119, + "name": "Identifier", + "src": "4135:8:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 120, + "name": "Identifier", + "src": "4145:3:0" + } + ], + "id": 121, + "name": "MemberAccess", + "src": "4145:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 84, + "type": "bytes32", + "value": "_identifier" + }, + "id": 122, + "name": "Identifier", + "src": "4157:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 86, + "type": "bytes32", + "value": "_metadataHash" + }, + "id": 123, + "name": "Identifier", + "src": "4170:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 88, + "type": "bytes32", + "value": "_firmwareHash" + }, + "id": 124, + "name": "Identifier", + "src": "4185:13:0" + } + ], + "id": 125, + "name": "FunctionCall", + "src": "4121:78:0" + } + ], + "id": 126, + "name": "EmitStatement", + "src": "4116:83:0" + }, + { + "attributes": { + "functionReturnParameters": 92 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 104, + "type": "uint256", + "value": "deviceId" + }, + "id": 127, + "name": "Identifier", + "src": "4217:8:0" + } + ], + "id": 128, + "name": "Return", + "src": "4210:15:0" + } + ], + "id": 129, + "name": "Block", + "src": "3910:323:0" + } + ], + "id": 130, + "name": "FunctionDefinition", + "src": "3799:434:0" + } + ], + "id": 131, + "name": "ContractDefinition", + "src": "921:3315:0" + }, + { + "attributes": { + "contractDependencies": [ + 131 + ], + "contractKind": "contract", + "documentation": "@title Provides extra functionalities for devices.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 284, + 131 + ], + "name": "DeviceHelper", + "scope": 647 + }, + "children": [ + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "DeviceBase", + "referencedDeclaration": 131, + "type": "contract DeviceBase" + }, + "id": 132, + "name": "UserDefinedTypeName", + "src": "4330:10:0" + } + ], + "id": 133, + "name": "InheritanceSpecifier", + "src": "4330:10:0" + }, + { + "attributes": { + "documentation": "@notice Gets all devices owned by specified address. \n@dev Use this function instead of filtering DeviceCreated event since devices could have been transferred between owners.\n@param _owner Owner address.\n@return Array of device IDs.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "getDevicesByOwner", + "scope": 284, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_owner", + "scope": 190, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 134, + "name": "ElementaryTypeName", + "src": "4658:7:0" + } + ], + "id": 135, + "name": "VariableDeclaration", + "src": "4658:14:0" + } + ], + "id": 136, + "name": "ParameterList", + "src": "4657:16:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 190, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 137, + "name": "ElementaryTypeName", + "src": "4695:4:0" + } + ], + "id": 138, + "name": "ArrayTypeName", + "src": "4695:6:0" + } + ], + "id": 139, + "name": "VariableDeclaration", + "src": "4695:13:0" + } + ], + "id": 140, + "name": "ParameterList", + "src": "4694:15:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 144 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "deviceIds", + "scope": 189, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 142, + "name": "ElementaryTypeName", + "src": "4721:4:0" + } + ], + "id": 143, + "name": "ArrayTypeName", + "src": "4721:6:0" + } + ], + "id": 144, + "name": "VariableDeclaration", + "src": "4721:23:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256[] memory", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "function (uint256) pure returns (uint256[] memory)" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 145, + "name": "ElementaryTypeName", + "src": "4751:4:0" + } + ], + "id": 146, + "name": "ArrayTypeName", + "src": "4751:6:0" + } + ], + "id": 147, + "name": "NewExpression", + "src": "4747:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => uint256)", + "value": "ownerDeviceCount" + }, + "id": 148, + "name": "Identifier", + "src": "4758:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 135, + "type": "address", + "value": "_owner" + }, + "id": 149, + "name": "Identifier", + "src": "4775:6:0" + } + ], + "id": 150, + "name": "IndexAccess", + "src": "4758:24:0" + } + ], + "id": 151, + "name": "FunctionCall", + "src": "4747:36:0" + } + ], + "id": 152, + "name": "VariableDeclarationStatement", + "src": "4721:62:0" + }, + { + "attributes": { + "assignments": [ + 154 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "counter", + "scope": 189, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 153, + "name": "ElementaryTypeName", + "src": "4794:4:0" + } + ], + "id": 154, + "name": "VariableDeclaration", + "src": "4794:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 155, + "name": "Literal", + "src": "4809:1:0" + } + ], + "id": 156, + "name": "VariableDeclarationStatement", + "src": "4794:16:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 158 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "i", + "scope": 186, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 157, + "name": "ElementaryTypeName", + "src": "4826:4:0" + } + ], + "id": 158, + "name": "VariableDeclaration", + "src": "4826:6:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 159, + "name": "Literal", + "src": "4835:1:0" + } + ], + "id": 160, + "name": "VariableDeclarationStatement", + "src": "4826:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "<", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 158, + "type": "uint256", + "value": "i" + }, + "id": 161, + "name": "Identifier", + "src": "4838:1:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "length", + "referencedDeclaration": null, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 162, + "name": "Identifier", + "src": "4842:7:0" + } + ], + "id": 163, + "name": "MemberAccess", + "src": "4842:14:0" + } + ], + "id": 164, + "name": "BinaryOperation", + "src": "4838:18:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 158, + "type": "uint256", + "value": "i" + }, + "id": 165, + "name": "Identifier", + "src": "4858:1:0" + } + ], + "id": 166, + "name": "UnaryOperation", + "src": "4858:3:0" + } + ], + "id": 167, + "name": "ExpressionStatement", + "src": "4858:3:0" + }, + { + "children": [ + { + "attributes": { + "falseBody": null + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "owner", + "referencedDeclaration": 39, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 168, + "name": "Identifier", + "src": "4882:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 158, + "type": "uint256", + "value": "i" + }, + "id": 169, + "name": "Identifier", + "src": "4890:1:0" + } + ], + "id": 170, + "name": "IndexAccess", + "src": "4882:10:0" + } + ], + "id": 171, + "name": "MemberAccess", + "src": "4882:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 135, + "type": "address", + "value": "_owner" + }, + "id": 172, + "name": "Identifier", + "src": "4902:6:0" + } + ], + "id": 173, + "name": "BinaryOperation", + "src": "4882:26:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 144, + "type": "uint256[] memory", + "value": "deviceIds" + }, + "id": 174, + "name": "Identifier", + "src": "4929:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 154, + "type": "uint256", + "value": "counter" + }, + "id": 175, + "name": "Identifier", + "src": "4939:7:0" + } + ], + "id": 176, + "name": "IndexAccess", + "src": "4929:18:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 158, + "type": "uint256", + "value": "i" + }, + "id": 177, + "name": "Identifier", + "src": "4950:1:0" + } + ], + "id": 178, + "name": "Assignment", + "src": "4929:22:0" + } + ], + "id": 179, + "name": "ExpressionStatement", + "src": "4929:22:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 154, + "type": "uint256", + "value": "counter" + }, + "id": 180, + "name": "Identifier", + "src": "4970:7:0" + } + ], + "id": 181, + "name": "UnaryOperation", + "src": "4970:9:0" + } + ], + "id": 182, + "name": "ExpressionStatement", + "src": "4970:9:0" + } + ], + "id": 183, + "name": "Block", + "src": "4910:85:0" + } + ], + "id": 184, + "name": "IfStatement", + "src": "4878:117:0" + } + ], + "id": 185, + "name": "Block", + "src": "4863:143:0" + } + ], + "id": 186, + "name": "ForStatement", + "src": "4821:185:0" + }, + { + "attributes": { + "functionReturnParameters": 140 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 144, + "type": "uint256[] memory", + "value": "deviceIds" + }, + "id": 187, + "name": "Identifier", + "src": "5023:9:0" + } + ], + "id": 188, + "name": "Return", + "src": "5016:16:0" + } + ], + "id": 189, + "name": "Block", + "src": "4710:330:0" + } + ], + "id": 190, + "name": "FunctionDefinition", + "src": "4631:409:0" + }, + { + "attributes": { + "documentation": "@notice Checks if device is also an entity. \n@param _deviceId ID of a device.\n@return Boolean status.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "isDeviceAnEntity", + "scope": 284, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 214, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 191, + "name": "ElementaryTypeName", + "src": "5219:4:0" + } + ], + "id": 192, + "name": "VariableDeclaration", + "src": "5219:14:0" + } + ], + "id": 193, + "name": "ParameterList", + "src": "5218:16:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 214, + "stateVariable": false, + "storageLocation": "default", + "type": "bool", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bool", + "type": "bool" + }, + "id": 194, + "name": "ElementaryTypeName", + "src": "5256:4:0" + } + ], + "id": 195, + "name": "VariableDeclaration", + "src": "5256:4:0" + } + ], + "id": 196, + "name": "ParameterList", + "src": "5255:6:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 196 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "owner", + "referencedDeclaration": 39, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 197, + "name": "Identifier", + "src": "5280:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 192, + "type": "uint256", + "value": "_deviceId" + }, + "id": 198, + "name": "Identifier", + "src": "5288:9:0" + } + ], + "id": 199, + "name": "IndexAccess", + "src": "5280:18:0" + } + ], + "id": 200, + "name": "MemberAccess", + "src": "5280:24:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "address payable", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(address)", + "value": "address" + }, + "id": 201, + "name": "ElementaryTypeNameExpression", + "src": "5308:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint160", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(uint160)", + "value": "uint160" + }, + "id": 202, + "name": "ElementaryTypeNameExpression", + "src": "5316:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(uint256)", + "value": "uint256" + }, + "id": 203, + "name": "ElementaryTypeNameExpression", + "src": "5324:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "identifier", + "referencedDeclaration": 41, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 204, + "name": "Identifier", + "src": "5332:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 192, + "type": "uint256", + "value": "_deviceId" + }, + "id": 205, + "name": "Identifier", + "src": "5340:9:0" + } + ], + "id": 206, + "name": "IndexAccess", + "src": "5332:18:0" + } + ], + "id": 207, + "name": "MemberAccess", + "src": "5332:29:0" + } + ], + "id": 208, + "name": "FunctionCall", + "src": "5324:38:0" + } + ], + "id": 209, + "name": "FunctionCall", + "src": "5316:47:0" + } + ], + "id": 210, + "name": "FunctionCall", + "src": "5308:56:0" + } + ], + "id": 211, + "name": "BinaryOperation", + "src": "5280:84:0" + } + ], + "id": 212, + "name": "Return", + "src": "5273:91:0" + } + ], + "id": 213, + "name": "Block", + "src": "5262:110:0" + } + ], + "id": 214, + "name": "FunctionDefinition", + "src": "5193:179:0" + }, + { + "attributes": { + "documentation": "@notice Checks if provided leaf is a member of metadata contained in Merkle tree. \nAssumes that each pair of leaves and each pair of pre-images are sorted.\n@param _deviceId ID of a device containing metadata hash.\n@param _proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree.\n@param _leaf Leaf of Merkle tree.\n@return Boolean status.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "isValidMetadataMember", + "scope": 284, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 237, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 215, + "name": "ElementaryTypeName", + "src": "5862:4:0" + } + ], + "id": 216, + "name": "VariableDeclaration", + "src": "5862:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_proof", + "scope": 237, + "stateVariable": false, + "storageLocation": "memory", + "type": "bytes32[]", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "bytes32[]" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 217, + "name": "ElementaryTypeName", + "src": "5878:7:0" + } + ], + "id": 218, + "name": "ArrayTypeName", + "src": "5878:9:0" + } + ], + "id": 219, + "name": "VariableDeclaration", + "src": "5878:23:0" + }, + { + "attributes": { + "constant": false, + "name": "_leaf", + "scope": 237, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 220, + "name": "ElementaryTypeName", + "src": "5903:7:0" + } + ], + "id": 221, + "name": "VariableDeclaration", + "src": "5903:13:0" + } + ], + "id": 222, + "name": "ParameterList", + "src": "5861:56:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 237, + "stateVariable": false, + "storageLocation": "default", + "type": "bool", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bool", + "type": "bool" + }, + "id": 223, + "name": "ElementaryTypeName", + "src": "5939:4:0" + } + ], + "id": 224, + "name": "VariableDeclaration", + "src": "5939:4:0" + } + ], + "id": 225, + "name": "ParameterList", + "src": "5938:6:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 225 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "bool", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", + "typeString": "bytes32[] memory" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "verifyProof", + "referencedDeclaration": 795, + "type": "function (bytes32[] memory,bytes32,bytes32) pure returns (bool)" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 796, + "type": "type(library MerkleProof)", + "value": "MerkleProof" + }, + "id": 226, + "name": "Identifier", + "src": "5963:11:0" + } + ], + "id": 227, + "name": "MemberAccess", + "src": "5963:23:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 219, + "type": "bytes32[] memory", + "value": "_proof" + }, + "id": 228, + "name": "Identifier", + "src": "5987:6:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "metadataHash", + "referencedDeclaration": 43, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 229, + "name": "Identifier", + "src": "5995:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 216, + "type": "uint256", + "value": "_deviceId" + }, + "id": 230, + "name": "Identifier", + "src": "6003:9:0" + } + ], + "id": 231, + "name": "IndexAccess", + "src": "5995:18:0" + } + ], + "id": 232, + "name": "MemberAccess", + "src": "5995:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 221, + "type": "bytes32", + "value": "_leaf" + }, + "id": 233, + "name": "Identifier", + "src": "6028:5:0" + } + ], + "id": 234, + "name": "FunctionCall", + "src": "5963:71:0" + } + ], + "id": 235, + "name": "Return", + "src": "5956:78:0" + } + ], + "id": 236, + "name": "Block", + "src": "5945:97:0" + } + ], + "id": 237, + "name": "FunctionDefinition", + "src": "5831:211:0" + }, + { + "attributes": { + "documentation": "@notice Checks if provided firmware hash is equal to firmware hash device property. \n@param _deviceId ID of a device containing firmware hash.\n@param _firmwareHash Firmware hash (not the actual hash).\n@return Boolean status.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "isValidFirmwareHash", + "scope": 284, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 254, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 238, + "name": "ElementaryTypeName", + "src": "6354:4:0" + } + ], + "id": 239, + "name": "VariableDeclaration", + "src": "6354:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_firmwareHash", + "scope": 254, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 240, + "name": "ElementaryTypeName", + "src": "6370:7:0" + } + ], + "id": 241, + "name": "VariableDeclaration", + "src": "6370:21:0" + } + ], + "id": 242, + "name": "ParameterList", + "src": "6353:39:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 254, + "stateVariable": false, + "storageLocation": "default", + "type": "bool", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bool", + "type": "bool" + }, + "id": 243, + "name": "ElementaryTypeName", + "src": "6414:4:0" + } + ], + "id": 244, + "name": "VariableDeclaration", + "src": "6414:4:0" + } + ], + "id": 245, + "name": "ParameterList", + "src": "6413:6:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 245 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "firmwareHash", + "referencedDeclaration": 45, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 246, + "name": "Identifier", + "src": "6438:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 239, + "type": "uint256", + "value": "_deviceId" + }, + "id": 247, + "name": "Identifier", + "src": "6446:9:0" + } + ], + "id": 248, + "name": "IndexAccess", + "src": "6438:18:0" + } + ], + "id": 249, + "name": "MemberAccess", + "src": "6438:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 241, + "type": "bytes32", + "value": "_firmwareHash" + }, + "id": 250, + "name": "Identifier", + "src": "6473:13:0" + } + ], + "id": 251, + "name": "BinaryOperation", + "src": "6438:48:0" + } + ], + "id": 252, + "name": "Return", + "src": "6431:55:0" + } + ], + "id": 253, + "name": "Block", + "src": "6420:74:0" + } + ], + "id": 254, + "name": "FunctionDefinition", + "src": "6325:169:0" + }, + { + "attributes": { + "documentation": "@notice Validate authenticity of message signed by Etherium private key.\nOn-chain validation is available only for Ethereum signed messages.\n@param _deviceId ID of a device that signed the message.\n@param _messageHash Hash of sent message.\n@param _signature Signature generated using web3.eth.sign().\n@return Boolean status.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "isValidEthMessage", + "scope": 284, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 283, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 255, + "name": "ElementaryTypeName", + "src": "6920:4:0" + } + ], + "id": 256, + "name": "VariableDeclaration", + "src": "6920:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_messageHash", + "scope": 283, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 257, + "name": "ElementaryTypeName", + "src": "6936:7:0" + } + ], + "id": 258, + "name": "VariableDeclaration", + "src": "6936:20:0" + }, + { + "attributes": { + "constant": false, + "name": "_signature", + "scope": 283, + "stateVariable": false, + "storageLocation": "memory", + "type": "bytes", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes", + "type": "bytes" + }, + "id": 259, + "name": "ElementaryTypeName", + "src": "6958:5:0" + } + ], + "id": 260, + "name": "VariableDeclaration", + "src": "6958:23:0" + } + ], + "id": 261, + "name": "ParameterList", + "src": "6919:63:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 283, + "stateVariable": false, + "storageLocation": "default", + "type": "bool", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bool", + "type": "bool" + }, + "id": 262, + "name": "ElementaryTypeName", + "src": "7004:4:0" + } + ], + "id": 263, + "name": "VariableDeclaration", + "src": "7004:4:0" + } + ], + "id": 264, + "name": "ParameterList", + "src": "7003:6:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 264 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "address", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "recover", + "referencedDeclaration": 710, + "type": "function (bytes32,bytes memory) pure returns (address)" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 727, + "type": "type(library ECRecovery)", + "value": "ECRecovery" + }, + "id": 265, + "name": "Identifier", + "src": "7028:10:0" + } + ], + "id": 266, + "name": "MemberAccess", + "src": "7028:18:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 258, + "type": "bytes32", + "value": "_messageHash" + }, + "id": 267, + "name": "Identifier", + "src": "7047:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 260, + "type": "bytes memory", + "value": "_signature" + }, + "id": 268, + "name": "Identifier", + "src": "7061:10:0" + } + ], + "id": 269, + "name": "FunctionCall", + "src": "7028:44:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "address payable", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(address)", + "value": "address" + }, + "id": 270, + "name": "ElementaryTypeNameExpression", + "src": "7076:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint160", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(uint160)", + "value": "uint160" + }, + "id": 271, + "name": "ElementaryTypeNameExpression", + "src": "7084:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256", + "type_conversion": true + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(uint256)", + "value": "uint256" + }, + "id": 272, + "name": "ElementaryTypeNameExpression", + "src": "7092:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "identifier", + "referencedDeclaration": 41, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 273, + "name": "Identifier", + "src": "7100:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 256, + "type": "uint256", + "value": "_deviceId" + }, + "id": 274, + "name": "Identifier", + "src": "7108:9:0" + } + ], + "id": 275, + "name": "IndexAccess", + "src": "7100:18:0" + } + ], + "id": 276, + "name": "MemberAccess", + "src": "7100:29:0" + } + ], + "id": 277, + "name": "FunctionCall", + "src": "7092:38:0" + } + ], + "id": 278, + "name": "FunctionCall", + "src": "7084:47:0" + } + ], + "id": 279, + "name": "FunctionCall", + "src": "7076:56:0" + } + ], + "id": 280, + "name": "BinaryOperation", + "src": "7028:104:0" + } + ], + "id": 281, + "name": "Return", + "src": "7021:111:0" + } + ], + "id": 282, + "name": "Block", + "src": "7010:130:0" + } + ], + "id": 283, + "name": "FunctionDefinition", + "src": "6893:247:0" + } + ], + "id": 284, + "name": "ContractDefinition", + "src": "4305:2838:0" + }, + { + "attributes": { + "baseContracts": [ + null + ], + "contractDependencies": [ + null + ], + "contractKind": "contract", + "documentation": "@title Provides base functionalities for signatures.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 427 + ], + "name": "SignatureBase", + "scope": 647 + }, + "children": [ + { + "attributes": { + "canonicalName": "SignatureBase.Signature", + "name": "Signature", + "scope": 427, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "signer", + "scope": 293, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 285, + "name": "ElementaryTypeName", + "src": "7359:7:0" + } + ], + "id": 286, + "name": "VariableDeclaration", + "src": "7359:14:0" + }, + { + "attributes": { + "constant": false, + "name": "deviceId", + "scope": 293, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 287, + "name": "ElementaryTypeName", + "src": "7420:4:0" + } + ], + "id": 288, + "name": "VariableDeclaration", + "src": "7420:13:0" + }, + { + "attributes": { + "constant": false, + "name": "expiryTime", + "scope": 293, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 289, + "name": "ElementaryTypeName", + "src": "7522:4:0" + } + ], + "id": 290, + "name": "VariableDeclaration", + "src": "7522:15:0" + }, + { + "attributes": { + "constant": false, + "name": "revoked", + "scope": 293, + "stateVariable": false, + "storageLocation": "default", + "type": "bool", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bool", + "type": "bool" + }, + "id": 291, + "name": "ElementaryTypeName", + "src": "7619:4:0" + } + ], + "id": 292, + "name": "VariableDeclaration", + "src": "7619:12:0" + } + ], + "id": 293, + "name": "StructDefinition", + "src": "7287:352:0" + }, + { + "attributes": { + "constant": false, + "name": "signatures", + "scope": 427, + "stateVariable": true, + "storageLocation": "default", + "type": "struct SignatureBase.Signature[]", + "value": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "struct SignatureBase.Signature[]" + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Signature", + "referencedDeclaration": 293, + "type": "struct SignatureBase.Signature" + }, + "id": 294, + "name": "UserDefinedTypeName", + "src": "7800:9:0" + } + ], + "id": 295, + "name": "ArrayTypeName", + "src": "7800:11:0" + } + ], + "id": 296, + "name": "VariableDeclaration", + "src": "7800:29:0" + }, + { + "attributes": { + "constant": false, + "name": "deviceSignatureCount", + "scope": 427, + "stateVariable": true, + "storageLocation": "default", + "type": "mapping(uint256 => uint256)", + "value": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "type": "mapping(uint256 => uint256)" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 297, + "name": "ElementaryTypeName", + "src": "7913:4:0" + }, + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 298, + "name": "ElementaryTypeName", + "src": "7921:4:0" + } + ], + "id": 299, + "name": "Mapping", + "src": "7904:22:0" + } + ], + "id": 300, + "name": "VariableDeclaration", + "src": "7904:50:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired when an address signs a device.", + "name": "DeviceSigned" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "signatureId", + "scope": 310, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 301, + "name": "ElementaryTypeName", + "src": "8038:4:0" + } + ], + "id": 302, + "name": "VariableDeclaration", + "src": "8038:24:0" + }, + { + "attributes": { + "constant": false, + "indexed": true, + "name": "deviceId", + "scope": 310, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 303, + "name": "ElementaryTypeName", + "src": "8064:4:0" + } + ], + "id": 304, + "name": "VariableDeclaration", + "src": "8064:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": true, + "name": "signer", + "scope": 310, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 305, + "name": "ElementaryTypeName", + "src": "8087:7:0" + } + ], + "id": 306, + "name": "VariableDeclaration", + "src": "8087:22:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "expiryTime", + "scope": 310, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 307, + "name": "ElementaryTypeName", + "src": "8111:4:0" + } + ], + "id": 308, + "name": "VariableDeclaration", + "src": "8111:15:0" + } + ], + "id": 309, + "name": "ParameterList", + "src": "8037:90:0" + } + ], + "id": 310, + "name": "EventDefinition", + "src": "8019:109:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired when signature is revoked.", + "name": "SignatureRevoked" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "signatureId", + "scope": 316, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 311, + "name": "ElementaryTypeName", + "src": "8206:4:0" + } + ], + "id": 312, + "name": "VariableDeclaration", + "src": "8206:24:0" + }, + { + "attributes": { + "constant": false, + "indexed": true, + "name": "deviceId", + "scope": 316, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 313, + "name": "ElementaryTypeName", + "src": "8232:4:0" + } + ], + "id": 314, + "name": "VariableDeclaration", + "src": "8232:21:0" + } + ], + "id": 315, + "name": "ParameterList", + "src": "8205:49:0" + } + ], + "id": 316, + "name": "EventDefinition", + "src": "8183:72:0" + }, + { + "attributes": { + "documentation": "@dev Modifier for ensuring that the device hasn't been signed already.", + "name": "notSigned", + "visibility": "internal" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 331, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 317, + "name": "ElementaryTypeName", + "src": "8362:4:0" + } + ], + "id": 318, + "name": "VariableDeclaration", + "src": "8362:14:0" + } + ], + "id": 319, + "name": "ParameterList", + "src": "8361:16:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_73fc55a17986bff1b99557baa412a11f76b8a2a98ee4458c73a848ffe7b97e84", + "typeString": "literal_string \"Must not be signed\"" + } + ], + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "type": "function (bool,string memory) pure", + "value": "require" + }, + "id": 320, + "name": "Identifier", + "src": "8389:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 300, + "type": "mapping(uint256 => uint256)", + "value": "deviceSignatureCount" + }, + "id": 321, + "name": "Identifier", + "src": "8397:20:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 318, + "type": "uint256", + "value": "_deviceId" + }, + "id": 322, + "name": "Identifier", + "src": "8418:9:0" + } + ], + "id": 323, + "name": "IndexAccess", + "src": "8397:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 324, + "name": "Literal", + "src": "8432:1:0" + } + ], + "id": 325, + "name": "BinaryOperation", + "src": "8397:36:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "4d757374206e6f74206265207369676e6564", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"Must not be signed\"", + "value": "Must not be signed" + }, + "id": 326, + "name": "Literal", + "src": "8435:20:0" + } + ], + "id": 327, + "name": "FunctionCall", + "src": "8389:67:0" + } + ], + "id": 328, + "name": "ExpressionStatement", + "src": "8389:67:0" + }, + { + "id": 329, + "name": "PlaceholderStatement", + "src": "8467:1:0" + } + ], + "id": 330, + "name": "Block", + "src": "8378:98:0" + } + ], + "id": 331, + "name": "ModifierDefinition", + "src": "8343:133:0" + }, + { + "attributes": { + "documentation": "@notice Signs a device and signature into storage. Emits DeviceSigned. \n@param _deviceId ID of to be signed device.\n@param _expiryTime Expiry time in Unix seconds.\n@return Created signature ID.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "signDevice", + "scope": 427, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 375, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 332, + "name": "ElementaryTypeName", + "src": "8748:4:0" + } + ], + "id": 333, + "name": "VariableDeclaration", + "src": "8748:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_expiryTime", + "scope": 375, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 334, + "name": "ElementaryTypeName", + "src": "8764:4:0" + } + ], + "id": 335, + "name": "VariableDeclaration", + "src": "8764:16:0" + } + ], + "id": 336, + "name": "ParameterList", + "src": "8747:34:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 375, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 337, + "name": "ElementaryTypeName", + "src": "8798:4:0" + } + ], + "id": 338, + "name": "VariableDeclaration", + "src": "8798:4:0" + } + ], + "id": 339, + "name": "ParameterList", + "src": "8797:6:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 341 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "signature", + "scope": 374, + "stateVariable": false, + "storageLocation": "memory", + "type": "struct SignatureBase.Signature", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Signature", + "referencedDeclaration": 293, + "type": "struct SignatureBase.Signature" + }, + "id": 340, + "name": "UserDefinedTypeName", + "src": "8815:9:0" + } + ], + "id": 341, + "name": "VariableDeclaration", + "src": "8815:26:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": true, + "lValueRequested": false, + "names": [ + null + ], + "type": "struct SignatureBase.Signature memory", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 293, + "type": "type(struct SignatureBase.Signature storage pointer)", + "value": "Signature" + }, + "id": 342, + "name": "Identifier", + "src": "8844:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 343, + "name": "Identifier", + "src": "8854:3:0" + } + ], + "id": 344, + "name": "MemberAccess", + "src": "8854:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 333, + "type": "uint256", + "value": "_deviceId" + }, + "id": 345, + "name": "Identifier", + "src": "8866:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 335, + "type": "uint256", + "value": "_expiryTime" + }, + "id": 346, + "name": "Identifier", + "src": "8877:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "66616c7365", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "bool", + "type": "bool", + "value": "false" + }, + "id": 347, + "name": "Literal", + "src": "8890:5:0" + } + ], + "id": 348, + "name": "FunctionCall", + "src": "8844:52:0" + } + ], + "id": 349, + "name": "VariableDeclarationStatement", + "src": "8815:81:0" + }, + { + "attributes": { + "assignments": [ + 351 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "signatureId", + "scope": 374, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 350, + "name": "ElementaryTypeName", + "src": "8907:4:0" + } + ], + "id": 351, + "name": "VariableDeclaration", + "src": "8907:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Signature_$293_memory_ptr", + "typeString": "struct SignatureBase.Signature memory" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "push", + "referencedDeclaration": null, + "type": "function (struct SignatureBase.Signature storage ref) returns (uint256)" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 352, + "name": "Identifier", + "src": "8926:10:0" + } + ], + "id": 353, + "name": "MemberAccess", + "src": "8926:15:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 341, + "type": "struct SignatureBase.Signature memory", + "value": "signature" + }, + "id": 354, + "name": "Identifier", + "src": "8942:9:0" + } + ], + "id": 355, + "name": "FunctionCall", + "src": "8926:26:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "31", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 1", + "value": "1" + }, + "id": 356, + "name": "Literal", + "src": "8955:1:0" + } + ], + "id": 357, + "name": "BinaryOperation", + "src": "8926:30:0" + } + ], + "id": 358, + "name": "VariableDeclarationStatement", + "src": "8907:49:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 300, + "type": "mapping(uint256 => uint256)", + "value": "deviceSignatureCount" + }, + "id": 359, + "name": "Identifier", + "src": "8967:20:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 333, + "type": "uint256", + "value": "_deviceId" + }, + "id": 360, + "name": "Identifier", + "src": "8988:9:0" + } + ], + "id": 361, + "name": "IndexAccess", + "src": "8967:31:0" + } + ], + "id": 362, + "name": "UnaryOperation", + "src": "8967:33:0" + } + ], + "id": 363, + "name": "ExpressionStatement", + "src": "8967:33:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 310, + "type": "function (uint256,uint256,address,uint256)", + "value": "DeviceSigned" + }, + "id": 364, + "name": "Identifier", + "src": "9018:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 351, + "type": "uint256", + "value": "signatureId" + }, + "id": 365, + "name": "Identifier", + "src": "9031:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 333, + "type": "uint256", + "value": "_deviceId" + }, + "id": 366, + "name": "Identifier", + "src": "9044:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 367, + "name": "Identifier", + "src": "9055:3:0" + } + ], + "id": 368, + "name": "MemberAccess", + "src": "9055:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 335, + "type": "uint256", + "value": "_expiryTime" + }, + "id": 369, + "name": "Identifier", + "src": "9067:11:0" + } + ], + "id": 370, + "name": "FunctionCall", + "src": "9018:61:0" + } + ], + "id": 371, + "name": "EmitStatement", + "src": "9013:66:0" + }, + { + "attributes": { + "functionReturnParameters": 339 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 351, + "type": "uint256", + "value": "signatureId" + }, + "id": 372, + "name": "Identifier", + "src": "9097:11:0" + } + ], + "id": 373, + "name": "Return", + "src": "9090:18:0" + } + ], + "id": 374, + "name": "Block", + "src": "8804:312:0" + } + ], + "id": 375, + "name": "FunctionDefinition", + "src": "8728:388:0" + }, + { + "attributes": { + "documentation": "@notice Revokes a signature. Emits SignatureRevoked. \n@param _signatureId ID of to be revoked signature.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "revokeSignature", + "scope": 427, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_signatureId", + "scope": 426, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 376, + "name": "ElementaryTypeName", + "src": "9288:4:0" + } + ], + "id": 377, + "name": "VariableDeclaration", + "src": "9288:17:0" + } + ], + "id": 378, + "name": "ParameterList", + "src": "9287:19:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 379, + "name": "ParameterList", + "src": "9314:0:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3aaaa87a777306387460c3ec7c037c21271b7d2e0f37fa494722618006dc0cdb", + "typeString": "literal_string \"Only for creator of the signature\"" + } + ], + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "type": "function (bool,string memory) pure", + "value": "require" + }, + "id": 380, + "name": "Identifier", + "src": "9325:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "signer", + "referencedDeclaration": 286, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct SignatureBase.Signature storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 381, + "name": "Identifier", + "src": "9333:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 377, + "type": "uint256", + "value": "_signatureId" + }, + "id": 382, + "name": "Identifier", + "src": "9344:12:0" + } + ], + "id": 383, + "name": "IndexAccess", + "src": "9333:24:0" + } + ], + "id": 384, + "name": "MemberAccess", + "src": "9333:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 385, + "name": "Identifier", + "src": "9368:3:0" + } + ], + "id": 386, + "name": "MemberAccess", + "src": "9368:10:0" + } + ], + "id": 387, + "name": "BinaryOperation", + "src": "9333:45:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "4f6e6c7920666f722063726561746f72206f6620746865207369676e6174757265", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"Only for creator of the signature\"", + "value": "Only for creator of the signature" + }, + "id": 388, + "name": "Literal", + "src": "9380:35:0" + } + ], + "id": 389, + "name": "FunctionCall", + "src": "9325:91:0" + } + ], + "id": 390, + "name": "ExpressionStatement", + "src": "9325:91:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e22c32ac6c26626aeef51dc165bb8bcbe4c9684fc645b2cda8fe482fe7423f3d", + "typeString": "literal_string \"Signature mustn't be revoked already\"" + } + ], + "overloadedDeclarations": [ + 871, + 872 + ], + "referencedDeclaration": 872, + "type": "function (bool,string memory) pure", + "value": "require" + }, + "id": 391, + "name": "Identifier", + "src": "9427:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "revoked", + "referencedDeclaration": 292, + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct SignatureBase.Signature storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 392, + "name": "Identifier", + "src": "9435:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 377, + "type": "uint256", + "value": "_signatureId" + }, + "id": 393, + "name": "Identifier", + "src": "9446:12:0" + } + ], + "id": 394, + "name": "IndexAccess", + "src": "9435:24:0" + } + ], + "id": 395, + "name": "MemberAccess", + "src": "9435:32:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "66616c7365", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "bool", + "type": "bool", + "value": "false" + }, + "id": 396, + "name": "Literal", + "src": "9471:5:0" + } + ], + "id": 397, + "name": "BinaryOperation", + "src": "9435:41:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "5369676e6174757265206d7573746e2774206265207265766f6b656420616c7265616479", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"Signature mustn't be revoked already\"", + "value": "Signature mustn't be revoked already" + }, + "id": 398, + "name": "Literal", + "src": "9478:38:0" + } + ], + "id": 399, + "name": "FunctionCall", + "src": "9427:90:0" + } + ], + "id": 400, + "name": "ExpressionStatement", + "src": "9427:90:0" + }, + { + "attributes": { + "assignments": [ + 402 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "signature", + "scope": 425, + "stateVariable": false, + "storageLocation": "storage", + "type": "struct SignatureBase.Signature", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Signature", + "referencedDeclaration": 293, + "type": "struct SignatureBase.Signature" + }, + "id": 401, + "name": "UserDefinedTypeName", + "src": "9528:9:0" + } + ], + "id": 402, + "name": "VariableDeclaration", + "src": "9528:27:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct SignatureBase.Signature storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 403, + "name": "Identifier", + "src": "9558:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 377, + "type": "uint256", + "value": "_signatureId" + }, + "id": 404, + "name": "Identifier", + "src": "9569:12:0" + } + ], + "id": 405, + "name": "IndexAccess", + "src": "9558:24:0" + } + ], + "id": 406, + "name": "VariableDeclarationStatement", + "src": "9528:54:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "revoked", + "referencedDeclaration": 292, + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 402, + "type": "struct SignatureBase.Signature storage pointer", + "value": "signature" + }, + "id": 407, + "name": "Identifier", + "src": "9593:9:0" + } + ], + "id": 409, + "name": "MemberAccess", + "src": "9593:17:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "74727565", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "bool", + "type": "bool", + "value": "true" + }, + "id": 410, + "name": "Literal", + "src": "9613:4:0" + } + ], + "id": 411, + "name": "Assignment", + "src": "9593:24:0" + } + ], + "id": 412, + "name": "ExpressionStatement", + "src": "9593:24:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "--", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 300, + "type": "mapping(uint256 => uint256)", + "value": "deviceSignatureCount" + }, + "id": 413, + "name": "Identifier", + "src": "9628:20:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "deviceId", + "referencedDeclaration": 288, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 402, + "type": "struct SignatureBase.Signature storage pointer", + "value": "signature" + }, + "id": 414, + "name": "Identifier", + "src": "9649:9:0" + } + ], + "id": 415, + "name": "MemberAccess", + "src": "9649:18:0" + } + ], + "id": 416, + "name": "IndexAccess", + "src": "9628:40:0" + } + ], + "id": 417, + "name": "UnaryOperation", + "src": "9628:42:0" + } + ], + "id": 418, + "name": "ExpressionStatement", + "src": "9628:42:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 316, + "type": "function (uint256,uint256)", + "value": "SignatureRevoked" + }, + "id": 419, + "name": "Identifier", + "src": "9688:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 377, + "type": "uint256", + "value": "_signatureId" + }, + "id": 420, + "name": "Identifier", + "src": "9705:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "deviceId", + "referencedDeclaration": 288, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 402, + "type": "struct SignatureBase.Signature storage pointer", + "value": "signature" + }, + "id": 421, + "name": "Identifier", + "src": "9719:9:0" + } + ], + "id": 422, + "name": "MemberAccess", + "src": "9719:18:0" + } + ], + "id": 423, + "name": "FunctionCall", + "src": "9688:50:0" + } + ], + "id": 424, + "name": "EmitStatement", + "src": "9683:55:0" + } + ], + "id": 425, + "name": "Block", + "src": "9314:432:0" + } + ], + "id": 426, + "name": "FunctionDefinition", + "src": "9263:483:0" + } + ], + "id": 427, + "name": "ContractDefinition", + "src": "7214:2535:0" + }, + { + "attributes": { + "contractDependencies": [ + 427 + ], + "contractKind": "contract", + "documentation": "@title Provides extra functionalities for signatures.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 494, + 427 + ], + "name": "SignatureHelper", + "scope": 647 + }, + "children": [ + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "SignatureBase", + "referencedDeclaration": 427, + "type": "contract SignatureBase" + }, + "id": 428, + "name": "UserDefinedTypeName", + "src": "9849:13:0" + } + ], + "id": 429, + "name": "InheritanceSpecifier", + "src": "9849:13:0" + }, + { + "attributes": { + "documentation": "@notice Gets all signatures for specific device. \n@dev Use this function instead of filtering DeviceSigned event since signatures could have been revoked.\n@param _deviceId ID of a device.\n@return Array of signature IDs.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": [ + null + ], + "name": "getActiveSignaturesForDevice", + "scope": 494, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 493, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 430, + "name": "ElementaryTypeName", + "src": "10178:4:0" + } + ], + "id": 431, + "name": "VariableDeclaration", + "src": "10178:14:0" + } + ], + "id": 432, + "name": "ParameterList", + "src": "10177:16:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 493, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 433, + "name": "ElementaryTypeName", + "src": "10215:4:0" + } + ], + "id": 434, + "name": "ArrayTypeName", + "src": "10215:6:0" + } + ], + "id": 435, + "name": "VariableDeclaration", + "src": "10215:13:0" + } + ], + "id": 436, + "name": "ParameterList", + "src": "10214:15:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 440 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "signatureIds", + "scope": 492, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 438, + "name": "ElementaryTypeName", + "src": "10241:4:0" + } + ], + "id": 439, + "name": "ArrayTypeName", + "src": "10241:6:0" + } + ], + "id": 440, + "name": "VariableDeclaration", + "src": "10241:26:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256[] memory", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "function (uint256) pure returns (uint256[] memory)" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "uint256[]" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 441, + "name": "ElementaryTypeName", + "src": "10274:4:0" + } + ], + "id": 442, + "name": "ArrayTypeName", + "src": "10274:6:0" + } + ], + "id": 443, + "name": "NewExpression", + "src": "10270:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 300, + "type": "mapping(uint256 => uint256)", + "value": "deviceSignatureCount" + }, + "id": 444, + "name": "Identifier", + "src": "10281:20:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 431, + "type": "uint256", + "value": "_deviceId" + }, + "id": 445, + "name": "Identifier", + "src": "10302:9:0" + } + ], + "id": 446, + "name": "IndexAccess", + "src": "10281:31:0" + } + ], + "id": 447, + "name": "FunctionCall", + "src": "10270:43:0" + } + ], + "id": 448, + "name": "VariableDeclarationStatement", + "src": "10241:72:0" + }, + { + "attributes": { + "assignments": [ + 450 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "counter", + "scope": 492, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 449, + "name": "ElementaryTypeName", + "src": "10324:4:0" + } + ], + "id": 450, + "name": "VariableDeclaration", + "src": "10324:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 451, + "name": "Literal", + "src": "10339:1:0" + } + ], + "id": 452, + "name": "VariableDeclarationStatement", + "src": "10324:16:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 454 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "i", + "scope": 489, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 453, + "name": "ElementaryTypeName", + "src": "10356:4:0" + } + ], + "id": 454, + "name": "VariableDeclaration", + "src": "10356:6:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 455, + "name": "Literal", + "src": "10365:1:0" + } + ], + "id": 456, + "name": "VariableDeclarationStatement", + "src": "10356:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "<", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 454, + "type": "uint256", + "value": "i" + }, + "id": 457, + "name": "Identifier", + "src": "10368:1:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "length", + "referencedDeclaration": null, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 458, + "name": "Identifier", + "src": "10372:10:0" + } + ], + "id": 459, + "name": "MemberAccess", + "src": "10372:17:0" + } + ], + "id": 460, + "name": "BinaryOperation", + "src": "10368:21:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 454, + "type": "uint256", + "value": "i" + }, + "id": 461, + "name": "Identifier", + "src": "10391:1:0" + } + ], + "id": 462, + "name": "UnaryOperation", + "src": "10391:3:0" + } + ], + "id": 463, + "name": "ExpressionStatement", + "src": "10391:3:0" + }, + { + "children": [ + { + "attributes": { + "falseBody": null + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "&&", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "deviceId", + "referencedDeclaration": 288, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct SignatureBase.Signature storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 464, + "name": "Identifier", + "src": "10415:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 454, + "type": "uint256", + "value": "i" + }, + "id": 465, + "name": "Identifier", + "src": "10426:1:0" + } + ], + "id": 466, + "name": "IndexAccess", + "src": "10415:13:0" + } + ], + "id": 467, + "name": "MemberAccess", + "src": "10415:22:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 431, + "type": "uint256", + "value": "_deviceId" + }, + "id": 468, + "name": "Identifier", + "src": "10441:9:0" + } + ], + "id": 469, + "name": "BinaryOperation", + "src": "10415:35:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "revoked", + "referencedDeclaration": 292, + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct SignatureBase.Signature storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 296, + "type": "struct SignatureBase.Signature storage ref[] storage ref", + "value": "signatures" + }, + "id": 470, + "name": "Identifier", + "src": "10454:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 454, + "type": "uint256", + "value": "i" + }, + "id": 471, + "name": "Identifier", + "src": "10465:1:0" + } + ], + "id": 472, + "name": "IndexAccess", + "src": "10454:13:0" + } + ], + "id": 473, + "name": "MemberAccess", + "src": "10454:21:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "66616c7365", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "bool", + "type": "bool", + "value": "false" + }, + "id": 474, + "name": "Literal", + "src": "10479:5:0" + } + ], + "id": 475, + "name": "BinaryOperation", + "src": "10454:30:0" + } + ], + "id": 476, + "name": "BinaryOperation", + "src": "10415:69:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 440, + "type": "uint256[] memory", + "value": "signatureIds" + }, + "id": 477, + "name": "Identifier", + "src": "10505:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 450, + "type": "uint256", + "value": "counter" + }, + "id": 478, + "name": "Identifier", + "src": "10518:7:0" + } + ], + "id": 479, + "name": "IndexAccess", + "src": "10505:21:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 454, + "type": "uint256", + "value": "i" + }, + "id": 480, + "name": "Identifier", + "src": "10529:1:0" + } + ], + "id": 481, + "name": "Assignment", + "src": "10505:25:0" + } + ], + "id": 482, + "name": "ExpressionStatement", + "src": "10505:25:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 450, + "type": "uint256", + "value": "counter" + }, + "id": 483, + "name": "Identifier", + "src": "10549:7:0" + } + ], + "id": 484, + "name": "UnaryOperation", + "src": "10549:9:0" + } + ], + "id": 485, + "name": "ExpressionStatement", + "src": "10549:9:0" + } + ], + "id": 486, + "name": "Block", + "src": "10486:88:0" + } + ], + "id": 487, + "name": "IfStatement", + "src": "10411:163:0" + } + ], + "id": 488, + "name": "Block", + "src": "10396:189:0" + } + ], + "id": 489, + "name": "ForStatement", + "src": "10351:234:0" + }, + { + "attributes": { + "functionReturnParameters": 436 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 440, + "type": "uint256[] memory", + "value": "signatureIds" + }, + "id": 490, + "name": "Identifier", + "src": "10602:12:0" + } + ], + "id": 491, + "name": "Return", + "src": "10595:19:0" + } + ], + "id": 492, + "name": "Block", + "src": "10230:392:0" + } + ], + "id": 493, + "name": "FunctionDefinition", + "src": "10140:482:0" + } + ], + "id": 494, + "name": "ContractDefinition", + "src": "9821:804:0" + }, + { + "attributes": { + "contractDependencies": [ + 131, + 284, + 427, + 494 + ], + "contractKind": "contract", + "documentation": "@title Enriches devices giving them option to be updated only if not signed already.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 641, + 494, + 427, + 284, + 131 + ], + "name": "DeviceUpdatable", + "scope": 647 + }, + "children": [ + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "DeviceHelper", + "referencedDeclaration": 284, + "type": "contract DeviceHelper" + }, + "id": 495, + "name": "UserDefinedTypeName", + "src": "10756:12:0" + } + ], + "id": 496, + "name": "InheritanceSpecifier", + "src": "10756:12:0" + }, + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "SignatureHelper", + "referencedDeclaration": 494, + "type": "contract SignatureHelper" + }, + "id": 497, + "name": "UserDefinedTypeName", + "src": "10770:15:0" + } + ], + "id": 498, + "name": "InheritanceSpecifier", + "src": "10770:15:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired on device ownership transfer, keeps track of historical device owners.", + "name": "DeviceTransfered" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "deviceId", + "scope": 506, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 499, + "name": "ElementaryTypeName", + "src": "10907:4:0" + } + ], + "id": 500, + "name": "VariableDeclaration", + "src": "10907:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "oldOwner", + "scope": 506, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 501, + "name": "ElementaryTypeName", + "src": "10930:7:0" + } + ], + "id": 502, + "name": "VariableDeclaration", + "src": "10930:16:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "newOwner", + "scope": 506, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 503, + "name": "ElementaryTypeName", + "src": "10948:7:0" + } + ], + "id": 504, + "name": "VariableDeclaration", + "src": "10948:16:0" + } + ], + "id": 505, + "name": "ParameterList", + "src": "10906:59:0" + } + ], + "id": 506, + "name": "EventDefinition", + "src": "10884:82:0" + }, + { + "attributes": { + "anonymous": false, + "documentation": "@dev Fired on device property update, keeps track of historical property values.", + "name": "DevicePropertyUpdated" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": true, + "name": "deviceId", + "scope": 514, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 507, + "name": "ElementaryTypeName", + "src": "11096:4:0" + } + ], + "id": 508, + "name": "VariableDeclaration", + "src": "11096:21:0" + }, + { + "attributes": { + "constant": false, + "indexed": true, + "name": "property", + "scope": 514, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 509, + "name": "ElementaryTypeName", + "src": "11119:7:0" + } + ], + "id": 510, + "name": "VariableDeclaration", + "src": "11119:24:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "newValue", + "scope": 514, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 511, + "name": "ElementaryTypeName", + "src": "11145:7:0" + } + ], + "id": 512, + "name": "VariableDeclaration", + "src": "11145:16:0" + } + ], + "id": 513, + "name": "ParameterList", + "src": "11095:67:0" + } + ], + "id": 514, + "name": "EventDefinition", + "src": "11068:95:0" + }, + { + "attributes": { + "documentation": "@notice Transfer device ownership from one external account to another. Emits DeviceTransfered.\n@param _deviceId ID of to be transfered device.\n@param _to Address of new owner.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "transferDevice", + "scope": 641, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 559, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 515, + "name": "ElementaryTypeName", + "src": "11414:4:0" + } + ], + "id": 516, + "name": "VariableDeclaration", + "src": "11414:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_to", + "scope": 559, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 517, + "name": "ElementaryTypeName", + "src": "11430:7:0" + } + ], + "id": 518, + "name": "VariableDeclaration", + "src": "11430:11:0" + } + ], + "id": 519, + "name": "ParameterList", + "src": "11413:29:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 526, + "name": "ParameterList", + "src": "11494:0:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 82, + "type": "modifier (uint256)", + "value": "onlyOwnerOf" + }, + "id": 520, + "name": "Identifier", + "src": "11450:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 516, + "type": "uint256", + "value": "_deviceId" + }, + "id": 521, + "name": "Identifier", + "src": "11462:9:0" + } + ], + "id": 522, + "name": "ModifierInvocation", + "src": "11450:22:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 331, + "type": "modifier (uint256)", + "value": "notSigned" + }, + "id": 523, + "name": "Identifier", + "src": "11473:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 516, + "type": "uint256", + "value": "_deviceId" + }, + "id": 524, + "name": "Identifier", + "src": "11483:9:0" + } + ], + "id": 525, + "name": "ModifierInvocation", + "src": "11473:20:0" + }, + { + "children": [ + { + "attributes": { + "assignments": [ + 528 + ] + }, + "children": [ + { + "attributes": { + "constant": false, + "name": "currentOwner", + "scope": 558, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 527, + "name": "ElementaryTypeName", + "src": "11505:7:0" + } + ], + "id": 528, + "name": "VariableDeclaration", + "src": "11505:20:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "owner", + "referencedDeclaration": 39, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 529, + "name": "Identifier", + "src": "11528:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 516, + "type": "uint256", + "value": "_deviceId" + }, + "id": 530, + "name": "Identifier", + "src": "11536:9:0" + } + ], + "id": 531, + "name": "IndexAccess", + "src": "11528:18:0" + } + ], + "id": 532, + "name": "MemberAccess", + "src": "11528:24:0" + } + ], + "id": 533, + "name": "VariableDeclarationStatement", + "src": "11505:47:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "owner", + "referencedDeclaration": 39, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 534, + "name": "Identifier", + "src": "11563:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 516, + "type": "uint256", + "value": "_deviceId" + }, + "id": 535, + "name": "Identifier", + "src": "11571:9:0" + } + ], + "id": 536, + "name": "IndexAccess", + "src": "11563:18:0" + } + ], + "id": 537, + "name": "MemberAccess", + "src": "11563:24:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 518, + "type": "address", + "value": "_to" + }, + "id": 538, + "name": "Identifier", + "src": "11590:3:0" + } + ], + "id": 539, + "name": "Assignment", + "src": "11563:30:0" + } + ], + "id": 540, + "name": "ExpressionStatement", + "src": "11563:30:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "--", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => uint256)", + "value": "ownerDeviceCount" + }, + "id": 541, + "name": "Identifier", + "src": "11604:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address payable" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 868, + "type": "msg", + "value": "msg" + }, + "id": 542, + "name": "Identifier", + "src": "11621:3:0" + } + ], + "id": 543, + "name": "MemberAccess", + "src": "11621:10:0" + } + ], + "id": 544, + "name": "IndexAccess", + "src": "11604:28:0" + } + ], + "id": 545, + "name": "UnaryOperation", + "src": "11604:30:0" + } + ], + "id": 546, + "name": "ExpressionStatement", + "src": "11604:30:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => uint256)", + "value": "ownerDeviceCount" + }, + "id": 547, + "name": "Identifier", + "src": "11645:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 518, + "type": "address", + "value": "_to" + }, + "id": 548, + "name": "Identifier", + "src": "11662:3:0" + } + ], + "id": 549, + "name": "IndexAccess", + "src": "11645:21:0" + } + ], + "id": 550, + "name": "UnaryOperation", + "src": "11645:23:0" + } + ], + "id": 551, + "name": "ExpressionStatement", + "src": "11645:23:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 506, + "type": "function (uint256,address,address)", + "value": "DeviceTransfered" + }, + "id": 552, + "name": "Identifier", + "src": "11686:16:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 516, + "type": "uint256", + "value": "_deviceId" + }, + "id": 553, + "name": "Identifier", + "src": "11703:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 528, + "type": "address", + "value": "currentOwner" + }, + "id": 554, + "name": "Identifier", + "src": "11714:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 518, + "type": "address", + "value": "_to" + }, + "id": 555, + "name": "Identifier", + "src": "11728:3:0" + } + ], + "id": 556, + "name": "FunctionCall", + "src": "11686:46:0" + } + ], + "id": 557, + "name": "EmitStatement", + "src": "11681:51:0" + } + ], + "id": 558, + "name": "Block", + "src": "11494:246:0" + } + ], + "id": 559, + "name": "FunctionDefinition", + "src": "11390:350:0" + }, + { + "attributes": { + "documentation": "@notice Update device with new identifier. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newIdentifier New identifier.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "updateIdentifier", + "scope": 641, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 586, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 560, + "name": "ElementaryTypeName", + "src": "11960:4:0" + } + ], + "id": 561, + "name": "VariableDeclaration", + "src": "11960:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_newIdentifier", + "scope": 586, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 562, + "name": "ElementaryTypeName", + "src": "11976:7:0" + } + ], + "id": 563, + "name": "VariableDeclaration", + "src": "11976:22:0" + } + ], + "id": 564, + "name": "ParameterList", + "src": "11959:40:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 571, + "name": "ParameterList", + "src": "12051:0:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 82, + "type": "modifier (uint256)", + "value": "onlyOwnerOf" + }, + "id": 565, + "name": "Identifier", + "src": "12007:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 561, + "type": "uint256", + "value": "_deviceId" + }, + "id": 566, + "name": "Identifier", + "src": "12019:9:0" + } + ], + "id": 567, + "name": "ModifierInvocation", + "src": "12007:22:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 331, + "type": "modifier (uint256)", + "value": "notSigned" + }, + "id": 568, + "name": "Identifier", + "src": "12030:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 561, + "type": "uint256", + "value": "_deviceId" + }, + "id": 569, + "name": "Identifier", + "src": "12040:9:0" + } + ], + "id": 570, + "name": "ModifierInvocation", + "src": "12030:20:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "identifier", + "referencedDeclaration": 41, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 572, + "name": "Identifier", + "src": "12062:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 561, + "type": "uint256", + "value": "_deviceId" + }, + "id": 573, + "name": "Identifier", + "src": "12070:9:0" + } + ], + "id": 574, + "name": "IndexAccess", + "src": "12062:18:0" + } + ], + "id": 575, + "name": "MemberAccess", + "src": "12062:29:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 563, + "type": "bytes32", + "value": "_newIdentifier" + }, + "id": 576, + "name": "Identifier", + "src": "12094:14:0" + } + ], + "id": 577, + "name": "Assignment", + "src": "12062:46:0" + } + ], + "id": 578, + "name": "ExpressionStatement", + "src": "12062:46:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_c9c8fb0ee362b7a8868ca48cc94ee58e323adab92aeaba9c12b8aa7dca5fe466", + "typeString": "literal_string \"identifier\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 514, + "type": "function (uint256,bytes32,bytes32)", + "value": "DevicePropertyUpdated" + }, + "id": 579, + "name": "Identifier", + "src": "12126:21:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 561, + "type": "uint256", + "value": "_deviceId" + }, + "id": 580, + "name": "Identifier", + "src": "12148:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "6964656e746966696572", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"identifier\"", + "value": "identifier" + }, + "id": 581, + "name": "Literal", + "src": "12159:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 563, + "type": "bytes32", + "value": "_newIdentifier" + }, + "id": 582, + "name": "Identifier", + "src": "12173:14:0" + } + ], + "id": 583, + "name": "FunctionCall", + "src": "12126:62:0" + } + ], + "id": 584, + "name": "EmitStatement", + "src": "12121:67:0" + } + ], + "id": 585, + "name": "Block", + "src": "12051:145:0" + } + ], + "id": 586, + "name": "FunctionDefinition", + "src": "11934:262:0" + }, + { + "attributes": { + "documentation": "@notice Update device with new metadata hash. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newMetadataHash New metadata hash.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "updateMetadataHash", + "scope": 641, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 613, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 587, + "name": "ElementaryTypeName", + "src": "12425:4:0" + } + ], + "id": 588, + "name": "VariableDeclaration", + "src": "12425:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_newMetadataHash", + "scope": 613, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 589, + "name": "ElementaryTypeName", + "src": "12441:7:0" + } + ], + "id": 590, + "name": "VariableDeclaration", + "src": "12441:24:0" + } + ], + "id": 591, + "name": "ParameterList", + "src": "12424:42:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 598, + "name": "ParameterList", + "src": "12518:0:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 82, + "type": "modifier (uint256)", + "value": "onlyOwnerOf" + }, + "id": 592, + "name": "Identifier", + "src": "12474:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 588, + "type": "uint256", + "value": "_deviceId" + }, + "id": 593, + "name": "Identifier", + "src": "12486:9:0" + } + ], + "id": 594, + "name": "ModifierInvocation", + "src": "12474:22:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 331, + "type": "modifier (uint256)", + "value": "notSigned" + }, + "id": 595, + "name": "Identifier", + "src": "12497:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 588, + "type": "uint256", + "value": "_deviceId" + }, + "id": 596, + "name": "Identifier", + "src": "12507:9:0" + } + ], + "id": 597, + "name": "ModifierInvocation", + "src": "12497:20:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "metadataHash", + "referencedDeclaration": 43, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 599, + "name": "Identifier", + "src": "12529:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 588, + "type": "uint256", + "value": "_deviceId" + }, + "id": 600, + "name": "Identifier", + "src": "12537:9:0" + } + ], + "id": 601, + "name": "IndexAccess", + "src": "12529:18:0" + } + ], + "id": 602, + "name": "MemberAccess", + "src": "12529:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 590, + "type": "bytes32", + "value": "_newMetadataHash" + }, + "id": 603, + "name": "Identifier", + "src": "12563:16:0" + } + ], + "id": 604, + "name": "Assignment", + "src": "12529:50:0" + } + ], + "id": 605, + "name": "ExpressionStatement", + "src": "12529:50:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_7a9d3a032b8ff274f09714b56ba8e5ed776ec9638ca303069bc3a3267bb22f65", + "typeString": "literal_string \"metadata\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 514, + "type": "function (uint256,bytes32,bytes32)", + "value": "DevicePropertyUpdated" + }, + "id": 606, + "name": "Identifier", + "src": "12597:21:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 588, + "type": "uint256", + "value": "_deviceId" + }, + "id": 607, + "name": "Identifier", + "src": "12619:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "6d65746164617461", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"metadata\"", + "value": "metadata" + }, + "id": 608, + "name": "Literal", + "src": "12630:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 590, + "type": "bytes32", + "value": "_newMetadataHash" + }, + "id": 609, + "name": "Identifier", + "src": "12642:16:0" + } + ], + "id": 610, + "name": "FunctionCall", + "src": "12597:62:0" + } + ], + "id": 611, + "name": "EmitStatement", + "src": "12592:67:0" + } + ], + "id": 612, + "name": "Block", + "src": "12518:149:0" + } + ], + "id": 613, + "name": "FunctionDefinition", + "src": "12397:270:0" + }, + { + "attributes": { + "documentation": "@notice Update device with new firmware hash. Emits DevicePropertyUpdated.\n@param _deviceId ID of a device.\n@param _newFirmwareHash New firmware hash.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "updateFirmwareHash", + "scope": 641, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "_deviceId", + "scope": 640, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 614, + "name": "ElementaryTypeName", + "src": "12896:4:0" + } + ], + "id": 615, + "name": "VariableDeclaration", + "src": "12896:14:0" + }, + { + "attributes": { + "constant": false, + "name": "_newFirmwareHash", + "scope": 640, + "stateVariable": false, + "storageLocation": "default", + "type": "bytes32", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "bytes32", + "type": "bytes32" + }, + "id": 616, + "name": "ElementaryTypeName", + "src": "12912:7:0" + } + ], + "id": 617, + "name": "VariableDeclaration", + "src": "12912:24:0" + } + ], + "id": 618, + "name": "ParameterList", + "src": "12895:42:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 625, + "name": "ParameterList", + "src": "12989:0:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 82, + "type": "modifier (uint256)", + "value": "onlyOwnerOf" + }, + "id": 619, + "name": "Identifier", + "src": "12945:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 615, + "type": "uint256", + "value": "_deviceId" + }, + "id": 620, + "name": "Identifier", + "src": "12957:9:0" + } + ], + "id": 621, + "name": "ModifierInvocation", + "src": "12945:22:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 331, + "type": "modifier (uint256)", + "value": "notSigned" + }, + "id": 622, + "name": "Identifier", + "src": "12968:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 615, + "type": "uint256", + "value": "_deviceId" + }, + "id": 623, + "name": "Identifier", + "src": "12978:9:0" + } + ], + "id": 624, + "name": "ModifierInvocation", + "src": "12968:20:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "firmwareHash", + "referencedDeclaration": 45, + "type": "bytes32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct DeviceBase.Device storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 49, + "type": "struct DeviceBase.Device storage ref[] storage ref", + "value": "devices" + }, + "id": 626, + "name": "Identifier", + "src": "13000:7:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 615, + "type": "uint256", + "value": "_deviceId" + }, + "id": 627, + "name": "Identifier", + "src": "13008:9:0" + } + ], + "id": 628, + "name": "IndexAccess", + "src": "13000:18:0" + } + ], + "id": 629, + "name": "MemberAccess", + "src": "13000:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 617, + "type": "bytes32", + "value": "_newFirmwareHash" + }, + "id": 630, + "name": "Identifier", + "src": "13034:16:0" + } + ], + "id": 631, + "name": "Assignment", + "src": "13000:50:0" + } + ], + "id": 632, + "name": "ExpressionStatement", + "src": "13000:50:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_99ae24b5e16982fa6bd82ac48369a10e6c7145bd48234d69ccfd0f110eb2e630", + "typeString": "literal_string \"firmware\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 514, + "type": "function (uint256,bytes32,bytes32)", + "value": "DevicePropertyUpdated" + }, + "id": 633, + "name": "Identifier", + "src": "13068:21:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 615, + "type": "uint256", + "value": "_deviceId" + }, + "id": 634, + "name": "Identifier", + "src": "13090:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "6669726d77617265", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string \"firmware\"", + "value": "firmware" + }, + "id": 635, + "name": "Literal", + "src": "13101:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 617, + "type": "bytes32", + "value": "_newFirmwareHash" + }, + "id": 636, + "name": "Identifier", + "src": "13113:16:0" + } + ], + "id": 637, + "name": "FunctionCall", + "src": "13068:62:0" + } + ], + "id": 638, + "name": "EmitStatement", + "src": "13063:67:0" + } + ], + "id": 639, + "name": "Block", + "src": "12989:149:0" + } + ], + "id": 640, + "name": "FunctionDefinition", + "src": "12868:270:0" + } + ], + "id": 641, + "name": "ContractDefinition", + "src": "10728:2413:0" + }, + { + "attributes": { + "contractDependencies": [ + 37, + 131, + 284, + 427, + 494, + 641 + ], + "contractKind": "contract", + "documentation": "@title Device manager core contract.", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 646, + 641, + 494, + 427, + 284, + 131, + 37 + ], + "name": "DeviceManager", + "nodes": [ + null + ], + "scope": 647 + }, + "children": [ + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "EntityBase", + "referencedDeclaration": 37, + "type": "contract EntityBase" + }, + "id": 642, + "name": "UserDefinedTypeName", + "src": "13213:10:0" + } + ], + "id": 643, + "name": "InheritanceSpecifier", + "src": "13213:10:0" + }, + { + "attributes": { + "arguments": null + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "DeviceUpdatable", + "referencedDeclaration": 641, + "type": "contract DeviceUpdatable" + }, + "id": 644, + "name": "UserDefinedTypeName", + "src": "13225:15:0" + } + ], + "id": 645, + "name": "InheritanceSpecifier", + "src": "13225:15:0" + } + ], + "id": 646, + "name": "ContractDefinition", + "src": "13187:90:0" + } + ], + "id": 647, + "name": "SourceUnit", + "src": "0:13279:0" + }, + "compiler": { + "name": "solc", + "version": "0.5.16+commit.9c3226ce.Emscripten.clang" + }, + "networks": { + "5777": { + "events": {}, + "links": {}, + "address": "0x06fd91753BD777298E0C9982fdF79A3aa5F254DE", + "transactionHash": "0x1b47081134f5b9ac71c5ea2f0306d94a571e393f1c0898eecdb1e28b86c42b7d" + } + }, + "schemaVersion": "3.4.16", + "updatedAt": "2024-06-05T07:14:50.760Z", + "networkType": "ethereum", + "devdoc": { + "methods": { + "createDevice(bytes32,bytes32,bytes32)": { + "params": { + "_firmwareHash": "Hash of actual firmware hash.", + "_identifier": "Unique device identifier, such as fingerprint of RSA/ECC public key or Ethereum address (recommended).", + "_metadataHash": "Merkle root hash of metadata (recommended) or simple hash of concatenated metadata." + }, + "return": "Created device ID." + }, + "getActiveSignaturesForDevice(uint256)": { + "details": "Use this function instead of filtering DeviceSigned event since signatures could have been revoked.", + "params": { + "_deviceId": "ID of a device." + }, + "return": "Array of signature IDs." + }, + "getDevicesByOwner(address)": { + "details": "Use this function instead of filtering DeviceCreated event since devices could have been transferred between owners.", + "params": { + "_owner": "Owner address." + }, + "return": "Array of device IDs." + }, + "isDeviceAnEntity(uint256)": { + "params": { + "_deviceId": "ID of a device." + }, + "return": "Boolean status." + }, + "isValidEthMessage(uint256,bytes32,bytes)": { + "params": { + "_deviceId": "ID of a device that signed the message.", + "_messageHash": "Hash of sent message.", + "_signature": "Signature generated using web3.eth.sign()." + }, + "return": "Boolean status." + }, + "isValidFirmwareHash(uint256,bytes32)": { + "params": { + "_deviceId": "ID of a device containing firmware hash.", + "_firmwareHash": "Firmware hash (not the actual hash)." + }, + "return": "Boolean status." + }, + "isValidMetadataMember(uint256,bytes32[],bytes32)": { + "params": { + "_deviceId": "ID of a device containing metadata hash.", + "_leaf": "Leaf of Merkle tree.", + "_proof": "Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree." + }, + "return": "Boolean status." + }, + "revokeSignature(uint256)": { + "params": { + "_signatureId": "ID of to be revoked signature." + } + }, + "signDevice(uint256,uint256)": { + "params": { + "_deviceId": "ID of to be signed device.", + "_expiryTime": "Expiry time in Unix seconds." + }, + "return": "Created signature ID." + }, + "transferDevice(uint256,address)": { + "params": { + "_deviceId": "ID of to be transfered device.", + "_to": "Address of new owner." + } + }, + "updateEntityData(string)": { + "params": { + "_data": "Entity data." + } + }, + "updateFirmwareHash(uint256,bytes32)": { + "params": { + "_deviceId": "ID of a device.", + "_newFirmwareHash": "New firmware hash." + } + }, + "updateIdentifier(uint256,bytes32)": { + "params": { + "_deviceId": "ID of a device.", + "_newIdentifier": "New identifier." + } + }, + "updateMetadataHash(uint256,bytes32)": { + "params": { + "_deviceId": "ID of a device.", + "_newMetadataHash": "New metadata hash." + } + } + }, + "title": "Device manager core contract." + }, + "userdoc": { + "methods": { + "createDevice(bytes32,bytes32,bytes32)": { + "notice": "Creates and saves device into storage. Emits DeviceCreated. " + }, + "getActiveSignaturesForDevice(uint256)": { + "notice": "Gets all signatures for specific device. " + }, + "getDevicesByOwner(address)": { + "notice": "Gets all devices owned by specified address. " + }, + "isDeviceAnEntity(uint256)": { + "notice": "Checks if device is also an entity. " + }, + "isValidEthMessage(uint256,bytes32,bytes)": { + "notice": "Validate authenticity of message signed by Etherium private key. On-chain validation is available only for Ethereum signed messages." + }, + "isValidFirmwareHash(uint256,bytes32)": { + "notice": "Checks if provided firmware hash is equal to firmware hash device property. " + }, + "isValidMetadataMember(uint256,bytes32[],bytes32)": { + "notice": "Checks if provided leaf is a member of metadata contained in Merkle tree. Assumes that each pair of leaves and each pair of pre-images are sorted." + }, + "revokeSignature(uint256)": { + "notice": "Revokes a signature. Emits SignatureRevoked. " + }, + "signDevice(uint256,uint256)": { + "notice": "Signs a device and signature into storage. Emits DeviceSigned. " + }, + "transferDevice(uint256,address)": { + "notice": "Transfer device ownership from one external account to another. Emits DeviceTransfered." + }, + "updateEntityData(string)": { + "notice": "Update entity data." + }, + "updateFirmwareHash(uint256,bytes32)": { + "notice": "Update device with new firmware hash. Emits DevicePropertyUpdated." + }, + "updateIdentifier(uint256,bytes32)": { + "notice": "Update device with new identifier. Emits DevicePropertyUpdated." + }, + "updateMetadataHash(uint256,bytes32)": { + "notice": "Update device with new metadata hash. Emits DevicePropertyUpdated." + } + } + } +} \ No newline at end of file