Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contractDependencies in the AST no longer includes inherited contracts on 0.8.4+ #11643

Closed
PatrickAlphaC opened this issue Jul 11, 2021 · 16 comments
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. documentation 📖 stale The issue/PR was marked as stale because it has been open for too long.

Comments

@PatrickAlphaC
Copy link
Contributor

PatrickAlphaC commented Jul 11, 2021

Description

Dependencies of contracts are not being properly recorded in the compiler.

Environment

  • Compiler version: 0.8.4+
  • Target EVM version (as per compiler settings): 0.8.4
  • Framework/IDE (e.g. Truffle or Remix): solc binary & Brownie
  • EVM execution environment / backend / blockchain client: N/A
  • Operating system: MacOS & Ubuntu

Steps to Reproduce

  1. Take the following input JSON and make it a file, input.json
{
    "language": "Solidity",
    "sources": {
        "contracts/DummyVersion8Contract.sol": {
            "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./ImportMev8.sol\";\n\n\ncontract DummyVersion8Contract is ImportMev8{\n    constructor (bool success) public {\n        require(success);\n    }\n\n    function callImported() public {\n        increment();\n    }\n\n}\n"
        },
        "contracts/ImportMev8.sol": {
            "content": "pragma solidity ^0.8.0;\n\n\n\n\ncontract ImportMev8 {\n    uint256 public number;\n    constructor() public {}\n\n    function increment() public{\n        number = number + 1;\n    }\n}\n"
        }
    },
    "settings": {
        "outputSelection": {
            "*": {
                "*": [
                    "abi",
                    "devdoc",
                    "evm.bytecode",
                    "evm.deployedBytecode",
                    "userdoc"
                ],
                "": [
                    "ast"
                ]
            }
        },
        "evmVersion": "istanbul",
        "optimizer": {
            "enabled": true,
            "runs": 200
        }
    }
}
  1. Run the solidity compiler on it:
cat input.json | solc --standard-json

Copy the output, it'll look like:

{"contracts":{"contracts/DummyVersion8Contract.sol":{"DummyVersion8Contract":{"abi":[{"inputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"callImported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"increment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"number","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"evm":{"bytecode":{"functionDebugData":{"@_14":{"entryPoint":null,"id":14,"parameterSlots":1,"returnSlots":0},"@_30":{"entryPoint":null,"id":30,"parameterSlots":0,"returnSlots":0},"abi_decode_tuple_t_bool_fromMemory":{"entryPoint":63,"id":null,"parameterSlots":2,"returnSlots":1}},"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:293:2","statements":[{"nodeType":"YulBlock","src":"6:3:2","statements":[]},{"body":{"nodeType":"YulBlock","src":"92:199:2","statements":[{"body":{"nodeType":"YulBlock","src":"138:16:2","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"147:1:2","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"150:1:2","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"140:6:2"},"nodeType":"YulFunctionCall","src":"140:12:2"},"nodeType":"YulExpressionStatement","src":"140:12:2"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"113:7:2"},{"name":"headStart","nodeType":"YulIdentifier","src":"122:9:2"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"109:3:2"},"nodeType":"YulFunctionCall","src":"109:23:2"},{"kind":"number","nodeType":"YulLiteral","src":"134:2:2","type":"","value":"32"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"105:3:2"},"nodeType":"YulFunctionCall","src":"105:32:2"},"nodeType":"YulIf","src":"102:2:2"},{"nodeType":"YulVariableDeclaration","src":"163:29:2","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"182:9:2"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"176:5:2"},"nodeType":"YulFunctionCall","src":"176:16:2"},"variables":[{"name":"value","nodeType":"YulTypedName","src":"167:5:2","type":""}]},{"body":{"nodeType":"YulBlock","src":"245:16:2","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"254:1:2","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"257:1:2","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"247:6:2"},"nodeType":"YulFunctionCall","src":"247:12:2"},"nodeType":"YulExpressionStatement","src":"247:12:2"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"214:5:2"},{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"235:5:2"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"228:6:2"},"nodeType":"YulFunctionCall","src":"228:13:2"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"221:6:2"},"nodeType":"YulFunctionCall","src":"221:21:2"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"211:2:2"},"nodeType":"YulFunctionCall","src":"211:32:2"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"204:6:2"},"nodeType":"YulFunctionCall","src":"204:40:2"},"nodeType":"YulIf","src":"201:2:2"},{"nodeType":"YulAssignment","src":"270:15:2","value":{"name":"value","nodeType":"YulIdentifier","src":"280:5:2"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"270:6:2"}]}]},"name":"abi_decode_tuple_t_bool_fromMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"58:9:2","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"69:7:2","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"81:6:2","type":""}],"src":"14:277:2"}]},"contents":"{\n    { }\n    function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0\n    {\n        if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n        let value := mload(headStart)\n        if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n        value0 := value\n    }\n}","id":2,"language":"Yul","name":"#utility.yul"}],"linkReferences":{},"object":"608060405234801561001057600080fd5b5060405161015338038061015383398101604081905261002f9161003f565b8061003957600080fd5b50610068565b60006020828403121561005157600080fd5b8151801515811461006157600080fd5b9392505050565b60dd806100766000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c80636c5e44271460415780638381f58a146049578063d09de08a146063575b600080fd5b60476069565b005b605160005481565b60405190815260200160405180910390f35b60476071565b606f6071565b565b600054607d9060016082565b600055565b6000821982111560a257634e487b7160e01b600052601160045260246000fd5b50019056fea264697066735822122053d188acba0a675f8ab37f13163fde7f6a595f9e33588e6dd5214d72fd85ffb664736f6c63430008060033","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x153 CODESIZE SUB DUP1 PUSH2 0x153 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 DUP2 SWAP1 MSTORE PUSH2 0x2F SWAP2 PUSH2 0x3F JUMP JUMPDEST DUP1 PUSH2 0x39 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x68 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x61 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0xDD DUP1 PUSH2 0x76 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 0x3C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6C5E4427 EQ PUSH1 0x41 JUMPI DUP1 PUSH4 0x8381F58A EQ PUSH1 0x49 JUMPI DUP1 PUSH4 0xD09DE08A EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x47 PUSH1 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x51 PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x47 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x6F PUSH1 0x71 JUMP JUMPDEST JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x7D SWAP1 PUSH1 0x1 PUSH1 0x82 JUMP JUMPDEST PUSH1 0x0 SSTORE JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH1 0xA2 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MSTORE8 0xD1 DUP9 0xAC 0xBA EXP PUSH8 0x5F8AB37F13163FDE PUSH32 0x6A595F9E33588E6DD5214D72FD85FFB664736F6C634300080600330000000000 ","sourceMap":"86:185:0:-:0;;;136:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;188:7;180:16;;;;;;136:67;86:185;;14:277:2;81:6;134:2;122:9;113:7;109:23;105:32;102:2;;;150:1;147;140:12;102:2;182:9;176:16;235:5;228:13;221:21;214:5;211:32;201:2;;257:1;254;247:12;201:2;280:5;92:199;-1:-1:-1;;;92:199:2:o;:::-;86:185:0;;;;;;"},"deployedBytecode":{"functionDebugData":{"@callImported_21":{"entryPoint":105,"id":21,"parameterSlots":0,"returnSlots":0},"@increment_40":{"entryPoint":113,"id":40,"parameterSlots":0,"returnSlots":0},"@number_26":{"entryPoint":null,"id":26,"parameterSlots":0,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":null,"id":null,"parameterSlots":2,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":130,"id":null,"parameterSlots":2,"returnSlots":1}},"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:423:2","statements":[{"nodeType":"YulBlock","src":"6:3:2","statements":[]},{"body":{"nodeType":"YulBlock","src":"115:76:2","statements":[{"nodeType":"YulAssignment","src":"125:26:2","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"137:9:2"},{"kind":"number","nodeType":"YulLiteral","src":"148:2:2","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"133:3:2"},"nodeType":"YulFunctionCall","src":"133:18:2"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"125:4:2"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"167:9:2"},{"name":"value0","nodeType":"YulIdentifier","src":"178:6:2"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"160:6:2"},"nodeType":"YulFunctionCall","src":"160:25:2"},"nodeType":"YulExpressionStatement","src":"160:25:2"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"84:9:2","type":""},{"name":"value0","nodeType":"YulTypedName","src":"95:6:2","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"106:4:2","type":""}],"src":"14:177:2"},{"body":{"nodeType":"YulBlock","src":"244:177:2","statements":[{"body":{"nodeType":"YulBlock","src":"279:111:2","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"300:1:2","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"307:3:2","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"312:10:2","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"303:3:2"},"nodeType":"YulFunctionCall","src":"303:20:2"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"293:6:2"},"nodeType":"YulFunctionCall","src":"293:31:2"},"nodeType":"YulExpressionStatement","src":"293:31:2"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"344:1:2","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"347:4:2","type":"","value":"0x11"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"337:6:2"},"nodeType":"YulFunctionCall","src":"337:15:2"},"nodeType":"YulExpressionStatement","src":"337:15:2"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"372:1:2","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"375:4:2","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"365:6:2"},"nodeType":"YulFunctionCall","src":"365:15:2"},"nodeType":"YulExpressionStatement","src":"365:15:2"}]},"condition":{"arguments":[{"name":"x","nodeType":"YulIdentifier","src":"260:1:2"},{"arguments":[{"name":"y","nodeType":"YulIdentifier","src":"267:1:2"}],"functionName":{"name":"not","nodeType":"YulIdentifier","src":"263:3:2"},"nodeType":"YulFunctionCall","src":"263:6:2"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"257:2:2"},"nodeType":"YulFunctionCall","src":"257:13:2"},"nodeType":"YulIf","src":"254:2:2"},{"nodeType":"YulAssignment","src":"399:16:2","value":{"arguments":[{"name":"x","nodeType":"YulIdentifier","src":"410:1:2"},{"name":"y","nodeType":"YulIdentifier","src":"413:1:2"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"406:3:2"},"nodeType":"YulFunctionCall","src":"406:9:2"},"variableNames":[{"name":"sum","nodeType":"YulIdentifier","src":"399:3:2"}]}]},"name":"checked_add_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"x","nodeType":"YulTypedName","src":"227:1:2","type":""},{"name":"y","nodeType":"YulTypedName","src":"230:1:2","type":""}],"returnVariables":[{"name":"sum","nodeType":"YulTypedName","src":"236:3:2","type":""}],"src":"196:225:2"}]},"contents":"{\n    { }\n    function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n    {\n        tail := add(headStart, 32)\n        mstore(headStart, value0)\n    }\n    function checked_add_t_uint256(x, y) -> sum\n    {\n        if gt(x, not(y))\n        {\n            mstore(0, shl(224, 0x4e487b71))\n            mstore(4, 0x11)\n            revert(0, 0x24)\n        }\n        sum := add(x, y)\n    }\n}","id":2,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"6080604052348015600f57600080fd5b5060043610603c5760003560e01c80636c5e44271460415780638381f58a146049578063d09de08a146063575b600080fd5b60476069565b005b605160005481565b60405190815260200160405180910390f35b60476071565b606f6071565b565b600054607d9060016082565b600055565b6000821982111560a257634e487b7160e01b600052601160045260246000fd5b50019056fea264697066735822122053d188acba0a675f8ab37f13163fde7f6a595f9e33588e6dd5214d72fd85ffb664736f6c63430008060033","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x3C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6C5E4427 EQ PUSH1 0x41 JUMPI DUP1 PUSH4 0x8381F58A EQ PUSH1 0x49 JUMPI DUP1 PUSH4 0xD09DE08A EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x47 PUSH1 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x51 PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x47 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x6F PUSH1 0x71 JUMP JUMPDEST JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x7D SWAP1 PUSH1 0x1 PUSH1 0x82 JUMP JUMPDEST PUSH1 0x0 SSTORE JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH1 0xA2 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MSTORE8 0xD1 DUP9 0xAC 0xBA EXP PUSH8 0x5F8AB37F13163FDE PUSH32 0x6A595F9E33588E6DD5214D72FD85FFB664736F6C634300080600330000000000 ","sourceMap":"86:185:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;209:59;;;:::i;:::-;;54:21:1;;;;;;;;;160:25:2;;;148:2;133:18;54:21:1;;;;;;;110:63;;;:::i;209:59:0:-;250:11;:9;:11::i;:::-;209:59::o;110:63:1:-;156:6;;:10;;165:1;156:10;:::i;:::-;147:6;:19;110:63::o;196:225:2:-;236:3;267:1;263:6;260:1;257:13;254:2;;;312:10;307:3;303:20;300:1;293:31;347:4;344:1;337:15;375:4;372:1;365:15;254:2;-1:-1:-1;406:9:2;;244:177::o"}},"userdoc":{"kind":"user","methods":{},"version":1}}},"contracts/ImportMev8.sol":{"ImportMev8":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"increment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"number","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"evm":{"bytecode":{"functionDebugData":{"@_30":{"entryPoint":null,"id":30,"parameterSlots":0,"returnSlots":0}},"generatedSources":[],"linkReferences":{},"object":"608060405234801561001057600080fd5b5060c58061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80638381f58a146037578063d09de08a146051575b600080fd5b603f60005481565b60405190815260200160405180910390f35b60576059565b005b6000546065906001606a565b600055565b60008219821115608a57634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212204036ecf9ce597c6c22a1db30c37ba943be0427ffb32eea774822bbb5c5c5bcc664736f6c63430008060033","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xC5 DUP1 PUSH2 0x1F 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 0x8381F58A EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xD09DE08A EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3F PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x59 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x65 SWAP1 PUSH1 0x1 PUSH1 0x6A JUMP JUMPDEST PUSH1 0x0 SSTORE JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH1 0x8A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 BLOCKHASH CALLDATASIZE 0xEC 0xF9 0xCE MSIZE PUSH29 0x6C22A1DB30C37BA943BE0427FFB32EEA774822BBB5C5C5BCC664736F6C PUSH4 0x43000806 STOP CALLER ","sourceMap":"28:147:1:-:0;;;81:23;;;;;;;;;;28:147;;;;;;"},"deployedBytecode":{"functionDebugData":{"@increment_40":{"entryPoint":89,"id":40,"parameterSlots":0,"returnSlots":0},"@number_26":{"entryPoint":null,"id":26,"parameterSlots":0,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":null,"id":null,"parameterSlots":2,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":106,"id":null,"parameterSlots":2,"returnSlots":1}},"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:423:2","statements":[{"nodeType":"YulBlock","src":"6:3:2","statements":[]},{"body":{"nodeType":"YulBlock","src":"115:76:2","statements":[{"nodeType":"YulAssignment","src":"125:26:2","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"137:9:2"},{"kind":"number","nodeType":"YulLiteral","src":"148:2:2","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"133:3:2"},"nodeType":"YulFunctionCall","src":"133:18:2"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"125:4:2"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"167:9:2"},{"name":"value0","nodeType":"YulIdentifier","src":"178:6:2"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"160:6:2"},"nodeType":"YulFunctionCall","src":"160:25:2"},"nodeType":"YulExpressionStatement","src":"160:25:2"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"84:9:2","type":""},{"name":"value0","nodeType":"YulTypedName","src":"95:6:2","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"106:4:2","type":""}],"src":"14:177:2"},{"body":{"nodeType":"YulBlock","src":"244:177:2","statements":[{"body":{"nodeType":"YulBlock","src":"279:111:2","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"300:1:2","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"307:3:2","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"312:10:2","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"303:3:2"},"nodeType":"YulFunctionCall","src":"303:20:2"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"293:6:2"},"nodeType":"YulFunctionCall","src":"293:31:2"},"nodeType":"YulExpressionStatement","src":"293:31:2"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"344:1:2","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"347:4:2","type":"","value":"0x11"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"337:6:2"},"nodeType":"YulFunctionCall","src":"337:15:2"},"nodeType":"YulExpressionStatement","src":"337:15:2"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"372:1:2","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"375:4:2","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"365:6:2"},"nodeType":"YulFunctionCall","src":"365:15:2"},"nodeType":"YulExpressionStatement","src":"365:15:2"}]},"condition":{"arguments":[{"name":"x","nodeType":"YulIdentifier","src":"260:1:2"},{"arguments":[{"name":"y","nodeType":"YulIdentifier","src":"267:1:2"}],"functionName":{"name":"not","nodeType":"YulIdentifier","src":"263:3:2"},"nodeType":"YulFunctionCall","src":"263:6:2"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"257:2:2"},"nodeType":"YulFunctionCall","src":"257:13:2"},"nodeType":"YulIf","src":"254:2:2"},{"nodeType":"YulAssignment","src":"399:16:2","value":{"arguments":[{"name":"x","nodeType":"YulIdentifier","src":"410:1:2"},{"name":"y","nodeType":"YulIdentifier","src":"413:1:2"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"406:3:2"},"nodeType":"YulFunctionCall","src":"406:9:2"},"variableNames":[{"name":"sum","nodeType":"YulIdentifier","src":"399:3:2"}]}]},"name":"checked_add_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"x","nodeType":"YulTypedName","src":"227:1:2","type":""},{"name":"y","nodeType":"YulTypedName","src":"230:1:2","type":""}],"returnVariables":[{"name":"sum","nodeType":"YulTypedName","src":"236:3:2","type":""}],"src":"196:225:2"}]},"contents":"{\n    { }\n    function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n    {\n        tail := add(headStart, 32)\n        mstore(headStart, value0)\n    }\n    function checked_add_t_uint256(x, y) -> sum\n    {\n        if gt(x, not(y))\n        {\n            mstore(0, shl(224, 0x4e487b71))\n            mstore(4, 0x11)\n            revert(0, 0x24)\n        }\n        sum := add(x, y)\n    }\n}","id":2,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"6080604052348015600f57600080fd5b506004361060325760003560e01c80638381f58a146037578063d09de08a146051575b600080fd5b603f60005481565b60405190815260200160405180910390f35b60576059565b005b6000546065906001606a565b600055565b60008219821115608a57634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212204036ecf9ce597c6c22a1db30c37ba943be0427ffb32eea774822bbb5c5c5bcc664736f6c63430008060033","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 0x8381F58A EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xD09DE08A EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3F PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x59 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x65 SWAP1 PUSH1 0x1 PUSH1 0x6A JUMP JUMPDEST PUSH1 0x0 SSTORE JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH1 0x8A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 BLOCKHASH CALLDATASIZE 0xEC 0xF9 0xCE MSIZE PUSH29 0x6C22A1DB30C37BA943BE0427FFB32EEA774822BBB5C5C5BCC664736F6C PUSH4 0x43000806 STOP CALLER ","sourceMap":"28:147:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54:21;;;;;;;;;160:25:2;;;148:2;133:18;54:21:1;;;;;;;110:63;;;:::i;:::-;;;156:6;;:10;;165:1;156:10;:::i;:::-;147:6;:19;110:63::o;196:225:2:-;236:3;267:1;263:6;260:1;257:13;254:2;;;312:10;307:3;303:20;300:1;293:31;347:4;344:1;337:15;375:4;372:1;365:15;254:2;-1:-1:-1;406:9:2;;244:177::o"}},"userdoc":{"kind":"user","methods":{},"version":1}}}},"errors":[{"component":"general","errorCode":"1878","formattedMessage":"Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> contracts/ImportMev8.sol\n\n","message":"SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.","severity":"warning","sourceLocation":{"end":-1,"file":"contracts/ImportMev8.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2462","formattedMessage":"Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it \"abstract\" is sufficient.\n --> contracts/ImportMev8.sol:8:5:\n  |\n8 |     constructor() public {}\n  |     ^^^^^^^^^^^^^^^^^^^^^^^\n\n","message":"Visibility for constructor is ignored. If you want the contract to be non-deployable, making it \"abstract\" is sufficient.","severity":"warning","sourceLocation":{"end":104,"file":"contracts/ImportMev8.sol","start":81},"type":"Warning"},{"component":"general","errorCode":"2462","formattedMessage":"Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it \"abstract\" is sufficient.\n --> contracts/DummyVersion8Contract.sol:8:5:\n  |\n8 |     constructor (bool success) public {\n  |     ^ (Relevant source part starts here and spans across multiple lines).\n\n","message":"Visibility for constructor is ignored. If you want the contract to be non-deployable, making it \"abstract\" is sufficient.","severity":"warning","sourceLocation":{"end":203,"file":"contracts/DummyVersion8Contract.sol","start":136},"type":"Warning"}],"sources":{"contracts/DummyVersion8Contract.sol":{"ast":{"absolutePath":"contracts/DummyVersion8Contract.sol","exportedSymbols":{"DummyVersion8Contract":[22],"ImportMev8":[41]},"id":23,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:0"},{"absolutePath":"contracts/ImportMev8.sol","file":"./ImportMev8.sol","id":2,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":23,"sourceUnit":42,"src":"57:26:0","symbolAliases":[],"unitAlias":""},{"abstract":false,"baseContracts":[{"baseName":{"id":3,"name":"ImportMev8","nodeType":"IdentifierPath","referencedDeclaration":41,"src":"120:10:0"},"id":4,"nodeType":"InheritanceSpecifier","src":"120:10:0"}],"contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":22,"linearizedBaseContracts":[22,41],"name":"DummyVersion8Contract","nameLocation":"95:21:0","nodeType":"ContractDefinition","nodes":[{"body":{"id":13,"nodeType":"Block","src":"170:33:0","statements":[{"expression":{"arguments":[{"id":10,"name":"success","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":6,"src":"188:7:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":9,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"180:7:0","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":11,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"180:16:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":12,"nodeType":"ExpressionStatement","src":"180:16:0"}]},"id":14,"implemented":true,"kind":"constructor","modifiers":[],"name":"","nameLocation":"-1:-1:-1","nodeType":"FunctionDefinition","parameters":{"id":7,"nodeType":"ParameterList","parameters":[{"constant":false,"id":6,"mutability":"mutable","name":"success","nameLocation":"154:7:0","nodeType":"VariableDeclaration","scope":14,"src":"149:12:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":5,"name":"bool","nodeType":"ElementaryTypeName","src":"149:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"148:14:0"},"returnParameters":{"id":8,"nodeType":"ParameterList","parameters":[],"src":"170:0:0"},"scope":22,"src":"136:67:0","stateMutability":"nonpayable","virtual":false,"visibility":"public"},{"body":{"id":20,"nodeType":"Block","src":"240:28:0","statements":[{"expression":{"arguments":[],"expression":{"argumentTypes":[],"id":17,"name":"increment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"250:9:0","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":18,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"250:11:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":19,"nodeType":"ExpressionStatement","src":"250:11:0"}]},"functionSelector":"6c5e4427","id":21,"implemented":true,"kind":"function","modifiers":[],"name":"callImported","nameLocation":"218:12:0","nodeType":"FunctionDefinition","parameters":{"id":15,"nodeType":"ParameterList","parameters":[],"src":"230:2:0"},"returnParameters":{"id":16,"nodeType":"ParameterList","parameters":[],"src":"240:0:0"},"scope":22,"src":"209:59:0","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":23,"src":"86:185:0","usedErrors":[]}],"src":"32:240:0"},"id":0},"contracts/ImportMev8.sol":{"ast":{"absolutePath":"contracts/ImportMev8.sol","exportedSymbols":{"ImportMev8":[41]},"id":42,"nodeType":"SourceUnit","nodes":[{"id":24,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"0:23:1"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":41,"linearizedBaseContracts":[41],"name":"ImportMev8","nameLocation":"37:10:1","nodeType":"ContractDefinition","nodes":[{"constant":false,"functionSelector":"8381f58a","id":26,"mutability":"mutable","name":"number","nameLocation":"69:6:1","nodeType":"VariableDeclaration","scope":41,"src":"54:21:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":25,"name":"uint256","nodeType":"ElementaryTypeName","src":"54:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"public"},{"body":{"id":29,"nodeType":"Block","src":"102:2:1","statements":[]},"id":30,"implemented":true,"kind":"constructor","modifiers":[],"name":"","nameLocation":"-1:-1:-1","nodeType":"FunctionDefinition","parameters":{"id":27,"nodeType":"ParameterList","parameters":[],"src":"92:2:1"},"returnParameters":{"id":28,"nodeType":"ParameterList","parameters":[],"src":"102:0:1"},"scope":41,"src":"81:23:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"},{"body":{"id":39,"nodeType":"Block","src":"137:36:1","statements":[{"expression":{"id":37,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":33,"name":"number","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":26,"src":"147:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":36,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":34,"name":"number","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":26,"src":"156:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"hexValue":"31","id":35,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"165:1:1","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"156:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"147:19:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":38,"nodeType":"ExpressionStatement","src":"147:19:1"}]},"functionSelector":"d09de08a","id":40,"implemented":true,"kind":"function","modifiers":[],"name":"increment","nameLocation":"119:9:1","nodeType":"FunctionDefinition","parameters":{"id":31,"nodeType":"ParameterList","parameters":[],"src":"128:2:1"},"returnParameters":{"id":32,"nodeType":"ParameterList","parameters":[],"src":"137:0:1"},"scope":41,"src":"110:63:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":42,"src":"28:147:1","usedErrors":[]}],"src":"0:176:1"},"id":1}}}

If we look at contractDependencies we can see that the list is blank. This is incorrect, as DummyVersion8Contract imports ImportMev8.sol and uses a function from it.

If you run the same process with v0.8.3 of solidity, we do not get this error.

Can we please address?

@chriseth
Copy link
Contributor

Contract dependencies only contain contracts that are created via 'new' or contracts whose bytecode is referenced, not contracts that are inherited. Can someone please check if we can improve the documentation around this?

@PatrickAlphaC
Copy link
Contributor Author

Wait, so this isn't a bug? It seems it was functionality removed from previous versions.

Or are you saying that this feature should never have been in past versions in the first place?

@chriseth
Copy link
Contributor

chriseth commented Aug 2, 2021

Yes, the meaning of the field was always intended to be "These contracts need to be compiled first in order to compile the current contract". You can follow the inheritance pointer if you want to get a list of contracts that includes base contracts in addition to that.

@PatrickAlphaC
Copy link
Contributor Author

Ah. So where can we see contract dependencies that are inherited? Is this "inheritance pointer" in the output of the solc --standard-json?

I'm asking because as part of a verification script, we were using the contractdependencies to make sure we flattened the code correctly, now we are trying to automate this again.

@chriseth
Copy link
Contributor

chriseth commented Aug 2, 2021

The type of code that still works with flattened source gets less and less. We are almost at a point where I would say that flattening is a security risk. If you want to extract all source code that is needed to compile a contract, you also have to include structs, libraries, file-level functions and so on.

For completeness: The base contracts of a contract can be found in the AST under the key "baseContracts" - the full hierarchy in "linearizedBaseContracts".

@PatrickAlphaC
Copy link
Contributor Author

Thanks for the tips. We don't deploy flattened code, but use it for verification. I found the keys you're referring to.

So ideally the way to "flatten" the code would be to iterate through the baseContracts and linearizedBaseContracts and import the code accordingly? Or are you saying to not flatten at all, or there might be a better verification method?

@chriseth
Copy link
Contributor

chriseth commented Aug 2, 2021

I'm saying not flatten at all. Don't throw away the metadata file and you have every single bit you need for verification. Do you know https://sourcify.dev/ ?

@chriseth
Copy link
Contributor

chriseth commented Aug 2, 2021

Where you do you verify? Etherscan? They support standard-json - if you don't use any framework that verifies for you on etherscan then please take a look at that.

1 similar comment
@chriseth
Copy link
Contributor

chriseth commented Aug 2, 2021

Where you do you verify? Etherscan? They support standard-json - if you don't use any framework that verifies for you on etherscan then please take a look at that.

@PatrickAlphaC
Copy link
Contributor Author

Yeah I'm using brownie, and recently their verifier relied on the contractDependencies being correct.... So I'm trying to figure out how to update it.

Sounds like linearizedBaseContracts is the solution... or something with using the standardjson

@cameel
Copy link
Member

cameel commented Aug 3, 2021

AFAIK Brownie itself uses --standard-json option when compiling contracts. I think it would make much more sense to use that for verification since that's actually the original input that the bytecode was compiled from. Flattened source is a different input that just happens to match if the code is normal enough that the flattening process does not break it. But even that only works because etherscan strips metadata from bytecode (and it does that mostly because metadata contains source hashes and paths and these obviously do not match if you alter the source by flattening it).

The only thing to watch out for would be to make sure that the JSON does not contain any absolute paths so make sure you only use relative paths when using remappings to make importing from external packages work.

@PatrickAlphaC
Copy link
Contributor Author

Hmm... Last I checked it looked like it was flattening source code instead of using standardjson. It looks like it would be pretty easy to refactor for this though. Thanks for the tips!

But yes, would love to see some more docs on this.

@cameel
Copy link
Member

cameel commented Aug 8, 2021

Last I checked it looked like it was flattening source code instead of using standardjson.

To be clear, I mean that Brownie is using Standard JSON for compilation. I thought you were trying to build the verification input yourself based on compiler's output and side-step is verification tool. This is why I'm suggesting to use Standard JSON instead.

Disappointingly, looks like Brownie had a feature request to implement verification with several competing PRs and for some reason they went with the one that uses the less robust, flattening approach (eth-brownie/brownie#411 (comment), PR: eth-brownie/brownie#914). So if you're actually trying do it through Brownie's tool, it looks like you might be forced to flatten.

@cameel
Copy link
Member

cameel commented Sep 10, 2021

Yes, the meaning of the field was always intended to be "These contracts need to be compiled first in order to compile the current contract".

I have just stumbled upon #121, and I wonder if this shouldn't have been treated as a breaking change after all. contractDependencies did have a comment indicating that the inclusion of inherited contracts was intentional and the comment stayed there up until #10228:

 	/// List of contracts this contract creates, i.e. which need to be compiled first.
	/// Also includes all contracts from @a linearizedBaseContracts.
	std::set<ContractDefinition const*> contractDependencies;

It was just an internal comment and the AST structure is not documented yet, so technically we did not guarantee that but some tools were clearly depending on it.

@PatrickAlphaC
Copy link
Contributor Author

^^^

@cameel cameel changed the title ContractDependencies Issue on 0.8.4+ contractDependencies in the AST no longer includes inherited contracts on 0.8.4+ Sep 10, 2021
@NunoFilipeSantos NunoFilipeSantos added the stale The issue/PR was marked as stale because it has been open for too long. label Nov 25, 2022
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

Hi everyone! This issue has been closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.

@github-actions github-actions bot added the closed due inactivity The issue/PR was automatically closed due to inactivity. label Feb 7, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. documentation 📖 stale The issue/PR was marked as stale because it has been open for too long.
Projects
None yet
Development

No branches or pull requests

5 participants