From 78caeb691c902cc73f5aa72cf3201e11b3897d15 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Sat, 7 Jan 2023 08:52:16 -0600 Subject: [PATCH 1/3] track type aliases at top level --- slither/core/compilation_unit.py | 6 ++++++ slither/solc_parsing/slither_compilation_unit_solc.py | 1 + slither/solc_parsing/solidity_types/type_parsing.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/slither/core/compilation_unit.py b/slither/core/compilation_unit.py index d97b7fbf5..2144d4c81 100644 --- a/slither/core/compilation_unit.py +++ b/slither/core/compilation_unit.py @@ -18,6 +18,7 @@ from slither.core.declarations.enum_top_level import EnumTopLevel from slither.core.declarations.function_top_level import FunctionTopLevel from slither.core.declarations.using_for_top_level import UsingForTopLevel from slither.core.declarations.structure_top_level import StructureTopLevel +from slither.core.solidity_types.type_alias import TypeAliasTopLevel from slither.core.scope.scope import FileScope from slither.core.variables.state_variable import StateVariable from slither.core.variables.top_level_variable import TopLevelVariable @@ -46,6 +47,7 @@ class SlitherCompilationUnit(Context): self._pragma_directives: List[Pragma] = [] self._import_directives: List[Import] = [] self._custom_errors: List[CustomError] = [] + self._user_defined_value_types: Dict[str, TypeAliasTopLevel] = {} self._all_functions: Set[Function] = set() self._all_modifiers: Set[Modifier] = set() @@ -215,6 +217,10 @@ class SlitherCompilationUnit(Context): def custom_errors(self) -> List[CustomError]: return self._custom_errors + @property + def user_defined_value_types(self) -> Dict[str, TypeAliasTopLevel]: + return self._user_defined_value_types + # endregion ################################################################################### ################################################################################### diff --git a/slither/solc_parsing/slither_compilation_unit_solc.py b/slither/solc_parsing/slither_compilation_unit_solc.py index 7bae88c5c..201cc48cd 100644 --- a/slither/solc_parsing/slither_compilation_unit_solc.py +++ b/slither/solc_parsing/slither_compilation_unit_solc.py @@ -330,6 +330,7 @@ class SlitherCompilationUnitSolc(CallerContextExpression): user_defined_type = TypeAliasTopLevel(original_type, alias, scope) user_defined_type.set_offset(top_level_data["src"], self._compilation_unit) + self._compilation_unit.user_defined_value_types[alias] = user_defined_type scope.user_defined_types[alias] = user_defined_type else: diff --git a/slither/solc_parsing/solidity_types/type_parsing.py b/slither/solc_parsing/solidity_types/type_parsing.py index b62f908d1..91e320a42 100644 --- a/slither/solc_parsing/solidity_types/type_parsing.py +++ b/slither/solc_parsing/solidity_types/type_parsing.py @@ -243,7 +243,7 @@ def parse_type( sl = caller_context.compilation_unit next_context = caller_context renaming = {} - user_defined_types = {} + user_defined_types = sl.user_defined_value_types else: assert isinstance(caller_context, FunctionSolc) sl = caller_context.underlying_function.compilation_unit From 3646ea4bb8fc2bc360ad801f2fb2a08b592b4479 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 10 Jan 2023 08:32:50 -0600 Subject: [PATCH 2/3] add tests --- .../top-level-0.8.8.sol-0.8.10-compact.zip | Bin 0 -> 2592 bytes .../top-level-0.8.8.sol-0.8.11-compact.zip | Bin 0 -> 2589 bytes .../top-level-0.8.8.sol-0.8.12-compact.zip | Bin 0 -> 2587 bytes .../top-level-0.8.8.sol-0.8.13-compact.zip | Bin 0 -> 2590 bytes .../top-level-0.8.8.sol-0.8.14-compact.zip | Bin 0 -> 2591 bytes .../top-level-0.8.8.sol-0.8.15-compact.zip | Bin 0 -> 2592 bytes .../top-level-0.8.8.sol-0.8.8-compact.zip | Bin 0 -> 2584 bytes .../top-level-0.8.8.sol-0.8.10-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.11-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.12-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.13-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.14-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.15-compact.json | 5 +++++ .../top-level-0.8.8.sol-0.8.8-compact.json | 5 +++++ tests/test_ast_parsing.py | 1 + 15 files changed, 36 insertions(+) create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.11-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.12-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.zip create mode 100644 tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.8-compact.zip create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.11-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.12-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.json create mode 100644 tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.8-compact.json diff --git a/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.zip b/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.zip new file mode 100644 index 0000000000000000000000000000000000000000..38be57cf8b764ce6d560839cf81911d6d57919dd GIT binary patch literal 2592 zcma);_dgU41IN!gnP1_YGwv(0vm%le;mF7cdb6so|SWDKYgFypV#a8ynlHA^7#Ya7A6dgIskeAC!p|_jIGR-!}S0b0O0aX06-D| z0HFN?M4dp$!U9)*3%rO#`-FG_l+z=|$YKFY4Su3Nsnv;){IvA(}_j&Vs z4~ow=XXKGuO8Fk&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B^qu2wQg*mV#p&95cuah-)l{4{4K_wh<4$ z6r8Kbsh583HK{I^0>bK^ekx;fhAQ4(r4*WYPtuV-@&L!+w+S*$piG;LhuMmV zlE$y`If~MtVD%ZipfFJe6j6T}Uqa4an=5i+T)!En+stXR%u=?JRfh<#IFbFBy!&a? z&x8;~KvbOD?{6e@e9y;JD%iV!Hfx;nUjUFVt>hLPwj*1zSZA)jJZe_x9D+hP8ac?9 z=iHjNaG*YiByFR&dWRS;VMw<`JaHQ4zt;jjZnMn=GUdq^(0tE+l+w*eDH{~f5~YAo z5$5q6VUJq+C2qQFv+rkSfW`}n9el>{7G$i}WEJ=5hu=gcqBxgyY_GUiZq(b+fhp23 z&!p!{2hFVJ)+4ZQS$T+?YkvM$3C$S3GbBoPrZl%Fm}_zU6rgy08Y_E<)FC5RqWIs% h_9xo@yD+kU^?&voQiqc2-#ghKjQ_a$PXYn}{{U7((U1TD literal 0 HcmV?d00001 diff --git a/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.zip b/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.zip new file mode 100644 index 0000000000000000000000000000000000000000..4f8ef1b383d2dc2f625e8d28e4c8713c311a9458 GIT binary patch literal 2590 zcma);=Q|sU0*8Zy6ML&jwPsOi?Y(NmR-^We8jT=!5H%YbhuSArt(t9>ialzTnsw}1 zG^lx^s;G*(J@@;4p8I=0ykCBQz-w+y1Jndi1DF9NIubUuOGSJBU;sc^3jnwU002VJ z0We?BFi&5Y)E%YY1fzXjJ;MXgK_RY)pofo;VV-wQA3~%TiBuXtufw0>HETy$P(JvqEiXDyzW z^}(}wA2EDxtSp{spUMguEv(ZaD~zQt#b8FO6jsC^?)4FJZWVW6%(OXm_nnN(0YGfMXcfA?b`@+-<;^GvR1VB}9^ zlFLRTSu_%}rvH#+ZT2>>WP7Fq8CkM$Cw{fcUik+^{Jkh`k(X0^IB+U#)iUJ)xrjR= z#gZD>SC_i>GQH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WyrKjp~`@1XZ08PIsWO!b^;C+%&T#&pd{*9&o$q!}5fZ*?Hg1@q+J=}Gednp#n zW+1`#X-xFk?at(kh;o3M*%%MoR}Ljh?%wPqhBq=-`;k#EEQ-9g%AhvnuA};9>iiaD z+niZ-Y5+>hDi=t%gKl`U<0_(N#Y{C?jStCj=u=^*;g0ow@}(qL@eShk@ieTmQ1@Mw z2b5QV7>u}IdBxcfZ;UM$o{lFS8=@>pF-4bLG0qyL+{H{|GN&B} z*zo%eZ4~8P3r}T3{Mb}Jo#ivCnPxf+V(ynLb3LCg?+5wsnX4)V&$zGkAg7)VBQ_Qc zAJ|^cBW_+s#P>?A#zG{d0u(6ob;=oo)r3i%T^A59ZVoY-M2SYTxAXE1)lM9Y$tn2e zpBtLsw2zT>fu3aF&`Cs%kHu{EcVvuZuIIHbyFxKrlgvx>NE-CrAFbfKvODs$(2YUh z6#|6*2VkJ74#%t0R+y+gY)T%Ne?re}mtd9s%Z-8QlE*{eAQpdqbupfkZf;CPtx5C0 iqwROM{dcic|LXrtICEnV?Z0=b-&p@P@plCR0RI8r@!P2Y literal 0 HcmV?d00001 diff --git a/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.zip b/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.zip new file mode 100644 index 0000000000000000000000000000000000000000..12359abb509f4cd30d41c6bb822542e0a1b8b125 GIT binary patch literal 2591 zcma);cQ_P|1IEwF<|ONE$(|WW9WLWSaW--GIdbmK$Vehw_DuHPoh>UfGvsWSy>};~ z_!jc(`}_a*Jiqtz$NSIw@B2I-m_7xiI)EI&1jyHvFmDEJ5iqm>fUpJtAPN8gd@xvP z6v7vQl9rQE`HMFOWry&`V!V9p9K4)d-Fy);PrWf{T1qMa8~_Lb0Kk!vNQDap&w|O( zrhAOp{b;vaU3|DWV~`sE7w-;s`R`C>T*+Hoi!XrypywgmZWge&WJ@DV5x38i)Bg&p zWh+YUvQg(&P<$~fx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@``x98cL@JT4#1YN~2WY4{kGJtFpe$1)t+C>ly zo#tph*j*`;|M4c47sxJUQx9#A-myiZo`R^z#y;cwa{4F6Crdos)AXRF3T~`Uq;HO+ ztRdVtO?9Ts=7#XpL*EzP&o{Lya#*rxUvHF;6L!sk?4#u;fVr8q*`v4AGzPuXiLT(T zX3<9zxX;hGYyi`8j#QEr&=!@QkN0@8WW_yYxRh)f9@*DGv$f{Uzsn8Wb<{`!O8-I3 ze_^Q@N_x%{OcR-(y;~I~gj47iN+y}oR5A$@a@Arr`bZ^uudFObM*>j_Lop!`8cY?| zc`$gB(q9S&aJ^&Qzmn9D>MF6iqWK%c{7TDo^uB&6!jzQjZ(%*HYg%*OCDvt_OsI?Vy`f)#L{K=JYdhzIN1tmK< zy{CsRl$>GN!Y;5J|DtUYk#IDlaHHpxybhz}fQ+hRyy)Au9d9)N{ra#am^5zGO86ygNBdOO!E6svQHS zuRSbEn&!PQTgo!t+>Z^!b^Wj$sOmodw9d~PUzO;)uPDWD?A{!9 z0xSbpwj(3NVTjd4W1p;n0qiL3n}hEwYWmZIISlq!k6Ge|ts5KooPB#2yC82qz=knf z-~ylmel$hrPl_M5VR<-bcrxQJL(Xo-h1=?evdSc8J9G7?1<@=$BN%pu7)&!7BAl_! z{0{GHw0E9#^?X-ng9DF;Nf`ugt6Btu|8Hjw zjz_zIzXx`jrwI|!rgGR91sA{L)hUz$qlW#6O^7j|+7X8Z>1!*~JmG3Tmk$QhCnHy< k_}|v{SKR)a5VC*k|8zK*KGn5<=VX5|``ZnFH4p&!4?A(sy#N3J literal 0 HcmV?d00001 diff --git a/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.zip b/tests/ast-parsing/compile/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.zip new file mode 100644 index 0000000000000000000000000000000000000000..4de1fa4acdce41528672f04ea2066612bc71c962 GIT binary patch literal 2592 zcma);Wm^-B0)|JINS82akw!wAfuszCQPW9C4W_^dX?TIb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9ADctE7?dxw+r`#%&b8DZS`?0FJq(a zbZIYw8`2zk$MGcst6x6~CJh%CDV1&yF8UK3P z(QSL0q(s^HGI-%>T2>P~Y>=cS?#tRJE9E5E12ith(!=G80;MB@-~X5zmS z8O<NP@>P1hHDx2R2sanbV-KGm^;)@=M0TLg4s!;@;yI%Z7Uv{{Y}W^tt3m literal 0 HcmV?d00001 diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.10-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.11-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.11-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.11-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.12-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.12-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.12-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.13-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.14-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.15-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.8-compact.json b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.8-compact.json new file mode 100644 index 000000000..c8211c636 --- /dev/null +++ b/tests/ast-parsing/expected/user_defined_value_type/top-level-0.8.8.sol-0.8.8-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "set(StackTop,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: INLINE ASM 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/test_ast_parsing.py b/tests/test_ast_parsing.py index 0d6118601..af5a978c0 100644 --- a/tests/test_ast_parsing.py +++ b/tests/test_ast_parsing.py @@ -418,6 +418,7 @@ ALL_TESTS = [ Test("user_defined_value_type/constant-0.8.8.sol", ["0.8.8"] + make_version(8, 10, 15)), Test("user_defined_value_type/erc20-0.8.8.sol", ["0.8.8"] + make_version(8, 10, 15)), Test("user_defined_value_type/in_parenthesis-0.8.8.sol", ["0.8.8"] + make_version(8, 10, 15)), + Test("user_defined_value_type/top-level-0.8.8.sol", ["0.8.8"] + make_version(8, 10, 15)), Test("bytes_call.sol", ["0.8.12"]), Test("modifier_identifier_path.sol", VERSIONS_08), Test("free_functions/libraries_from_free.sol", ["0.8.12"]), From 4206739517778ebd48f0b676d01deec968091df4 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 10 Jan 2023 08:36:16 -0600 Subject: [PATCH 3/3] add test case --- .../top-level-0.8.8.sol | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/ast-parsing/user_defined_value_type/top-level-0.8.8.sol diff --git a/tests/ast-parsing/user_defined_value_type/top-level-0.8.8.sol b/tests/ast-parsing/user_defined_value_type/top-level-0.8.8.sol new file mode 100644 index 000000000..7021d3744 --- /dev/null +++ b/tests/ast-parsing/user_defined_value_type/top-level-0.8.8.sol @@ -0,0 +1,27 @@ +type Operand is uint256; +type StackTop is uint256; +struct StorageOpcodesRange { + uint256 pointer; + uint256 length; +} +struct IntegrityState { + // Sources first as we read it in assembly. + bytes[] sources; + StorageOpcodesRange storageOpcodesRange; + uint256 constantsLength; + uint256 contextLength; + StackTop stackBottom; + StackTop stackMaxTop; + uint256 contextScratch; + function(IntegrityState memory, Operand, StackTop) + view + returns (StackTop)[] integrityFunctionPointers; +} + +contract Test { + function set(StackTop stackTop_, uint256 a_) internal pure { + assembly { + mstore(stackTop_, a_) + } + } +} \ No newline at end of file