-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: calldata for fallback and receive
- Loading branch information
1 parent
2392a63
commit f71571b
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,11 +277,23 @@ def create_calldata_generic( | |
|
||
results = [] | ||
|
||
# empty calldata for receive() and empty fallback() function calls | ||
results.append(ByteVec(Concat(con(32), con(0)))) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
# dummy calldata for nonempty fallback() call | ||
fallback_selector = BitVec("fallback_selector", 4 * 8) # see below for additional constraints | ||
fallback_data_size = 1024 # TODO: configurable | ||
fallback_data = BitVec("fallback_data", fallback_data_size * 8) | ||
results.append(ByteVec(Concat(con(32), con(4+fallback_data_size), fallback_selector, fallback_data))) | ||
This comment has been minimized.
Sorry, something went wrong.
karmacoma-eth
Collaborator
|
||
|
||
for funsig in methodIdentifiers: | ||
funname = funsig.split("(")[0] | ||
funselector = methodIdentifiers[funsig] | ||
funinfo = FunctionInfo(funname, funsig, funselector) | ||
|
||
# assume fallback_selector differs from all existing selectors | ||
ex.path.append(fallback_selector != con(int(funselector, 16), 32)) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
if not include_view: | ||
fun_abi = find_abi(abi, funinfo) | ||
if fun_abi["stateMutability"] in ["pure", "view"]: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
would be better to avoid z3 objects when we can: