706 lines
16 KiB
JSON
706 lines
16 KiB
JSON
{
|
|
"compiler": {
|
|
"version": "0.8.26+commit.8a97fa7a"
|
|
},
|
|
"language": "Solidity",
|
|
"output": {
|
|
"abi": [
|
|
{
|
|
"inputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "constructor"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "AccessControlBadConfirmation",
|
|
"type": "error"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "neededRole",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "AccessControlUnauthorizedAccount",
|
|
"type": "error"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "string",
|
|
"name": "fileName",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "string",
|
|
"name": "fileType",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "fileSize",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "FileMetadataUpdated",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "FileRemoved",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "string",
|
|
"name": "fileName",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "string",
|
|
"name": "fileType",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "fileSize",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "uploadTimestamp",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "FileUploaded",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "previousAdminRole",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "newAdminRole",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "RoleAdminChanged",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "RoleGranted",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": true,
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": true,
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "RoleRevoked",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "ADMIN_ROLE",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "DEFAULT_ADMIN_ROLE",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "UPLOADER_ROLE",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "fileExists",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bool",
|
|
"name": "",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "index",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "fileIdAt",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "getFileMetadata",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileName",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileType",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "fileSize",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "uploadTimestamp",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct Upload.FileMetadata",
|
|
"name": "",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "getRoleAdmin",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "grantRole",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "hasRole",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bool",
|
|
"name": "",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "removeFile",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "callerConfirmation",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "renounceRole",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "role",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "account",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "revokeRole",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes4",
|
|
"name": "interfaceId",
|
|
"type": "bytes4"
|
|
}
|
|
],
|
|
"name": "supportsInterface",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bool",
|
|
"name": "",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "totalFiles",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileId",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileName",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileType",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "fileSize",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "updateFileMetadata",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "fileHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileName",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "fileType",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "fileSize",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "uploadFile",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
}
|
|
],
|
|
"devdoc": {
|
|
"details": "This contract handles file uploads by managing metadata and associating files with their hashes.",
|
|
"errors": {
|
|
"AccessControlBadConfirmation()": [
|
|
{
|
|
"details": "The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."
|
|
}
|
|
],
|
|
"AccessControlUnauthorizedAccount(address,bytes32)": [
|
|
{
|
|
"details": "The `account` is missing a role."
|
|
}
|
|
]
|
|
},
|
|
"events": {
|
|
"RoleAdminChanged(bytes32,bytes32,bytes32)": {
|
|
"details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."
|
|
},
|
|
"RoleGranted(bytes32,address,address)": {
|
|
"details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."
|
|
},
|
|
"RoleRevoked(bytes32,address,address)": {
|
|
"details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"
|
|
}
|
|
},
|
|
"kind": "dev",
|
|
"methods": {
|
|
"fileExists(bytes32)": {
|
|
"details": "Checks if a file ID exists.",
|
|
"params": {
|
|
"fileId": "The ID of the file."
|
|
},
|
|
"returns": {
|
|
"_0": "True if the file exists, false otherwise."
|
|
}
|
|
},
|
|
"fileIdAt(uint256)": {
|
|
"details": "Returns a file ID at a specific index.",
|
|
"params": {
|
|
"index": "The index of the file ID."
|
|
},
|
|
"returns": {
|
|
"_0": "The file ID at the given index."
|
|
}
|
|
},
|
|
"getFileMetadata(bytes32)": {
|
|
"details": "Retrieves metadata for a given file ID.",
|
|
"params": {
|
|
"fileId": "The ID of the file."
|
|
},
|
|
"returns": {
|
|
"_0": "The file metadata."
|
|
}
|
|
},
|
|
"getRoleAdmin(bytes32)": {
|
|
"details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."
|
|
},
|
|
"grantRole(bytes32,address)": {
|
|
"details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event."
|
|
},
|
|
"hasRole(bytes32,address)": {
|
|
"details": "Returns `true` if `account` has been granted `role`."
|
|
},
|
|
"removeFile(bytes32)": {
|
|
"details": "Removes a file and its metadata.",
|
|
"params": {
|
|
"fileId": "The ID of the file to remove."
|
|
}
|
|
},
|
|
"renounceRole(bytes32,address)": {
|
|
"details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event."
|
|
},
|
|
"revokeRole(bytes32,address)": {
|
|
"details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event."
|
|
},
|
|
"supportsInterface(bytes4)": {
|
|
"details": "See {IERC165-supportsInterface}."
|
|
},
|
|
"totalFiles()": {
|
|
"details": "Returns the total number of files.",
|
|
"returns": {
|
|
"_0": "The number of files."
|
|
}
|
|
},
|
|
"updateFileMetadata(bytes32,string,string,uint256)": {
|
|
"details": "Updates metadata for a given file ID.",
|
|
"params": {
|
|
"fileId": "The ID of the file.",
|
|
"fileName": "The new name of the file.",
|
|
"fileSize": "The new size of the file in bytes.",
|
|
"fileType": "The new type/extension of the file."
|
|
}
|
|
},
|
|
"uploadFile(bytes32,string,string,uint256)": {
|
|
"details": "Allows an uploader to upload a file with its metadata.",
|
|
"params": {
|
|
"fileHash": "The hash of the file.",
|
|
"fileName": "The name of the file.",
|
|
"fileSize": "The size of the file in bytes.",
|
|
"fileType": "The type/extension of the file."
|
|
}
|
|
}
|
|
},
|
|
"title": "Upload",
|
|
"version": 1
|
|
},
|
|
"userdoc": {
|
|
"kind": "user",
|
|
"methods": {},
|
|
"version": 1
|
|
}
|
|
},
|
|
"settings": {
|
|
"compilationTarget": {
|
|
"contracts/infrastructure/storage/Upload.sol": "Upload"
|
|
},
|
|
"evmVersion": "cancun",
|
|
"libraries": {},
|
|
"metadata": {
|
|
"bytecodeHash": "ipfs"
|
|
},
|
|
"optimizer": {
|
|
"enabled": false,
|
|
"runs": 200
|
|
},
|
|
"remappings": []
|
|
},
|
|
"sources": {
|
|
"@openzeppelin/contracts/access/AccessControl.sol": {
|
|
"keccak256": "0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://46326c0bb1e296b67185e81c918e0b40501b8b6386165855df0a3f3c634b6a80",
|
|
"dweb:/ipfs/QmTwyrDYtsxsk6pymJTK94PnEpzsmkpUxFuzEiakDopy4Z"
|
|
]
|
|
},
|
|
"@openzeppelin/contracts/access/IAccessControl.sol": {
|
|
"keccak256": "0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://1fd2f35495652e57e3f99bc6c510bc5f7dd398a176ea2e72d8ed730aebc6ca26",
|
|
"dweb:/ipfs/QmTQV6X4gkikTib49cho5iDX3JvSQbdsoEChoDwrk3CbbH"
|
|
]
|
|
},
|
|
"@openzeppelin/contracts/utils/Context.sol": {
|
|
"keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12",
|
|
"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF"
|
|
]
|
|
},
|
|
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
|
|
"keccak256": "0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://1777404f1dcd0fac188e55a288724ec3c67b45288e49cc64723e95e702b49ab8",
|
|
"dweb:/ipfs/QmZFdC626GButBApwDUvvTnUzdinevC3B24d7yyh57XkiA"
|
|
]
|
|
},
|
|
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
|
|
"keccak256": "0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://87b3541437c8c443ccd36795e56a338ed12855eec17f8da624511b8d1a7e14df",
|
|
"dweb:/ipfs/QmeJQCtZrQjtJLr6u7ZHWeH3pBnjtLWzvRrKViAi7UZqxL"
|
|
]
|
|
},
|
|
"@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
|
|
"keccak256": "0x86c1470cbfd878491e5de030072b647352d36bd27122cffb928970b1945282aa",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://ad85dd393ee0a1917c57046abc5155f51f77844b2c6a42c05c1b8dd26d6ff3c1",
|
|
"dweb:/ipfs/QmNqYc8To2NdnpP6E1tGz7t6A7beuENde5yovwov5pW1fA"
|
|
]
|
|
},
|
|
"contracts/infrastructure/storage/Counters.sol": {
|
|
"keccak256": "0xa890b9e4d2416f5d25afb556b179358d64cb1023da660a2813a18b2a21e87025",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://3aa90aa1caa0112e22e77181daab2c43a665f142e1b0936b60700a0a76cc7c8a",
|
|
"dweb:/ipfs/QmXPWvW8dJGe1Vj8uPHMxPKXmWUVzP9W4i41SQcfLe7icY"
|
|
]
|
|
},
|
|
"contracts/infrastructure/storage/Upload.sol": {
|
|
"keccak256": "0x1a6889d2cacb57b1da49ce9605e411b27289a6c4c4dbd42a05d058a9bc8dede4",
|
|
"license": "MIT",
|
|
"urls": [
|
|
"bzz-raw://4e2d7e9001a97954e28d35f5f3befa0abc06e6fb1470becde62fc6f200a999da",
|
|
"dweb:/ipfs/QmQyGNgw1hHCFVcaqiBVKJ5raQmJ6RnLY6XPXPvfGUDRXD"
|
|
]
|
|
}
|
|
},
|
|
"version": 1
|
|
} |