Skip to content

Instantly share code, notes, and snippets.

@mverzilli
Created August 24, 2022 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mverzilli/f90e57eea96f87992b99107240070b7f to your computer and use it in GitHub Desktop.
Save mverzilli/f90e57eea96f87992b99107240070b7f to your computer and use it in GitHub Desktop.
{
"id": "92cee3a25070d1793d4697a3252d7dc4",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.2",
"solcLongVersion": "0.8.2+commit.661d1103",
"input": {
"language": "Solidity",
"sources": {
"contracts/WithConst.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract WithConst {\n uint256 public value;\n constructor(uint256 initialValue) {\n value = initialValue;\n }\n\n function greet() public returns(uint256) {\n return value;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers"
],
"": [
"ast"
]
}
}
}
},
"output": {
"contracts": {
"contracts/WithConst.sol": {
"WithConst": {
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "initialValue",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "greet",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "value",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"evm": {
"bytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:654:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "70:80:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "80:22:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "95:6:1"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "89:5:1"
},
"nodeType": "YulFunctionCall",
"src": "89:13:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "80:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "138:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "111:26:1"
},
"nodeType": "YulFunctionCall",
"src": "111:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "111:33:1"
}
]
},
"name": "abi_decode_t_uint256_fromMemory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "48:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "56:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "64:5:1",
"type": ""
}
],
"src": "7:143:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "233:207:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "279:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "288:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "291:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "281:6:1"
},
"nodeType": "YulFunctionCall",
"src": "281:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "281:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "254:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "263:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "250:3:1"
},
"nodeType": "YulFunctionCall",
"src": "250:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "275:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "246:3:1"
},
"nodeType": "YulFunctionCall",
"src": "246:32:1"
},
"nodeType": "YulIf",
"src": "243:2:1"
},
{
"nodeType": "YulBlock",
"src": "305:128:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "320:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "334:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "324:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "349:74:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "395:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "406:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "391:3:1"
},
"nodeType": "YulFunctionCall",
"src": "391:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "415:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256_fromMemory",
"nodeType": "YulIdentifier",
"src": "359:31:1"
},
"nodeType": "YulFunctionCall",
"src": "359:64:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "349:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256_fromMemory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "203:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "214:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "226:6:1",
"type": ""
}
],
"src": "156:284:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "491:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "501:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "512:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "501:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "473:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "483:7:1",
"type": ""
}
],
"src": "446:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "572:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "629:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "638:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "641:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "631:6:1"
},
"nodeType": "YulFunctionCall",
"src": "631:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "631:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "595:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "620:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "602:17:1"
},
"nodeType": "YulFunctionCall",
"src": "602:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "592:2:1"
},
"nodeType": "YulFunctionCall",
"src": "592:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "585:6:1"
},
"nodeType": "YulFunctionCall",
"src": "585:43:1"
},
"nodeType": "YulIf",
"src": "582:2:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "565:5:1",
"type": ""
}
],
"src": "529:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_uint256_fromMemory(offset, end) -> value {\n value := mload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256_fromMemory(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256_fromMemory(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b5060405161018c38038061018c83398181016040528101906100329190610054565b806000819055505061009e565b60008151905061004e81610087565b92915050565b60006020828403121561006657600080fd5b60006100748482850161003f565b91505092915050565b6000819050919050565b6100908161007d565b811461009b57600080fd5b50565b60e0806100ac6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80633fa4f245146037578063cfae3217146051575b600080fd5b603d606b565b604051604891906087565b60405180910390f35b60576071565b604051606291906087565b60405180910390f35b60005481565b60008054905090565b60818160a0565b82525050565b6000602082019050609a6000830184607a565b92915050565b600081905091905056fea2646970667358221220e653eb26353d1e33b6e4d11c1ac1d467cbff1f240c7ab78f0ff099a6f6711cba64736f6c63430008020033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x18C CODESIZE SUB DUP1 PUSH2 0x18C DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE DUP2 ADD SWAP1 PUSH2 0x32 SWAP2 SWAP1 PUSH2 0x54 JUMP JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP POP PUSH2 0x9E JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x4E DUP2 PUSH2 0x87 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x66 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x74 DUP5 DUP3 DUP6 ADD PUSH2 0x3F JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x90 DUP2 PUSH2 0x7D JUMP JUMPDEST DUP2 EQ PUSH2 0x9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0xE0 DUP1 PUSH2 0xAC PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x3FA4F245 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xCFAE3217 EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3D PUSH1 0x6B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x48 SWAP2 SWAP1 PUSH1 0x87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x62 SWAP2 SWAP1 PUSH1 0x87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x81 DUP2 PUSH1 0xA0 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x9A PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x7A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE6 MSTORE8 0xEB 0x26 CALLDATALOAD RETURNDATASIZE 0x1E CALLER 0xB6 0xE4 0xD1 SHR BYTE 0xC1 0xD4 PUSH8 0xCBFF1F240C7AB78F 0xF CREATE SWAP10 0xA6 0xF6 PUSH18 0x1CBA64736F6C634300080200330000000000 ",
"sourceMap": "56:200:0:-:0;;;107:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;159:12;151:5;:20;;;;107:71;56:200;;7:143:1;;95:6;89:13;80:22;;111:33;138:5;111:33;:::i;:::-;70:80;;;;:::o;156:284::-;;275:2;263:9;254:7;250:23;246:32;243:2;;;291:1;288;281:12;243:2;334:1;359:64;415:7;406:6;395:9;391:22;359:64;:::i;:::-;349:74;;305:128;233:207;;;;:::o;446:77::-;;512:5;501:16;;491:32;;;:::o;529:122::-;602:24;620:5;602:24;:::i;:::-;595:5;592:35;582:2;;641:1;638;631:12;582:2;572:79;:::o;56:200:0:-;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:439:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "72:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "89:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "112:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "94:17:1"
},
"nodeType": "YulFunctionCall",
"src": "94:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "82:6:1"
},
"nodeType": "YulFunctionCall",
"src": "82:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "82:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "60:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "67:3:1",
"type": ""
}
],
"src": "7:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "229:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "239:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "251:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "262:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "247:3:1"
},
"nodeType": "YulFunctionCall",
"src": "247:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "239:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "319:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "332:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "343:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "328:3:1"
},
"nodeType": "YulFunctionCall",
"src": "328:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "275:43:1"
},
"nodeType": "YulFunctionCall",
"src": "275:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "275:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "201:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "213:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "224:4:1",
"type": ""
}
],
"src": "131:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "404:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "414:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "425:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "414:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "386:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "396:7:1",
"type": ""
}
],
"src": "359:77:1"
}
]
},
"contents": "{\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "6080604052348015600f57600080fd5b506004361060325760003560e01c80633fa4f245146037578063cfae3217146051575b600080fd5b603d606b565b604051604891906087565b60405180910390f35b60576071565b604051606291906087565b60405180910390f35b60005481565b60008054905090565b60818160a0565b82525050565b6000602082019050609a6000830184607a565b92915050565b600081905091905056fea2646970667358221220e653eb26353d1e33b6e4d11c1ac1d467cbff1f240c7ab78f0ff099a6f6711cba64736f6c63430008020033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x3FA4F245 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xCFAE3217 EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3D PUSH1 0x6B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x48 SWAP2 SWAP1 PUSH1 0x87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x62 SWAP2 SWAP1 PUSH1 0x87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x81 DUP2 PUSH1 0xA0 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x9A PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x7A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE6 MSTORE8 0xEB 0x26 CALLDATALOAD RETURNDATASIZE 0x1E CALLER 0xB6 0xE4 0xD1 SHR BYTE 0xC1 0xD4 PUSH8 0xCBFF1F240C7AB78F 0xF CREATE SWAP10 0xA6 0xF6 PUSH18 0x1CBA64736F6C634300080200330000000000 ",
"sourceMap": "56:200:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81:20;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;184:70;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;81:20;;;;:::o;184:70::-;216:7;242:5;;235:12;;184:70;:::o;7:118:1:-;94:24;112:5;94:24;:::i;:::-;89:3;82:37;72:53;;:::o;131:222::-;;262:2;251:9;247:18;239:26;;275:71;343:1;332:9;328:17;319:6;275:71;:::i;:::-;229:124;;;;:::o;359:77::-;;425:5;414:16;;404:32;;;:::o"
},
"methodIdentifiers": {
"greet()": "cfae3217",
"value()": "3fa4f245"
}
}
}
}
},
"errors": [
{
"component": "general",
"errorCode": "2018",
"formattedMessage": "Warning: Function state mutability can be restricted to view\n --> contracts/WithConst.sol:10:5:\n |\n10 | function greet() public returns(uint256) {\n | ^ (Relevant source part starts here and spans across multiple lines).\n\n",
"message": "Function state mutability can be restricted to view",
"severity": "warning",
"sourceLocation": {
"end": 254,
"file": "contracts/WithConst.sol",
"start": 184
},
"type": "Warning"
}
],
"sources": {
"contracts/WithConst.sol": {
"ast": {
"absolutePath": "contracts/WithConst.sol",
"exportedSymbols": {
"WithConst": [
22
]
},
"id": 23,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "31:23:0"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 22,
"linearizedBaseContracts": [
22
],
"name": "WithConst",
"nameLocation": "65:9:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "3fa4f245",
"id": 3,
"mutability": "mutable",
"name": "value",
"nameLocation": "96:5:0",
"nodeType": "VariableDeclaration",
"scope": 22,
"src": "81:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "81:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"body": {
"id": 12,
"nodeType": "Block",
"src": "141:37:0",
"statements": [
{
"expression": {
"id": 10,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 8,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "151:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 9,
"name": "initialValue",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "159:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "151:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11,
"nodeType": "ExpressionStatement",
"src": "151:20:0"
}
]
},
"id": 13,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "initialValue",
"nameLocation": "127:12:0",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "119:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "119:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "118:22:0"
},
"returnParameters": {
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "141:0:0"
},
"scope": 22,
"src": "107:71:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 20,
"nodeType": "Block",
"src": "225:29:0",
"statements": [
{
"expression": {
"id": 18,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "242:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 17,
"id": 19,
"nodeType": "Return",
"src": "235:12:0"
}
]
},
"functionSelector": "cfae3217",
"id": 21,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "greet",
"nameLocation": "193:5:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 14,
"nodeType": "ParameterList",
"parameters": [],
"src": "198:2:0"
},
"returnParameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 21,
"src": "216:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "216:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "215:9:0"
},
"scope": 22,
"src": "184:70:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 23,
"src": "56:200:0"
}
],
"src": "31:226:0"
},
"id": 0
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment