UNPKG

truffle

Version:

Truffle - Simple development framework for Ethereum

477 lines 17.5 kB
{ "contractName": "ConvertLib", "abi": [ { "constant": true, "inputs": [ { "name": "amount", "type": "uint256" }, { "name": "conversionRate", "type": "uint256" } ], "name": "convert", "outputs": [ { "name": "convertedAmount", "type": "uint256" } ], "payable": false, "stateMutability": "pure", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"conversionRate\",\"type\":\"uint256\"}],\"name\":\"convert\",\"outputs\":[{\"name\":\"convertedAmount\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/tyler/projects/truffle/packages/truffle/test/sources/networks/metacoin/contracts/ConvertLib.sol\":\"ConvertLib\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/tyler/projects/truffle/packages/truffle/test/sources/networks/metacoin/contracts/ConvertLib.sol\":{\"keccak256\":\"0x64971bee9ef0af43109f80ffc9912eaea745c8d8ba775fe42d27e24ad307dab9\",\"urls\":[\"bzzr://0cf7c2951278cb5e786ca88a13e11558cd30b1f49f0662b55bc346f0c2ecd9ed\"]}},\"version\":1}", "bytecode": "0x60ba610025600b82828239805160001a60731461001857fe5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c806396e4ee3d146038575b600080fd5b606b60048036036040811015604c57600080fd5b8101908080359060200190929190803590602001909291905050506081565b6040518082815260200191505060405180910390f35b600081830290509291505056fea165627a7a723058200b060f77c40bb1a9e3d3488bbce170ab59d2ce3343d4df8c6c501364f43bd9b20029", "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361060335760003560e01c806396e4ee3d146038575b600080fd5b606b60048036036040811015604c57600080fd5b8101908080359060200190929190803590602001909291905050506081565b6040518082815260200191505060405180910390f35b600081830290509291505056fea165627a7a723058200b060f77c40bb1a9e3d3488bbce170ab59d2ce3343d4df8c6c501364f43bd9b20029", "sourceMap": "34:155:0:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "34:155:0:-;;;;;;;;;;;;;;;;;;;;;;;;55:132;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;55:132:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;126:20;169:14;160:6;:23;153:30;;55:132;;;;:::o", "source": "pragma solidity >=0.4.25 <0.6.0;\n\nlibrary ConvertLib{\n\tfunction convert(uint amount,uint conversionRate) public pure returns (uint convertedAmount)\n\t{\n\t\treturn amount * conversionRate;\n\t}\n}\n", "sourcePath": "/Users/tyler/projects/truffle/packages/truffle/test/sources/networks/metacoin/contracts/ConvertLib.sol", "ast": { "absolutePath": "/Users/tyler/projects/truffle/packages/truffle/test/sources/networks/metacoin/contracts/ConvertLib.sol", "exportedSymbols": { "ConvertLib": [ 16 ] }, "id": 17, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".25", "<", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "0:32:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 16, "linearizedBaseContracts": [ 16 ], "name": "ConvertLib", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 14, "nodeType": "Block", "src": "149:38:0", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "160:6:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11, "name": "conversionRate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "169:14:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "160:23:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 9, "id": 13, "nodeType": "Return", "src": "153:30:0" } ] }, "documentation": null, "id": 15, "implemented": true, "kind": "function", "modifiers": [], "name": "convert", "nodeType": "FunctionDefinition", "parameters": { "id": 6, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3, "name": "amount", "nodeType": "VariableDeclaration", "scope": 15, "src": "72:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2, "name": "uint", "nodeType": "ElementaryTypeName", "src": "72:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5, "name": "conversionRate", "nodeType": "VariableDeclaration", "scope": 15, "src": "84:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4, "name": "uint", "nodeType": "ElementaryTypeName", "src": "84:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "71:33:0" }, "returnParameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8, "name": "convertedAmount", "nodeType": "VariableDeclaration", "scope": 15, "src": "126:20:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7, "name": "uint", "nodeType": "ElementaryTypeName", "src": "126:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "125:22:0" }, "scope": 16, "src": "55:132:0", "stateMutability": "pure", "superFunction": null, "visibility": "public" } ], "scope": 17, "src": "34:155:0" } ], "src": "0:190:0" }, "legacyAST": { "absolutePath": "/Users/tyler/projects/truffle/packages/truffle/test/sources/networks/metacoin/contracts/ConvertLib.sol", "exportedSymbols": { "ConvertLib": [ 16 ] }, "id": 17, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".25", "<", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "0:32:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 16, "linearizedBaseContracts": [ 16 ], "name": "ConvertLib", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 14, "nodeType": "Block", "src": "149:38:0", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "160:6:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11, "name": "conversionRate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "169:14:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "160:23:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 9, "id": 13, "nodeType": "Return", "src": "153:30:0" } ] }, "documentation": null, "id": 15, "implemented": true, "kind": "function", "modifiers": [], "name": "convert", "nodeType": "FunctionDefinition", "parameters": { "id": 6, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3, "name": "amount", "nodeType": "VariableDeclaration", "scope": 15, "src": "72:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2, "name": "uint", "nodeType": "ElementaryTypeName", "src": "72:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5, "name": "conversionRate", "nodeType": "VariableDeclaration", "scope": 15, "src": "84:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4, "name": "uint", "nodeType": "ElementaryTypeName", "src": "84:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "71:33:0" }, "returnParameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8, "name": "convertedAmount", "nodeType": "VariableDeclaration", "scope": 15, "src": "126:20:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7, "name": "uint", "nodeType": "ElementaryTypeName", "src": "126:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "125:22:0" }, "scope": 16, "src": "55:132:0", "stateMutability": "pure", "superFunction": null, "visibility": "public" } ], "scope": 17, "src": "34:155:0" } ], "src": "0:190:0" }, "compiler": { "name": "solc", "version": "0.5.8+commit.23d335f2.Emscripten.clang" }, "networks": { "4": { "events": {}, "links": {}, "address": "0x2922bbAbBcA343f1B2C5a6e186120286eBEBa8aC", "transactionHash": "0xffa9acf5f1fc12f29e0ec69fd77489bd3ffab0472f25cf36fa8a7ce5b196e128" }, "5777": { "events": {}, "links": {}, "address": "0x5040F5c3f1f01C23ad172F3293B466d4aD8E0263", "transactionHash": "0xa444fe70c282d95bbefdde80f28b4a2255b10c40d1def7eae6113b0eb3041963" } }, "schemaVersion": "3.0.16", "updatedAt": "2019-10-24T20:22:38.572Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }