diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js
index e20a672..3513504 100644
--- a/migrations/2_deploy_contracts.js
+++ b/migrations/2_deploy_contracts.js
@@ -1,5 +1,5 @@
-const DStorage = artifacts.require("DStorage");
+//Import Contractconst DStorage = artifacts.require("DStorage");
module.exports = function(deployer) {
- deployer.deploy(DStorage);
+ //Deploy Contract
};
diff --git a/src/abis/DStorage.json b/src/abis/DStorage.json
deleted file mode 100644
index 11f8b48..0000000
--- a/src/abis/DStorage.json
+++ /dev/null
@@ -1,4939 +0,0 @@
-{
- "contractName": "DStorage",
- "abi": [
- {
- "inputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "fileCount",
- "outputs": [
- {
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "files",
- "outputs": [
- {
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "internalType": "string",
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "internalType": "string",
- "name": "_fileHash",
- "type": "string"
- },
- {
- "internalType": "uint256",
- "name": "_fileSize",
- "type": "uint256"
- },
- {
- "internalType": "string",
- "name": "_fileType",
- "type": "string"
- },
- {
- "internalType": "string",
- "name": "_fileName",
- "type": "string"
- },
- {
- "internalType": "string",
- "name": "_fileDescription",
- "type": "string"
- }
- ],
- "name": "uploadFile",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- }
- ],
- "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fileId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"fileHash\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fileSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"fileType\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"fileDescription\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"uploadTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address payable\",\"name\":\"uploader\",\"type\":\"address\"}],\"name\":\"FileUploaded\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"fileCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"files\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"fileId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"fileHash\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"fileSize\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"fileType\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"fileDescription\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"uploadTime\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"uploader\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"_fileHash\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_fileSize\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_fileType\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_fileName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_fileDescription\",\"type\":\"string\"}],\"name\":\"uploadFile\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/mnt/c/pr0/dstorage/src/contracts/DStorage.sol\":\"DStorage\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/mnt/c/pr0/dstorage/src/contracts/DStorage.sol\":{\"keccak256\":\"0x245d0a0788aa6e2e3a8b3d2a224d1206adf7a9cd53ee8622d608cc60502b7842\",\"urls\":[\"bzz-raw://30b7f30b0a132dc9e7919981760e5d22108b43978a2ae194272555e5e9ee9478\",\"dweb:/ipfs/QmQwjuG6hWo7zvPMuzgysDPPBgqSwMAXKVEj61YWuQdGPk\"]}},\"version\":1}",
- "bytecode": "0x60806040526040518060400160405280600881526020017f4453746f726167650000000000000000000000000000000000000000000000008152506000908051906020019061004f929190610067565b50600060015534801561006157600080fd5b5061010c565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a857805160ff19168380011785556100d6565b828001600101855582156100d6579182015b828111156100d55782518255916020019190600101906100ba565b5b5090506100e391906100e7565b5090565b61010991905b808211156101055760008160009055506001016100ed565b5090565b90565b610e018061011b6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806306fdde031461005157806343953519146100d4578063e82d9d33146100f2578063f4c714b41461037c575b600080fd5b6100596105af565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561009957808201518184015260208101905061007e565b50505050905090810190601f1680156100c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100dc61064d565b6040518082815260200191505060405180910390f35b61037a600480360360a081101561010857600080fd5b810190808035906020019064010000000081111561012557600080fd5b82018360208201111561013757600080fd5b8035906020019184600183028401116401000000008311171561015957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460018302840111640100000000831117156101fa57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561025d57600080fd5b82018360208201111561026f57600080fd5b8035906020019184600183028401116401000000008311171561029157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102f457600080fd5b82018360208201111561030657600080fd5b8035906020019184600183028401116401000000008311171561032857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610653565b005b6103a86004803603602081101561039257600080fd5b8101908080359060200190929190505050610a5f565b60405180898152602001806020018881526020018060200180602001806020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185810385528c818151815260200191508051906020019080838360005b8381101561043857808201518184015260208101905061041d565b50505050905090810190601f1680156104655780820380516001836020036101000a031916815260200191505b5085810384528a818151815260200191508051906020019080838360005b8381101561049e578082015181840152602081019050610483565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b50858103835289818151815260200191508051906020019080838360005b838110156105045780820151818401526020810190506104e9565b50505050905090810190601f1680156105315780820380516001836020036101000a031916815260200191505b50858103825288818151815260200191508051906020019080838360005b8381101561056a57808201518184015260208101905061054f565b50505050905090810190601f1680156105975780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106455780601f1061061a57610100808354040283529160200191610645565b820191906000526020600020905b81548152906001019060200180831161062857829003601f168201915b505050505081565b60015481565b600085511161066157600080fd5b600083511161066f57600080fd5b600081511161067d57600080fd5b600082511161068b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156106c557600080fd5b600084116106d257600080fd5b60016000815480929190600101919050555060405180610100016040528060015481526020018681526020018581526020018481526020018381526020018281526020014281526020013373ffffffffffffffffffffffffffffffffffffffff16815250600260006001548152602001908152602001600020600082015181600001556020820151816001019080519060200190610771929190610d27565b50604082015181600201556060820151816003019080519060200190610798929190610d27565b5060808201518160040190805190602001906107b5929190610d27565b5060a08201518160050190805190602001906107d2929190610d27565b5060c0820151816006015560e08201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507f6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f526001548686868686423360405180898152602001806020018881526020018060200180602001806020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185810385528c818151815260200191508051906020019080838360005b838110156108e25780820151818401526020810190506108c7565b50505050905090810190601f16801561090f5780820380516001836020036101000a031916815260200191505b5085810384528a818151815260200191508051906020019080838360005b8381101561094857808201518184015260208101905061092d565b50505050905090810190601f1680156109755780820380516001836020036101000a031916815260200191505b50858103835289818151815260200191508051906020019080838360005b838110156109ae578082015181840152602081019050610993565b50505050905090810190601f1680156109db5780820380516001836020036101000a031916815260200191505b50858103825288818151815260200191508051906020019080838360005b83811015610a145780820151818401526020810190506109f9565b50505050905090810190601f168015610a415780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390a15050505050565b6002602052806000526040600020600091509050806000015490806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b115780601f10610ae657610100808354040283529160200191610b11565b820191906000526020600020905b815481529060010190602001808311610af457829003601f168201915b505050505090806002015490806003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bb55780601f10610b8a57610100808354040283529160200191610bb5565b820191906000526020600020905b815481529060010190602001808311610b9857829003601f168201915b505050505090806004018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b820191906000526020600020905b815481529060010190602001808311610c3657829003601f168201915b505050505090806005018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cf15780601f10610cc657610100808354040283529160200191610cf1565b820191906000526020600020905b815481529060010190602001808311610cd457829003601f168201915b5050505050908060060154908060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905088565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d6857805160ff1916838001178555610d96565b82800160010185558215610d96579182015b82811115610d95578251825591602001919060010190610d7a565b5b509050610da39190610da7565b5090565b610dc991905b80821115610dc5576000816000905550600101610dad565b5090565b9056fea265627a7a723158208b0d9e4a2a650f2ca7820b51014359e7ce0a859325fbcf55d153eeb3852e481364736f6c63430005100032",
- "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806306fdde031461005157806343953519146100d4578063e82d9d33146100f2578063f4c714b41461037c575b600080fd5b6100596105af565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561009957808201518184015260208101905061007e565b50505050905090810190601f1680156100c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100dc61064d565b6040518082815260200191505060405180910390f35b61037a600480360360a081101561010857600080fd5b810190808035906020019064010000000081111561012557600080fd5b82018360208201111561013757600080fd5b8035906020019184600183028401116401000000008311171561015957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460018302840111640100000000831117156101fa57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561025d57600080fd5b82018360208201111561026f57600080fd5b8035906020019184600183028401116401000000008311171561029157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102f457600080fd5b82018360208201111561030657600080fd5b8035906020019184600183028401116401000000008311171561032857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610653565b005b6103a86004803603602081101561039257600080fd5b8101908080359060200190929190505050610a5f565b60405180898152602001806020018881526020018060200180602001806020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185810385528c818151815260200191508051906020019080838360005b8381101561043857808201518184015260208101905061041d565b50505050905090810190601f1680156104655780820380516001836020036101000a031916815260200191505b5085810384528a818151815260200191508051906020019080838360005b8381101561049e578082015181840152602081019050610483565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b50858103835289818151815260200191508051906020019080838360005b838110156105045780820151818401526020810190506104e9565b50505050905090810190601f1680156105315780820380516001836020036101000a031916815260200191505b50858103825288818151815260200191508051906020019080838360005b8381101561056a57808201518184015260208101905061054f565b50505050905090810190601f1680156105975780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106455780601f1061061a57610100808354040283529160200191610645565b820191906000526020600020905b81548152906001019060200180831161062857829003601f168201915b505050505081565b60015481565b600085511161066157600080fd5b600083511161066f57600080fd5b600081511161067d57600080fd5b600082511161068b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156106c557600080fd5b600084116106d257600080fd5b60016000815480929190600101919050555060405180610100016040528060015481526020018681526020018581526020018481526020018381526020018281526020014281526020013373ffffffffffffffffffffffffffffffffffffffff16815250600260006001548152602001908152602001600020600082015181600001556020820151816001019080519060200190610771929190610d27565b50604082015181600201556060820151816003019080519060200190610798929190610d27565b5060808201518160040190805190602001906107b5929190610d27565b5060a08201518160050190805190602001906107d2929190610d27565b5060c0820151816006015560e08201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507f6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f526001548686868686423360405180898152602001806020018881526020018060200180602001806020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185810385528c818151815260200191508051906020019080838360005b838110156108e25780820151818401526020810190506108c7565b50505050905090810190601f16801561090f5780820380516001836020036101000a031916815260200191505b5085810384528a818151815260200191508051906020019080838360005b8381101561094857808201518184015260208101905061092d565b50505050905090810190601f1680156109755780820380516001836020036101000a031916815260200191505b50858103835289818151815260200191508051906020019080838360005b838110156109ae578082015181840152602081019050610993565b50505050905090810190601f1680156109db5780820380516001836020036101000a031916815260200191505b50858103825288818151815260200191508051906020019080838360005b83811015610a145780820151818401526020810190506109f9565b50505050905090810190601f168015610a415780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390a15050505050565b6002602052806000526040600020600091509050806000015490806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b115780601f10610ae657610100808354040283529160200191610b11565b820191906000526020600020905b815481529060010190602001808311610af457829003601f168201915b505050505090806002015490806003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bb55780601f10610b8a57610100808354040283529160200191610bb5565b820191906000526020600020905b815481529060010190602001808311610b9857829003601f168201915b505050505090806004018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b820191906000526020600020905b815481529060010190602001808311610c3657829003601f168201915b505050505090806005018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cf15780601f10610cc657610100808354040283529160200191610cf1565b820191906000526020600020905b815481529060010190602001808311610cd457829003601f168201915b5050505050908060060154908060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905088565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d6857805160ff1916838001178555610d96565b82800160010185558215610d96579182015b82811115610d95578251825591602001919060010190610d7a565b5b509050610da39190610da7565b5090565b610dc991905b80821115610dc5576000816000905550600101610dad565b5090565b9056fea265627a7a723158208b0d9e4a2a650f2ca7820b51014359e7ce0a859325fbcf55d153eeb3852e481364736f6c63430005100032",
- "sourceMap": "25:1522:0:-;;;47:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;106:1;82:25;;555:26;8:9:-1;5:2;;;30:1;27;20:12;5:2;555:26:0;25:1522;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
- "deployedSourceMap": "25:1522:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:1522:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;47:31;;;:::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;47:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;585:960;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;585:960:0;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;585:960:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;585:960: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;585:960: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;;585:960:0;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;585:960:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;585:960: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;585:960: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;;585:960:0;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;585:960:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;585:960: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;585:960: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;;585:960:0;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;585:960:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;585:960: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;585:960: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;;585:960:0;;;;;;;;;;;;;;;:::i;:::-;;111:34;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;111:34: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;111:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;111:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;111:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;111:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;47:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;82:25::-;;;;:::o;585:960::-;813:1;793:9;787:23;:27;779:36;;;;;;889:1;869:9;863:23;:27;855:36;;;;;;979:1;952:16;946:30;:34;938:43;;;;;;1059:1;1039:9;1033:23;:27;1025:36;;;;;;1136:1;1116:22;;:10;:22;;;;1108:31;;;;;;1205:1;1195:9;:11;1187:20;;;;;;1239:9;;:12;;;;;;;;;;;;;1309:94;;;;;;;;1314:9;;1309:94;;;;1325:9;1309:94;;;;1336:9;1309:94;;;;1347:9;1309:94;;;;1358:9;1309:94;;;;1369:16;1309:94;;;;1387:3;1309:94;;;;1392:10;1309:94;;;;;1290:5;:16;1296:9;;1290:16;;;;;;;;;;;:113;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1438:102;1451:9;;1462;1473;1484;1495;1506:16;1524:3;1529:10;1438:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;1438:102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;1438:102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;1438:102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;1438:102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;585:960;;;;;:::o;111:34::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;25:1522::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
- "source": "pragma solidity ^0.5.0;\n\ncontract DStorage {\n string public name = 'DStorage';\n uint public fileCount = 0;\n mapping(uint => File) public files;\n\n struct File {\n uint fileId;\n string fileHash;\n uint fileSize;\n string fileType;\n string fileName;\n string fileDescription;\n uint uploadTime;\n address payable uploader;\n }\n\n event FileUploaded(\n uint fileId,\n string fileHash,\n uint fileSize,\n string fileType,\n string fileName, \n string fileDescription,\n uint uploadTime,\n address payable uploader\n );\n\n constructor() public {\n }\n\n function uploadFile(string memory _fileHash, uint _fileSize, string memory _fileType, string memory _fileName, string memory _fileDescription) public {\n // Make sure the file hash exists\n require(bytes(_fileHash).length > 0);\n // Make sure file type exists\n require(bytes(_fileType).length > 0);\n // Make sure file description exists\n require(bytes(_fileDescription).length > 0);\n // Make sure file fileName exists\n require(bytes(_fileName).length > 0);\n // Make sure uploader address exists\n require(msg.sender!=address(0));\n // Make sure file size is more than 0\n require(_fileSize>0);\n\n // Increment file id\n fileCount ++;\n\n // Add File to the contract\n files[fileCount] = File(fileCount, _fileHash, _fileSize, _fileType, _fileName, _fileDescription, now, msg.sender);\n // Trigger an event\n emit FileUploaded(fileCount, _fileHash, _fileSize, _fileType, _fileName, _fileDescription, now, msg.sender);\n }\n}",
- "sourcePath": "/mnt/c/pr0/dstorage/src/contracts/DStorage.sol",
- "ast": {
- "absolutePath": "/mnt/c/pr0/dstorage/src/contracts/DStorage.sol",
- "exportedSymbols": {
- "DStorage": [
- 147
- ]
- },
- "id": 148,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 1,
- "literals": [
- "solidity",
- "^",
- "0.5",
- ".0"
- ],
- "nodeType": "PragmaDirective",
- "src": "0:23:0"
- },
- {
- "baseContracts": [],
- "contractDependencies": [],
- "contractKind": "contract",
- "documentation": null,
- "fullyImplemented": true,
- "id": 147,
- "linearizedBaseContracts": [
- 147
- ],
- "name": "DStorage",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "constant": false,
- "id": 4,
- "name": "name",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "47:31:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage",
- "typeString": "string"
- },
- "typeName": {
- "id": 2,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "47:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": {
- "argumentTypes": null,
- "hexValue": "4453746f72616765",
- "id": 3,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "string",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "68:10:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_stringliteral_71e44b0df098e49b64e3e857f58efe89334156a79fe51150de7d54015483635f",
- "typeString": "literal_string \"DStorage\""
- },
- "value": "DStorage"
- },
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 7,
- "name": "fileCount",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "82:25:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 5,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "82:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 6,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "106:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 11,
- "name": "files",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "111:34:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File)"
- },
- "typeName": {
- "id": 10,
- "keyType": {
- "id": 8,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "119:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "Mapping",
- "src": "111:21:0",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File)"
- },
- "valueType": {
- "contractScope": null,
- "id": 9,
- "name": "File",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 28,
- "src": "127:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage_ptr",
- "typeString": "struct DStorage.File"
- }
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "canonicalName": "DStorage.File",
- "id": 28,
- "members": [
- {
- "constant": false,
- "id": 13,
- "name": "fileId",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "168:11:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 12,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "168:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 15,
- "name": "fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "185:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 14,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "185:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 17,
- "name": "fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "206:13:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 16,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "206:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 19,
- "name": "fileType",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "225:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 18,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "225:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 21,
- "name": "fileName",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "246:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 20,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "246:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 23,
- "name": "fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "267:22:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 22,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "267:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 25,
- "name": "uploadTime",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "295:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 24,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "295:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 27,
- "name": "uploader",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "316:24:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "typeName": {
- "id": 26,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "316:15:0",
- "stateMutability": "payable",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "name": "File",
- "nodeType": "StructDefinition",
- "scope": 147,
- "src": "150:195:0",
- "visibility": "public"
- },
- {
- "anonymous": false,
- "documentation": null,
- "id": 46,
- "name": "FileUploaded",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 45,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 30,
- "indexed": false,
- "name": "fileId",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "373:11:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 29,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "373:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 32,
- "indexed": false,
- "name": "fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "390:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 31,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "390:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 34,
- "indexed": false,
- "name": "fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "411:13:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 33,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "411:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 36,
- "indexed": false,
- "name": "fileType",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "430:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 35,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "430:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 38,
- "indexed": false,
- "name": "fileName",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "451:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 37,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "451:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 40,
- "indexed": false,
- "name": "fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "473:22:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 39,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "473:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 42,
- "indexed": false,
- "name": "uploadTime",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "501:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 41,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "501:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 44,
- "indexed": false,
- "name": "uploader",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "522:24:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "typeName": {
- "id": 43,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "522:15:0",
- "stateMutability": "payable",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "367:183:0"
- },
- "src": "349:202:0"
- },
- {
- "body": {
- "id": 49,
- "nodeType": "Block",
- "src": "576:5:0",
- "statements": []
- },
- "documentation": null,
- "id": 50,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 47,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "566:2:0"
- },
- "returnParameters": {
- "id": 48,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "576:0:0"
- },
- "scope": 147,
- "src": "555:26:0",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 145,
- "nodeType": "Block",
- "src": "735:810:0",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 69,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 65,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "793:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 64,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "787:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 66,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "787:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 67,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "787:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 68,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "813:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "787:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 63,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "779:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 70,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "779:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 71,
- "nodeType": "ExpressionStatement",
- "src": "779:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 78,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 74,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "869:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 73,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "863:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 75,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "863:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 76,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "863:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 77,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "889:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "863:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 72,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "855:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 79,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "855:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 80,
- "nodeType": "ExpressionStatement",
- "src": "855:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 87,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 83,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "952:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 82,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "946:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 84,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "946:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 85,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "946:30:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 86,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "979:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "946:34:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 81,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "938:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 88,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "938:43:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 89,
- "nodeType": "ExpressionStatement",
- "src": "938:43:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 96,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 92,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1039:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 91,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "1033:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 93,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1033:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 94,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1033:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 95,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1059:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "1033:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 90,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1025:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 97,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1025:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 98,
- "nodeType": "ExpressionStatement",
- "src": "1025:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "id": 105,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 100,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1116:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 101,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1116:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": "!=",
- "rightExpression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 103,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1136:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- }
- ],
- "id": 102,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "1128:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_address_$",
- "typeString": "type(address)"
- },
- "typeName": "address"
- },
- "id": 104,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1128:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "src": "1116:22:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 99,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1108:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 106,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1108:31:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 107,
- "nodeType": "ExpressionStatement",
- "src": "1108:31:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 111,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "id": 109,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1195:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 110,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1205:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "1195:11:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 108,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1187:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 112,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1187:20:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 113,
- "nodeType": "ExpressionStatement",
- "src": "1187:20:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "id": 115,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "nodeType": "UnaryOperation",
- "operator": "++",
- "prefix": false,
- "src": "1239:12:0",
- "subExpression": {
- "argumentTypes": null,
- "id": 114,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1239:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "id": 116,
- "nodeType": "ExpressionStatement",
- "src": "1239:12:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "id": 131,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "baseExpression": {
- "argumentTypes": null,
- "id": 117,
- "name": "files",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 11,
- "src": "1290:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File storage ref)"
- }
- },
- "id": 119,
- "indexExpression": {
- "argumentTypes": null,
- "id": 118,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1296:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": true,
- "nodeType": "IndexAccess",
- "src": "1290:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage",
- "typeString": "struct DStorage.File storage ref"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 121,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1314:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 122,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "1325:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 123,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1336:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 124,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "1347:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 125,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1358:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 126,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "1369:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 127,
- "name": "now",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 221,
- "src": "1387:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 128,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1392:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 129,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1392:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 120,
- "name": "File",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 28,
- "src": "1309:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_struct$_File_$28_storage_ptr_$",
- "typeString": "type(struct DStorage.File storage pointer)"
- }
- },
- "id": 130,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "structConstructorCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1309:94:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_memory",
- "typeString": "struct DStorage.File memory"
- }
- },
- "src": "1290:113:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage",
- "typeString": "struct DStorage.File storage ref"
- }
- },
- "id": 132,
- "nodeType": "ExpressionStatement",
- "src": "1290:113:0"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 134,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1451:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 135,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "1462:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 136,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1473:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 137,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "1484:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 138,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1495:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 139,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "1506:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 140,
- "name": "now",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 221,
- "src": "1524:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 141,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1529:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 142,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1529:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 133,
- "name": "FileUploaded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 46,
- "src": "1438:12:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_string_memory_ptr_$_t_uint256_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_payable_$returns$__$",
- "typeString": "function (uint256,string memory,uint256,string memory,string memory,string memory,uint256,address payable)"
- }
- },
- "id": 143,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1438:102:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 144,
- "nodeType": "EmitStatement",
- "src": "1433:107:0"
- }
- ]
- },
- "documentation": null,
- "id": 146,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "uploadFile",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 61,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 52,
- "name": "_fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "605:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 51,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "605:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 54,
- "name": "_fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "630:14:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 53,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "630:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 56,
- "name": "_fileType",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "646:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 55,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "646:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 58,
- "name": "_fileName",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "671:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 57,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "671:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 60,
- "name": "_fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "696:30:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 59,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "696:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "604:123:0"
- },
- "returnParameters": {
- "id": 62,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "735:0:0"
- },
- "scope": 147,
- "src": "585:960:0",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- }
- ],
- "scope": 148,
- "src": "25:1522:0"
- }
- ],
- "src": "0:1547:0"
- },
- "legacyAST": {
- "absolutePath": "/mnt/c/pr0/dstorage/src/contracts/DStorage.sol",
- "exportedSymbols": {
- "DStorage": [
- 147
- ]
- },
- "id": 148,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 1,
- "literals": [
- "solidity",
- "^",
- "0.5",
- ".0"
- ],
- "nodeType": "PragmaDirective",
- "src": "0:23:0"
- },
- {
- "baseContracts": [],
- "contractDependencies": [],
- "contractKind": "contract",
- "documentation": null,
- "fullyImplemented": true,
- "id": 147,
- "linearizedBaseContracts": [
- 147
- ],
- "name": "DStorage",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "constant": false,
- "id": 4,
- "name": "name",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "47:31:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage",
- "typeString": "string"
- },
- "typeName": {
- "id": 2,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "47:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": {
- "argumentTypes": null,
- "hexValue": "4453746f72616765",
- "id": 3,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "string",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "68:10:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_stringliteral_71e44b0df098e49b64e3e857f58efe89334156a79fe51150de7d54015483635f",
- "typeString": "literal_string \"DStorage\""
- },
- "value": "DStorage"
- },
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 7,
- "name": "fileCount",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "82:25:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 5,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "82:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 6,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "106:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 11,
- "name": "files",
- "nodeType": "VariableDeclaration",
- "scope": 147,
- "src": "111:34:0",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File)"
- },
- "typeName": {
- "id": 10,
- "keyType": {
- "id": 8,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "119:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "Mapping",
- "src": "111:21:0",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File)"
- },
- "valueType": {
- "contractScope": null,
- "id": 9,
- "name": "File",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 28,
- "src": "127:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage_ptr",
- "typeString": "struct DStorage.File"
- }
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "canonicalName": "DStorage.File",
- "id": 28,
- "members": [
- {
- "constant": false,
- "id": 13,
- "name": "fileId",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "168:11:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 12,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "168:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 15,
- "name": "fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "185:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 14,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "185:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 17,
- "name": "fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "206:13:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 16,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "206:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 19,
- "name": "fileType",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "225:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 18,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "225:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 21,
- "name": "fileName",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "246:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 20,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "246:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 23,
- "name": "fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "267:22:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 22,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "267:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 25,
- "name": "uploadTime",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "295:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 24,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "295:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 27,
- "name": "uploader",
- "nodeType": "VariableDeclaration",
- "scope": 28,
- "src": "316:24:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "typeName": {
- "id": 26,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "316:15:0",
- "stateMutability": "payable",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "name": "File",
- "nodeType": "StructDefinition",
- "scope": 147,
- "src": "150:195:0",
- "visibility": "public"
- },
- {
- "anonymous": false,
- "documentation": null,
- "id": 46,
- "name": "FileUploaded",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 45,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 30,
- "indexed": false,
- "name": "fileId",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "373:11:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 29,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "373:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 32,
- "indexed": false,
- "name": "fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "390:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 31,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "390:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 34,
- "indexed": false,
- "name": "fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "411:13:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 33,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "411:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 36,
- "indexed": false,
- "name": "fileType",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "430:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 35,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "430:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 38,
- "indexed": false,
- "name": "fileName",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "451:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 37,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "451:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 40,
- "indexed": false,
- "name": "fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "473:22:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 39,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "473:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 42,
- "indexed": false,
- "name": "uploadTime",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "501:15:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 41,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "501:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 44,
- "indexed": false,
- "name": "uploader",
- "nodeType": "VariableDeclaration",
- "scope": 46,
- "src": "522:24:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "typeName": {
- "id": 43,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "522:15:0",
- "stateMutability": "payable",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "367:183:0"
- },
- "src": "349:202:0"
- },
- {
- "body": {
- "id": 49,
- "nodeType": "Block",
- "src": "576:5:0",
- "statements": []
- },
- "documentation": null,
- "id": 50,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 47,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "566:2:0"
- },
- "returnParameters": {
- "id": 48,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "576:0:0"
- },
- "scope": 147,
- "src": "555:26:0",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 145,
- "nodeType": "Block",
- "src": "735:810:0",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 69,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 65,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "793:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 64,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "787:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 66,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "787:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 67,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "787:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 68,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "813:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "787:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 63,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "779:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 70,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "779:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 71,
- "nodeType": "ExpressionStatement",
- "src": "779:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 78,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 74,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "869:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 73,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "863:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 75,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "863:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 76,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "863:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 77,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "889:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "863:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 72,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "855:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 79,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "855:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 80,
- "nodeType": "ExpressionStatement",
- "src": "855:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 87,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 83,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "952:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 82,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "946:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 84,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "946:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 85,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "946:30:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 86,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "979:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "946:34:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 81,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "938:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 88,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "938:43:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 89,
- "nodeType": "ExpressionStatement",
- "src": "938:43:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 96,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 92,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1039:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- ],
- "id": 91,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "1033:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
- "typeString": "type(bytes storage pointer)"
- },
- "typeName": "bytes"
- },
- "id": 93,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1033:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bytes_memory_ptr",
- "typeString": "bytes memory"
- }
- },
- "id": 94,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "length",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1033:23:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 95,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1059:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "1033:27:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 90,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1025:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 97,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1025:36:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 98,
- "nodeType": "ExpressionStatement",
- "src": "1025:36:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- },
- "id": 105,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 100,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1116:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 101,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1116:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": "!=",
- "rightExpression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 103,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1136:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- }
- ],
- "id": 102,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "lValueRequested": false,
- "nodeType": "ElementaryTypeNameExpression",
- "src": "1128:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_address_$",
- "typeString": "type(address)"
- },
- "typeName": "address"
- },
- "id": 104,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1128:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "src": "1116:22:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 99,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1108:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 106,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1108:31:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 107,
- "nodeType": "ExpressionStatement",
- "src": "1108:31:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "id": 111,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "id": 109,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1195:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": ">",
- "rightExpression": {
- "argumentTypes": null,
- "hexValue": "30",
- "id": 110,
- "isConstant": false,
- "isLValue": false,
- "isPure": true,
- "kind": "number",
- "lValueRequested": false,
- "nodeType": "Literal",
- "src": "1205:1:0",
- "subdenomination": null,
- "typeDescriptions": {
- "typeIdentifier": "t_rational_0_by_1",
- "typeString": "int_const 0"
- },
- "value": "0"
- },
- "src": "1195:11:0",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 108,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 222,
- 223
- ],
- "referencedDeclaration": 222,
- "src": "1187:7:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 112,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1187:20:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 113,
- "nodeType": "ExpressionStatement",
- "src": "1187:20:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "id": 115,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "nodeType": "UnaryOperation",
- "operator": "++",
- "prefix": false,
- "src": "1239:12:0",
- "subExpression": {
- "argumentTypes": null,
- "id": 114,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1239:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "id": 116,
- "nodeType": "ExpressionStatement",
- "src": "1239:12:0"
- },
- {
- "expression": {
- "argumentTypes": null,
- "id": 131,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "baseExpression": {
- "argumentTypes": null,
- "id": 117,
- "name": "files",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 11,
- "src": "1290:5:0",
- "typeDescriptions": {
- "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_File_$28_storage_$",
- "typeString": "mapping(uint256 => struct DStorage.File storage ref)"
- }
- },
- "id": 119,
- "indexExpression": {
- "argumentTypes": null,
- "id": 118,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1296:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": true,
- "nodeType": "IndexAccess",
- "src": "1290:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage",
- "typeString": "struct DStorage.File storage ref"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 121,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1314:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 122,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "1325:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 123,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1336:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 124,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "1347:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 125,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1358:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 126,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "1369:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 127,
- "name": "now",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 221,
- "src": "1387:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 128,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1392:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 129,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1392:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 120,
- "name": "File",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 28,
- "src": "1309:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_struct$_File_$28_storage_ptr_$",
- "typeString": "type(struct DStorage.File storage pointer)"
- }
- },
- "id": 130,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "structConstructorCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1309:94:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_memory",
- "typeString": "struct DStorage.File memory"
- }
- },
- "src": "1290:113:0",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_File_$28_storage",
- "typeString": "struct DStorage.File storage ref"
- }
- },
- "id": 132,
- "nodeType": "ExpressionStatement",
- "src": "1290:113:0"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 134,
- "name": "fileCount",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 7,
- "src": "1451:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 135,
- "name": "_fileHash",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 52,
- "src": "1462:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 136,
- "name": "_fileSize",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 54,
- "src": "1473:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "id": 137,
- "name": "_fileType",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 56,
- "src": "1484:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 138,
- "name": "_fileName",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 58,
- "src": "1495:9:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 139,
- "name": "_fileDescription",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 60,
- "src": "1506:16:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- }
- },
- {
- "argumentTypes": null,
- "id": 140,
- "name": "now",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 221,
- "src": "1524:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 141,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "1529:3:0",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 142,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1529:10:0",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string memory"
- },
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 133,
- "name": "FileUploaded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 46,
- "src": "1438:12:0",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_string_memory_ptr_$_t_uint256_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_payable_$returns$__$",
- "typeString": "function (uint256,string memory,uint256,string memory,string memory,string memory,uint256,address payable)"
- }
- },
- "id": 143,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1438:102:0",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 144,
- "nodeType": "EmitStatement",
- "src": "1433:107:0"
- }
- ]
- },
- "documentation": null,
- "id": 146,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "uploadFile",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 61,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 52,
- "name": "_fileHash",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "605:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 51,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "605:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 54,
- "name": "_fileSize",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "630:14:0",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 53,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "630:4:0",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 56,
- "name": "_fileType",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "646:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 55,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "646:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 58,
- "name": "_fileName",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "671:23:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 57,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "671:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- },
- {
- "constant": false,
- "id": 60,
- "name": "_fileDescription",
- "nodeType": "VariableDeclaration",
- "scope": 146,
- "src": "696:30:0",
- "stateVariable": false,
- "storageLocation": "memory",
- "typeDescriptions": {
- "typeIdentifier": "t_string_memory_ptr",
- "typeString": "string"
- },
- "typeName": {
- "id": 59,
- "name": "string",
- "nodeType": "ElementaryTypeName",
- "src": "696:6:0",
- "typeDescriptions": {
- "typeIdentifier": "t_string_storage_ptr",
- "typeString": "string"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "604:123:0"
- },
- "returnParameters": {
- "id": 62,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "735:0:0"
- },
- "scope": 147,
- "src": "585:960:0",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- }
- ],
- "scope": 148,
- "src": "25:1522:0"
- }
- ],
- "src": "0:1547:0"
- },
- "compiler": {
- "name": "solc",
- "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
- },
- "networks": {
- "1603890166397": {
- "events": {
- "0x411c44e9b6224c510f71a9fc4c9d2881b8cfdd12f5e6ae788b7f08253063a37f": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0xC0e38599cE94bc0520878529266A03De41a1DF85",
- "transactionHash": "0x30ac951c1123ed96812c20d65b50946f26b0a2372b7879fe115c82b7c2f05d92"
- },
- "1603890558788": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0x8ABC4E0Cfd9f465F04DA21b581b457FEd6c56af4",
- "transactionHash": "0xc24e45e490857cc1da0bfc05437dd0afd859177b7801c55d5803caa31e18e62f"
- },
- "1603899554833": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0xe51B42482802e7c424FFBAFDeF31855A88801E5C",
- "transactionHash": "0x18aac12f4a3aad6065be8edda7077e9bcffd22d04e92360d111ab3cc771652f1"
- },
- "1603901227583": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0x1f77952f27CD342345c7a1C8831AB252aA311788",
- "transactionHash": "0x7ddef9943d5cac3f4da4f114e7257957f5bf40f59219101dc6a548ece6ff52a8"
- },
- "1603937802526": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0x760F87eacaa7C384faEE7AE112294B25D0169141",
- "transactionHash": "0x060da574c40d138d65782cccb0ce612d0c5283706fc9402c3ef6fcd3e37b3b8b"
- },
- "1603942183028": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0x68435414680fCD9e279E4cAB2bC390EFE68be8ec",
- "transactionHash": "0x6a470c36972e31412a2f30d64711b3509e40f1734612c9bb2095bba69d53ba7b"
- },
- "1603961798040": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0xeD3320267893eDB9D69AD8baea0dED427C63ca3E",
- "transactionHash": "0xef69a1e5d4b3ea88c9d34111698b4da35dfef14caed2f1fe4467c30b5b062507"
- },
- "1603980443873": {
- "events": {
- "0x6e95bbaa37a5fdec42a312e049dea2fe6160ebe659214d3409b4f91f164c2f52": {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileHash",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "fileSize",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileType",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileName",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "string",
- "name": "fileDescription",
- "type": "string"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "uploadTime",
- "type": "uint256"
- },
- {
- "indexed": false,
- "internalType": "address payable",
- "name": "uploader",
- "type": "address"
- }
- ],
- "name": "FileUploaded",
- "type": "event"
- }
- },
- "links": {},
- "address": "0x54a93847be7E7a6F5ef8C70897627F2cC05b9Bf1",
- "transactionHash": "0x27377f881244fbd16b845707b242391cc05d03396a852f7c8cb2139114abf172"
- }
- },
- "schemaVersion": "3.2.5",
- "updatedAt": "2020-10-29T14:07:54.734Z",
- "networkType": "ethereum",
- "devdoc": {
- "methods": {}
- },
- "userdoc": {
- "methods": {}
- }
-}
\ No newline at end of file
diff --git a/src/abis/Migrations.json b/src/abis/Migrations.json
deleted file mode 100644
index 128678b..0000000
--- a/src/abis/Migrations.json
+++ /dev/null
@@ -1,1439 +0,0 @@
-{
- "contractName": "Migrations",
- "abi": [
- {
- "inputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "last_completed_migration",
- "outputs": [
- {
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "internalType": "address",
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "internalType": "uint256",
- "name": "completed",
- "type": "uint256"
- }
- ],
- "name": "setCompleted",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "internalType": "address",
- "name": "new_address",
- "type": "address"
- }
- ],
- "name": "upgrade",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- }
- ],
- "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"new_address\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/mnt/c/pr0/dstorage/src/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/mnt/c/pr0/dstorage/src/contracts/Migrations.sol\":{\"keccak256\":\"0xfdb731592344e2a2890faf03baec7b4bee7057ffba18ba6dbb6eec8db85f8f4c\",\"urls\":[\"bzz-raw://f9b488bbb84816dd04c1b155e943319758db16ee943943648fb264bccecc9879\",\"dweb:/ipfs/QmbW34mYrj3uLteyHf3S46pnp9bnwovtCXHbdBHfzMkSZx\"]}},\"version\":1}",
- "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102b7806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea265627a7a723158206106f86c01b5257a4703abc7dd05553f244bc0cca96ad98aff68fedf43d017d664736f6c63430005100032",
- "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea265627a7a723158206106f86c01b5257a4703abc7dd05553f244bc0cca96ad98aff68fedf43d017d664736f6c63430005100032",
- "sourceMap": "34:480:1:-;;;123:50;8:9:-1;5:2;;;30:1;27;20:12;5:2;123:50:1;158:10;150:5;;:18;;;;;;;;;;;;;;;;;;34:480;;;;;;",
- "deployedSourceMap": "34:480:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;34:480:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;347:165;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;347:165:1;;;;;;;;;;;;;;;;;;;:::i;:::-;;82:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;58:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;240:103;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;240:103:1;;;;;;;;;;;;;;;;;:::i;:::-;;347:165;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;409:19;442:11;409:45;;460:8;:21;;;482:24;;460:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;460:47:1;;;;230:1;205:26;347:165;:::o;82:36::-;;;;:::o;58:20::-;;;;;;;;;;;;;:::o;240:103::-;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;329:9;302:24;:36;;;;205:26;240:103;:::o",
- "source": "pragma solidity >=0.4.21 <0.6.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n",
- "sourcePath": "/mnt/c/pr0/dstorage/src/contracts/Migrations.sol",
- "ast": {
- "absolutePath": "/mnt/c/pr0/dstorage/src/contracts/Migrations.sol",
- "exportedSymbols": {
- "Migrations": [
- 204
- ]
- },
- "id": 205,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 149,
- "literals": [
- "solidity",
- ">=",
- "0.4",
- ".21",
- "<",
- "0.6",
- ".0"
- ],
- "nodeType": "PragmaDirective",
- "src": "0:32:1"
- },
- {
- "baseContracts": [],
- "contractDependencies": [],
- "contractKind": "contract",
- "documentation": null,
- "fullyImplemented": true,
- "id": 204,
- "linearizedBaseContracts": [
- 204
- ],
- "name": "Migrations",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "constant": false,
- "id": 151,
- "name": "owner",
- "nodeType": "VariableDeclaration",
- "scope": 204,
- "src": "58:20:1",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 150,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "58:7:1",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 153,
- "name": "last_completed_migration",
- "nodeType": "VariableDeclaration",
- "scope": 204,
- "src": "82:36:1",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 152,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "82:4:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 161,
- "nodeType": "Block",
- "src": "144:29:1",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "id": 159,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "id": 156,
- "name": "owner",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 151,
- "src": "150:5:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 157,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "158:3:1",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 158,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "158:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "src": "150:18:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "id": 160,
- "nodeType": "ExpressionStatement",
- "src": "150:18:1"
- }
- ]
- },
- "documentation": null,
- "id": 162,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 154,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "134:2:1"
- },
- "returnParameters": {
- "id": 155,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "144:0:1"
- },
- "scope": 204,
- "src": "123:50:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 170,
- "nodeType": "Block",
- "src": "199:37:1",
- "statements": [
- {
- "condition": {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "id": 167,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 164,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "209:3:1",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 165,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "209:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": "==",
- "rightExpression": {
- "argumentTypes": null,
- "id": 166,
- "name": "owner",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 151,
- "src": "223:5:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "src": "209:19:1",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "falseBody": null,
- "id": 169,
- "nodeType": "IfStatement",
- "src": "205:26:1",
- "trueBody": {
- "id": 168,
- "nodeType": "PlaceholderStatement",
- "src": "230:1:1"
- }
- }
- ]
- },
- "documentation": null,
- "id": 171,
- "name": "restricted",
- "nodeType": "ModifierDefinition",
- "parameters": {
- "id": 163,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "196:2:1"
- },
- "src": "177:59:1",
- "visibility": "internal"
- },
- {
- "body": {
- "id": 182,
- "nodeType": "Block",
- "src": "296:47:1",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "id": 180,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "id": 178,
- "name": "last_completed_migration",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 153,
- "src": "302:24:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "id": 179,
- "name": "completed",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 173,
- "src": "329:9:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "src": "302:36:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "id": 181,
- "nodeType": "ExpressionStatement",
- "src": "302:36:1"
- }
- ]
- },
- "documentation": null,
- "id": 183,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 176,
- "modifierName": {
- "argumentTypes": null,
- "id": 175,
- "name": "restricted",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 171,
- "src": "285:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "285:10:1"
- }
- ],
- "name": "setCompleted",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 174,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 173,
- "name": "completed",
- "nodeType": "VariableDeclaration",
- "scope": 183,
- "src": "262:14:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 172,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "262:4:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "261:16:1"
- },
- "returnParameters": {
- "id": 177,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "296:0:1"
- },
- "scope": 204,
- "src": "240:103:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 202,
- "nodeType": "Block",
- "src": "403:109:1",
- "statements": [
- {
- "assignments": [
- 191
- ],
- "declarations": [
- {
- "constant": false,
- "id": 191,
- "name": "upgraded",
- "nodeType": "VariableDeclaration",
- "scope": 202,
- "src": "409:19:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- },
- "typeName": {
- "contractScope": null,
- "id": 190,
- "name": "Migrations",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 204,
- "src": "409:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "id": 195,
- "initialValue": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 193,
- "name": "new_address",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 185,
- "src": "442:11:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 192,
- "name": "Migrations",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 204,
- "src": "431:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_contract$_Migrations_$204_$",
- "typeString": "type(contract Migrations)"
- }
- },
- "id": 194,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "431:23:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "nodeType": "VariableDeclarationStatement",
- "src": "409:45:1"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 199,
- "name": "last_completed_migration",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 153,
- "src": "482:24:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 196,
- "name": "upgraded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 191,
- "src": "460:8:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "id": 198,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "setCompleted",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 183,
- "src": "460:21:1",
- "typeDescriptions": {
- "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
- "typeString": "function (uint256) external"
- }
- },
- "id": 200,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "460:47:1",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 201,
- "nodeType": "ExpressionStatement",
- "src": "460:47:1"
- }
- ]
- },
- "documentation": null,
- "id": 203,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 188,
- "modifierName": {
- "argumentTypes": null,
- "id": 187,
- "name": "restricted",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 171,
- "src": "392:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "392:10:1"
- }
- ],
- "name": "upgrade",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 186,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 185,
- "name": "new_address",
- "nodeType": "VariableDeclaration",
- "scope": 203,
- "src": "364:19:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 184,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "364:7:1",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "363:21:1"
- },
- "returnParameters": {
- "id": 189,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "403:0:1"
- },
- "scope": 204,
- "src": "347:165:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- }
- ],
- "scope": 205,
- "src": "34:480:1"
- }
- ],
- "src": "0:515:1"
- },
- "legacyAST": {
- "absolutePath": "/mnt/c/pr0/dstorage/src/contracts/Migrations.sol",
- "exportedSymbols": {
- "Migrations": [
- 204
- ]
- },
- "id": 205,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 149,
- "literals": [
- "solidity",
- ">=",
- "0.4",
- ".21",
- "<",
- "0.6",
- ".0"
- ],
- "nodeType": "PragmaDirective",
- "src": "0:32:1"
- },
- {
- "baseContracts": [],
- "contractDependencies": [],
- "contractKind": "contract",
- "documentation": null,
- "fullyImplemented": true,
- "id": 204,
- "linearizedBaseContracts": [
- 204
- ],
- "name": "Migrations",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "constant": false,
- "id": 151,
- "name": "owner",
- "nodeType": "VariableDeclaration",
- "scope": 204,
- "src": "58:20:1",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 150,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "58:7:1",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "constant": false,
- "id": 153,
- "name": "last_completed_migration",
- "nodeType": "VariableDeclaration",
- "scope": 204,
- "src": "82:36:1",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 152,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "82:4:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 161,
- "nodeType": "Block",
- "src": "144:29:1",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "id": 159,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "id": 156,
- "name": "owner",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 151,
- "src": "150:5:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 157,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "158:3:1",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 158,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "158:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "src": "150:18:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "id": 160,
- "nodeType": "ExpressionStatement",
- "src": "150:18:1"
- }
- ]
- },
- "documentation": null,
- "id": 162,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 154,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "134:2:1"
- },
- "returnParameters": {
- "id": 155,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "144:0:1"
- },
- "scope": 204,
- "src": "123:50:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 170,
- "nodeType": "Block",
- "src": "199:37:1",
- "statements": [
- {
- "condition": {
- "argumentTypes": null,
- "commonType": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "id": 167,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftExpression": {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 164,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 219,
- "src": "209:3:1",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 165,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "209:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- },
- "nodeType": "BinaryOperation",
- "operator": "==",
- "rightExpression": {
- "argumentTypes": null,
- "id": 166,
- "name": "owner",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 151,
- "src": "223:5:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "src": "209:19:1",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "falseBody": null,
- "id": 169,
- "nodeType": "IfStatement",
- "src": "205:26:1",
- "trueBody": {
- "id": 168,
- "nodeType": "PlaceholderStatement",
- "src": "230:1:1"
- }
- }
- ]
- },
- "documentation": null,
- "id": 171,
- "name": "restricted",
- "nodeType": "ModifierDefinition",
- "parameters": {
- "id": 163,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "196:2:1"
- },
- "src": "177:59:1",
- "visibility": "internal"
- },
- {
- "body": {
- "id": 182,
- "nodeType": "Block",
- "src": "296:47:1",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "id": 180,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "leftHandSide": {
- "argumentTypes": null,
- "id": 178,
- "name": "last_completed_migration",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 153,
- "src": "302:24:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "nodeType": "Assignment",
- "operator": "=",
- "rightHandSide": {
- "argumentTypes": null,
- "id": 179,
- "name": "completed",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 173,
- "src": "329:9:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "src": "302:36:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "id": 181,
- "nodeType": "ExpressionStatement",
- "src": "302:36:1"
- }
- ]
- },
- "documentation": null,
- "id": 183,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 176,
- "modifierName": {
- "argumentTypes": null,
- "id": 175,
- "name": "restricted",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 171,
- "src": "285:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "285:10:1"
- }
- ],
- "name": "setCompleted",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 174,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 173,
- "name": "completed",
- "nodeType": "VariableDeclaration",
- "scope": 183,
- "src": "262:14:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- },
- "typeName": {
- "id": 172,
- "name": "uint",
- "nodeType": "ElementaryTypeName",
- "src": "262:4:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "261:16:1"
- },
- "returnParameters": {
- "id": 177,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "296:0:1"
- },
- "scope": 204,
- "src": "240:103:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 202,
- "nodeType": "Block",
- "src": "403:109:1",
- "statements": [
- {
- "assignments": [
- 191
- ],
- "declarations": [
- {
- "constant": false,
- "id": 191,
- "name": "upgraded",
- "nodeType": "VariableDeclaration",
- "scope": 202,
- "src": "409:19:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- },
- "typeName": {
- "contractScope": null,
- "id": 190,
- "name": "Migrations",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 204,
- "src": "409:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "id": 195,
- "initialValue": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 193,
- "name": "new_address",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 185,
- "src": "442:11:1",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 192,
- "name": "Migrations",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 204,
- "src": "431:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_type$_t_contract$_Migrations_$204_$",
- "typeString": "type(contract Migrations)"
- }
- },
- "id": 194,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "typeConversion",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "431:23:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "nodeType": "VariableDeclarationStatement",
- "src": "409:45:1"
- },
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 199,
- "name": "last_completed_migration",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 153,
- "src": "482:24:1",
- "typeDescriptions": {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_uint256",
- "typeString": "uint256"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 196,
- "name": "upgraded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 191,
- "src": "460:8:1",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Migrations_$204",
- "typeString": "contract Migrations"
- }
- },
- "id": 198,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "setCompleted",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 183,
- "src": "460:21:1",
- "typeDescriptions": {
- "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
- "typeString": "function (uint256) external"
- }
- },
- "id": 200,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "460:47:1",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 201,
- "nodeType": "ExpressionStatement",
- "src": "460:47:1"
- }
- ]
- },
- "documentation": null,
- "id": 203,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 188,
- "modifierName": {
- "argumentTypes": null,
- "id": 187,
- "name": "restricted",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 171,
- "src": "392:10:1",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "392:10:1"
- }
- ],
- "name": "upgrade",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 186,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 185,
- "name": "new_address",
- "nodeType": "VariableDeclaration",
- "scope": 203,
- "src": "364:19:1",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 184,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "364:7:1",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "363:21:1"
- },
- "returnParameters": {
- "id": 189,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "403:0:1"
- },
- "scope": 204,
- "src": "347:165:1",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- }
- ],
- "scope": 205,
- "src": "34:480:1"
- }
- ],
- "src": "0:515:1"
- },
- "compiler": {
- "name": "solc",
- "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
- },
- "networks": {
- "1603890166397": {
- "events": {},
- "links": {},
- "address": "0x73019E7c12E9ed6024E36a343aFBBA0bA1Cf52ab",
- "transactionHash": "0xee82f8f0bdce87a2ee6a244bc14b755c318b30b7597bc56f4ca9f947a159ed8a"
- },
- "1603890558788": {
- "events": {},
- "links": {},
- "address": "0x0A6F0e8fCF658834B340B2408da688B07eE80E6c",
- "transactionHash": "0x978761db78e188febca3ce221281e63e343bc351761062704590dc20fdcd741b"
- },
- "1603899554833": {
- "events": {},
- "links": {},
- "address": "0x0C95FF99F8Fc83e06E382D7474987A72bbc0B1cE",
- "transactionHash": "0xd4d667aa2e299b198791ee33bfdfff95d178a5a3e651368a9ead832f86e8c64d"
- },
- "1603901227583": {
- "events": {},
- "links": {},
- "address": "0x91C693dAad534f5d00C8DeF268aB05f16F4Cd286",
- "transactionHash": "0xd71852905f9e13e2fae2e9e26b972d577d5413b7f68efe6ce2fcfc6e9d301636"
- },
- "1603937802526": {
- "events": {},
- "links": {},
- "address": "0x4eC3ee342fe5e9BBeF2076124582AE7b05207e34",
- "transactionHash": "0x4d02f423b380a25b0b2969aa6da9b867d3423e4a813b17b55b209a3a981365e5"
- },
- "1603942183028": {
- "events": {},
- "links": {},
- "address": "0x6413DD38f048b655687a98Ef60227f779935E170",
- "transactionHash": "0x2741d3f8a06c19a354d14542ebb7a69f5d020db933f58d250bcc543f7b7cebe7"
- },
- "1603961798040": {
- "events": {},
- "links": {},
- "address": "0x4D00899C2FAdCC685DC195e8C9AfDB506D2269b4",
- "transactionHash": "0xb191e79a55172c6cb7d0c579ee2d9a26d6c538d2536bc723305acfb8c4944907"
- },
- "1603980443873": {
- "events": {},
- "links": {},
- "address": "0x81bbBede7eE0d04Ca1Ac8e199878429C6d0817C5",
- "transactionHash": "0xc84d191afd0a7e086c057e5fe022bf964e5caa6df928615537970d25e380d28b"
- }
- },
- "schemaVersion": "3.2.5",
- "updatedAt": "2020-10-29T14:07:54.749Z",
- "networkType": "ethereum",
- "devdoc": {
- "methods": {}
- },
- "userdoc": {
- "methods": {}
- }
-}
\ No newline at end of file
diff --git a/src/components/App.js b/src/components/App.js
index 8bc6693..6029b4b 100644
--- a/src/components/App.js
+++ b/src/components/App.js
@@ -1,12 +1,11 @@
-import DStorage from '../abis/DStorage.json'
+//import DStorage from '../abis/DStorage.json'
import React, { Component } from 'react';
import Navbar from './Navbar'
import Main from './Main'
import Web3 from 'web3';
import './App.css';
-const ipfsClient = require('ipfs-http-client')
-const ipfs = ipfsClient({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' }) // leaving out the arguments will default to these values
+//Declare IPFS
class App extends Component {
@@ -16,105 +15,56 @@ class App extends Component {
}
async loadWeb3() {
- if (window.ethereum) {
- window.web3 = new Web3(window.ethereum)
- await window.ethereum.enable()
- }
- else if (window.web3) {
- window.web3 = new Web3(window.web3.currentProvider)
- }
- else {
- window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')
- }
+ //Setting up Web3
}
async loadBlockchainData() {
- const web3 = window.web3
- // Load account
- const accounts = await web3.eth.getAccounts()
- this.setState({ account: accounts[0] })
- // Network ID
- const networkId = await web3.eth.net.getId()
- const networkData = DStorage.networks[networkId]
- if(networkData) {
- // Assign contract
- const dstorage = new web3.eth.Contract(DStorage.abi, networkData.address)
- this.setState({ dstorage })
- // Get files amount
- const filesCount = await dstorage.methods.fileCount().call()
- this.setState({ filesCount })
- // Load files&sort by the newest
- for (var i = filesCount; i >= 1; i--) {
- const file = await dstorage.methods.files(i).call()
- this.setState({
- files: [...this.state.files, file]
- })
- }
- } else {
- window.alert('DStorage contract not deployed to detected network.')
- }
+ //Declare Web3
+
+ //Load account
+
+ //Network ID
+
+ //IF got connection, get data from contracts
+ //Assign contract
+
+ //Get files amount
+
+ //Load files&sort by the newest
+
+ //Else
+ //alert Error
+
}
// Get file from user
captureFile = event => {
- event.preventDefault()
-
- const file = event.target.files[0]
- const reader = new window.FileReader()
-
- reader.readAsArrayBuffer(file)
- reader.onloadend = () => {
- this.setState({
- buffer: Buffer(reader.result),
- type: file.type,
- name: file.name
- })
- console.log('buffer', this.state.buffer)
- }
}
+
+ //Upload File
uploadFile = description => {
- console.log("Submitting file to IPFS...")
-
- // Add file to the IPFS
- ipfs.add(this.state.buffer, (error, result) => {
- console.log('IPFS result', result.size)
- if(error) {
- console.error(error)
- return
- }
-
- this.setState({ loading: true })
- // Assign value for the file without extension
- if(this.state.type === ''){
- this.setState({type: 'none'})
- }
- this.state.dstorage.methods.uploadFile(result[0].hash, result[0].size, this.state.type, this.state.name, description).send({ from: this.state.account }).on('transactionHash', (hash) => {
- this.setState({
- loading: false,
- type: null,
- name: null
- })
- window.location.reload()
- }).on('error', (e) =>{
- window.alert('Error')
- this.setState({loading: false})
- })
- })
+
+ //Add file to the IPFS
+
+ //Check If error
+ //Return error
+
+ //Set state to loading
+
+ //Assign value for the file without extension
+
+ //Call smart contract uploadFile function
+
}
+ //Set states
constructor(props) {
super(props)
this.state = {
- account: '',
- dstorage: null,
- files: [],
- loading: false,
- type: null,
- name: null
}
- this.uploadFile = this.uploadFile.bind(this)
- this.captureFile = this.captureFile.bind(this)
+
+ //Bind functions
}
render() {
diff --git a/src/components/Main.js b/src/components/Main.js
index 6fdd560..8eb5410 100644
--- a/src/components/Main.js
+++ b/src/components/Main.js
@@ -11,71 +11,14 @@ class Main extends Component {
-
+
DStorage starter_code
+ {/* Creatining uploading card ... */}
+ {/* Uploading file... */}
+ {/* Create Table*/}
-
-
- | id |
- name |
- description |
- type |
- size |
- date |
- uploader/view |
- hash/view/get |
-
-
- { this.props.files.map((file, key) => {
- return(
-
-
- | {file.fileId} |
- {file.fileName} |
- {file.fileDescription} |
- {file.fileType} |
- {convertBytes(file.fileSize)} |
- {moment.unix(file.uploadTime).format('h:mm:ss A M/D/Y')} |
-
-
- {file.uploader.substring(0,10)}...
-
- |
-
-
- {file.fileHash.substring(0,10)}...
-
- |
-
-
- )
- })}
+ {/* Set table columns */}
+ {/* Mapping rows... */}
diff --git a/src/components/Navbar.js b/src/components/Navbar.js
index 1775750..fc84aa5 100644
--- a/src/components/Navbar.js
+++ b/src/components/Navbar.js
@@ -17,27 +17,7 @@ class Navbar extends Component {
D$t0r@g3
);
diff --git a/src/contracts/DStorage.sol b/src/contracts/DStorage.sol
index 3681364..192c467 100644
--- a/src/contracts/DStorage.sol
+++ b/src/contracts/DStorage.sol
@@ -1,55 +1,37 @@
pragma solidity ^0.5.0;
contract DStorage {
- string public name = 'DStorage';
- uint public fileCount = 0;
- mapping(uint => File) public files;
-
- struct File {
- uint fileId;
- string fileHash;
- uint fileSize;
- string fileType;
- string fileName;
- string fileDescription;
- uint uploadTime;
- address payable uploader;
- }
+ // Name
+ // Number of files
+ // Mapping fileId=>Struct
+
+ // Struct
- event FileUploaded(
- uint fileId,
- string fileHash,
- uint fileSize,
- string fileType,
- string fileName,
- string fileDescription,
- uint uploadTime,
- address payable uploader
- );
+
+ // Event
constructor() public {
}
- function uploadFile(string memory _fileHash, uint _fileSize, string memory _fileType, string memory _fileName, string memory _fileDescription) public {
+ // Upload File function
+
// Make sure the file hash exists
- require(bytes(_fileHash).length > 0);
+
// Make sure file type exists
- require(bytes(_fileType).length > 0);
+
// Make sure file description exists
- require(bytes(_fileDescription).length > 0);
+
// Make sure file fileName exists
- require(bytes(_fileName).length > 0);
+
// Make sure uploader address exists
- require(msg.sender!=address(0));
+
// Make sure file size is more than 0
- require(_fileSize>0);
+
// Increment file id
- fileCount ++;
// Add File to the contract
- files[fileCount] = File(fileCount, _fileHash, _fileSize, _fileType, _fileName, _fileDescription, now, msg.sender);
+
// Trigger an event
- emit FileUploaded(fileCount, _fileHash, _fileSize, _fileType, _fileName, _fileDescription, now, msg.sender);
- }
+
}
\ No newline at end of file