UNPKG

hardlydifficult-eth

Version:

A collection of reusable contracts and Javascript helpers for Ethereum.

993 lines 36.9 kB
{ "contractName": "UtilsMock", "abi": [ { "inputs": [], "name": "chainId", "outputs": [ { "internalType": "uint256", "name": "_chainId", "type": "uint256" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "gasPrice", "outputs": [ { "internalType": "uint256", "name": "_gasPrice", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "gasRemaining", "outputs": [ { "internalType": "uint256", "name": "_gasRemaining", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.10+commit.00c0fcaf\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"chainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_gasPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasRemaining\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_gasRemaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"project:/contracts/test-artifacts/UtilsMock.sol\":\"UtilsMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":2000000},\"remappings\":[]},\"sources\":{\"project:/contracts/test-artifacts/UtilsMock.sol\":{\"keccak256\":\"0xe8284ad8ab13b48ad41c2be320ad92fa8bc719d9db3c665800cabe75b2f10947\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8e1a4e75831b8efe5370d4a1809de87fbf17c1ff210fa68352e8645c7cfe026\",\"dweb:/ipfs/QmRRCesEeP6VdrPZdEzHkZTfGzPLWAfC7dyVL5PV9obhzG\"]},\"project:/contracts/utils/ChainId.sol\":{\"keccak256\":\"0x17511084795a9b8e42b63271b3cfeba235736a686f4c5a9c0975a24b3328493f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2bd47104a8db2b22febfe93ec1fcc4c24f7c70085bc417ca17779d4d258e3a26\",\"dweb:/ipfs/Qme1fwzGaeySZkVdMUMRiWqXmuPH4Y8TKnERtLVqH19omx\"]},\"project:/contracts/utils/Gas.sol\":{\"keccak256\":\"0xd8b354e1169d7cd25f77ed7660cd79202a3ddda3e6e1c4adfc8309efeee53c3d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9b2968d2772d0cb58071f441f53bc26d571745781da43c8dabadb7619f0bcb4b\",\"dweb:/ipfs/Qmb7YHhbVk3XVsVnirvBPTNYCvT3AFyhDs8wRSxomDNeGi\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5060c88061001f6000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c80637a4cc7451460415780639a8a0592146059578063fe173b9714605f575b600080fd5b60476065565b60408051918252519081900360200190f35b60476072565b6047607a565b6000606d6082565b905090565b6000606d608a565b6000606d608e565b60005a905090565b4690565b3a9056fea2646970667358221220f2712a6a247e9de92387ddb9347c7a7bd55dc9da27f57a8acccef132b171584664736f6c634300060a0033", "deployedBytecode": "0x6080604052348015600f57600080fd5b5060043610603c5760003560e01c80637a4cc7451460415780639a8a0592146059578063fe173b9714605f575b600080fd5b60476065565b60408051918252519081900360200190f35b60476072565b6047607a565b6000606d6082565b905090565b6000606d608a565b6000606d608e565b60005a905090565b4690565b3a9056fea2646970667358221220f2712a6a247e9de92387ddb9347c7a7bd55dc9da27f57a8acccef132b171584664736f6c634300060a0033", "immutableReferences": {}, "sourceMap": "117:340:29:-:0;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "117:340:29:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;345:110;;;:::i;:::-;;;;;;;;;;;;;;;;140:99;;;:::i;243:98::-;;;:::i;345:110::-;397:18;432;:16;:18::i;:::-;425:25;;345:110;:::o;140:99::-;187:13;217:17;:15;:17::i;243:98::-;291:14;322;:12;:14::i;238:167:32:-;292:18;390:5;373:22;;365:36;:::o;78:156:31:-;215:9;;195:35::o;74:160:32:-;214:10;;193:37::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.6.0;\n\n\nimport '../utils/ChainId.sol';\nimport '../utils/Gas.sol';\n\ncontract UtilsMock\n{\n function chainId(\n ) public pure\n returns (uint _chainId)\n {\n return ChainId.chainId();\n }\n\n function gasPrice(\n ) public view\n returns (uint _gasPrice)\n {\n return Gas.gasPrice();\n }\n\n function gasRemaining(\n ) public view\n returns (uint _gasRemaining)\n {\n return Gas.gasRemaining();\n }\n}\n", "sourcePath": "/home/circleci/repo/contracts/test-artifacts/UtilsMock.sol", "ast": { "absolutePath": "project:/contracts/test-artifacts/UtilsMock.sol", "exportedSymbols": { "UtilsMock": [ 4113 ] }, "id": 4114, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 4080, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "32:23:29" }, { "absolutePath": "project:/contracts/utils/ChainId.sol", "file": "../utils/ChainId.sol", "id": 4081, "nodeType": "ImportDirective", "scope": 4114, "sourceUnit": 4199, "src": "58:30:29", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/utils/Gas.sol", "file": "../utils/Gas.sol", "id": 4082, "nodeType": "ImportDirective", "scope": 4114, "sourceUnit": 4216, "src": "89:26:29", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 4113, "linearizedBaseContracts": [ 4113 ], "name": "UtilsMock", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 4091, "nodeType": "Block", "src": "204:35:29", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 4087, "name": "ChainId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4198, "src": "217:7:29", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ChainId_$4198_$", "typeString": "type(library ChainId)" } }, "id": 4088, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "chainId", "nodeType": "MemberAccess", "referencedDeclaration": 4197, "src": "217:15:29", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$__$returns$_t_uint256_$", "typeString": "function () pure returns (uint256)" } }, "id": 4089, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "217:17:29", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 4086, "id": 4090, "nodeType": "Return", "src": "210:24:29" } ] }, "documentation": null, "functionSelector": "9a8a0592", "id": 4092, "implemented": true, "kind": "function", "modifiers": [], "name": "chainId", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4083, "nodeType": "ParameterList", "parameters": [], "src": "156:5:29" }, "returnParameters": { "id": 4086, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4085, "mutability": "mutable", "name": "_chainId", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4092, "src": "187:13:29", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4084, "name": "uint", "nodeType": "ElementaryTypeName", "src": "187:4:29", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "186:15:29" }, "scope": 4113, "src": "140:99:29", "stateMutability": "pure", "virtual": false, "visibility": "public" }, { "body": { "id": 4101, "nodeType": "Block", "src": "309:32:29", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 4097, "name": "Gas", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4215, "src": "322:3:29", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Gas_$4215_$", "typeString": "type(library Gas)" } }, "id": 4098, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "gasPrice", "nodeType": "MemberAccess", "referencedDeclaration": 4207, "src": "322:12:29", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", "typeString": "function () view returns (uint256)" } }, "id": 4099, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "322:14:29", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 4096, "id": 4100, "nodeType": "Return", "src": "315:21:29" } ] }, "documentation": null, "functionSelector": "fe173b97", "id": 4102, "implemented": true, "kind": "function", "modifiers": [], "name": "gasPrice", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4093, "nodeType": "ParameterList", "parameters": [], "src": "260:5:29" }, "returnParameters": { "id": 4096, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4095, "mutability": "mutable", "name": "_gasPrice", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4102, "src": "291:14:29", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4094, "name": "uint", "nodeType": "ElementaryTypeName", "src": "291:4:29", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "290:16:29" }, "scope": 4113, "src": "243:98:29", "stateMutability": "view", "virtual": false, "visibility": "public" }, { "body": { "id": 4111, "nodeType": "Block", "src": "419:36:29", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 4107, "name": "Gas", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4215, "src": "432:3:29", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Gas_$4215_$", "typeString": "type(library Gas)" } }, "id": 4108, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "gasRemaining", "nodeType": "MemberAccess", "referencedDeclaration": 4214, "src": "432:16:29", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", "typeString": "function () view returns (uint256)" } }, "id": 4109, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "432:18:29", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 4106, "id": 4110, "nodeType": "Return", "src": "425:25:29" } ] }, "documentation": null, "functionSelector": "7a4cc745", "id": 4112, "implemented": true, "kind": "function", "modifiers": [], "name": "gasRemaining", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4103, "nodeType": "ParameterList", "parameters": [], "src": "366:5:29" }, "returnParameters": { "id": 4106, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4105, "mutability": "mutable", "name": "_gasRemaining", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4112, "src": "397:18:29", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4104, "name": "uint", "nodeType": "ElementaryTypeName", "src": "397:4:29", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "396:20:29" }, "scope": 4113, "src": "345:110:29", "stateMutability": "view", "virtual": false, "visibility": "public" } ], "scope": 4114, "src": "117:340:29" } ], "src": "32:426:29" }, "legacyAST": { "attributes": { "absolutePath": "project:/contracts/test-artifacts/UtilsMock.sol", "exportedSymbols": { "UtilsMock": [ 4113 ] }, "license": "MIT" }, "children": [ { "attributes": { "literals": [ "solidity", "^", "0.6", ".0" ] }, "id": 4080, "name": "PragmaDirective", "src": "32:23:29" }, { "attributes": { "SourceUnit": 4199, "absolutePath": "project:/contracts/utils/ChainId.sol", "file": "../utils/ChainId.sol", "scope": 4114, "symbolAliases": [ null ], "unitAlias": "" }, "id": 4081, "name": "ImportDirective", "src": "58:30:29" }, { "attributes": { "SourceUnit": 4216, "absolutePath": "project:/contracts/utils/Gas.sol", "file": "../utils/Gas.sol", "scope": 4114, "symbolAliases": [ null ], "unitAlias": "" }, "id": 4082, "name": "ImportDirective", "src": "89:26:29" }, { "attributes": { "abstract": false, "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ 4113 ], "name": "UtilsMock", "scope": 4114 }, "children": [ { "attributes": { "documentation": null, "functionSelector": "9a8a0592", "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "chainId", "overrides": null, "scope": 4113, "stateMutability": "pure", "virtual": false, "visibility": "public" }, "children": [ { "attributes": { "parameters": [ null ] }, "children": [], "id": 4083, "name": "ParameterList", "src": "156:5:29" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "_chainId", "overrides": null, "scope": 4092, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 4084, "name": "ElementaryTypeName", "src": "187:4:29" } ], "id": 4085, "name": "VariableDeclaration", "src": "187:13:29" } ], "id": 4086, "name": "ParameterList", "src": "186:15:29" }, { "children": [ { "attributes": { "functionReturnParameters": 4086 }, "children": [ { "attributes": { "argumentTypes": null, "arguments": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "isStructConstructorCall": false, "lValueRequested": false, "names": [ null ], "tryCall": false, "type": "uint256", "type_conversion": false }, "children": [ { "attributes": { "argumentTypes": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "chainId", "referencedDeclaration": 4197, "type": "function () pure returns (uint256)" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 4198, "type": "type(library ChainId)", "value": "ChainId" }, "id": 4087, "name": "Identifier", "src": "217:7:29" } ], "id": 4088, "name": "MemberAccess", "src": "217:15:29" } ], "id": 4089, "name": "FunctionCall", "src": "217:17:29" } ], "id": 4090, "name": "Return", "src": "210:24:29" } ], "id": 4091, "name": "Block", "src": "204:35:29" } ], "id": 4092, "name": "FunctionDefinition", "src": "140:99:29" }, { "attributes": { "documentation": null, "functionSelector": "fe173b97", "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "gasPrice", "overrides": null, "scope": 4113, "stateMutability": "view", "virtual": false, "visibility": "public" }, "children": [ { "attributes": { "parameters": [ null ] }, "children": [], "id": 4093, "name": "ParameterList", "src": "260:5:29" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "_gasPrice", "overrides": null, "scope": 4102, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 4094, "name": "ElementaryTypeName", "src": "291:4:29" } ], "id": 4095, "name": "VariableDeclaration", "src": "291:14:29" } ], "id": 4096, "name": "ParameterList", "src": "290:16:29" }, { "children": [ { "attributes": { "functionReturnParameters": 4096 }, "children": [ { "attributes": { "argumentTypes": null, "arguments": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "isStructConstructorCall": false, "lValueRequested": false, "names": [ null ], "tryCall": false, "type": "uint256", "type_conversion": false }, "children": [ { "attributes": { "argumentTypes": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "gasPrice", "referencedDeclaration": 4207, "type": "function () view returns (uint256)" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 4215, "type": "type(library Gas)", "value": "Gas" }, "id": 4097, "name": "Identifier", "src": "322:3:29" } ], "id": 4098, "name": "MemberAccess", "src": "322:12:29" } ], "id": 4099, "name": "FunctionCall", "src": "322:14:29" } ], "id": 4100, "name": "Return", "src": "315:21:29" } ], "id": 4101, "name": "Block", "src": "309:32:29" } ], "id": 4102, "name": "FunctionDefinition", "src": "243:98:29" }, { "attributes": { "documentation": null, "functionSelector": "7a4cc745", "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "gasRemaining", "overrides": null, "scope": 4113, "stateMutability": "view", "virtual": false, "visibility": "public" }, "children": [ { "attributes": { "parameters": [ null ] }, "children": [], "id": 4103, "name": "ParameterList", "src": "366:5:29" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "_gasRemaining", "overrides": null, "scope": 4112, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 4104, "name": "ElementaryTypeName", "src": "397:4:29" } ], "id": 4105, "name": "VariableDeclaration", "src": "397:18:29" } ], "id": 4106, "name": "ParameterList", "src": "396:20:29" }, { "children": [ { "attributes": { "functionReturnParameters": 4106 }, "children": [ { "attributes": { "argumentTypes": null, "arguments": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "isStructConstructorCall": false, "lValueRequested": false, "names": [ null ], "tryCall": false, "type": "uint256", "type_conversion": false }, "children": [ { "attributes": { "argumentTypes": [ null ], "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "gasRemaining", "referencedDeclaration": 4214, "type": "function () view returns (uint256)" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 4215, "type": "type(library Gas)", "value": "Gas" }, "id": 4107, "name": "Identifier", "src": "432:3:29" } ], "id": 4108, "name": "MemberAccess", "src": "432:16:29" } ], "id": 4109, "name": "FunctionCall", "src": "432:18:29" } ], "id": 4110, "name": "Return", "src": "425:25:29" } ], "id": 4111, "name": "Block", "src": "419:36:29" } ], "id": 4112, "name": "FunctionDefinition", "src": "345:110:29" } ], "id": 4113, "name": "ContractDefinition", "src": "117:340:29" } ], "id": 4114, "name": "SourceUnit", "src": "32:426:29" }, "compiler": { "name": "solc", "version": "0.6.10+commit.00c0fcaf.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.1", "updatedAt": "2021-07-08T17:04:13.919Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }