@@ -441,16 +441,9 @@ Consider the following contract:
441
441
}
442
442
}
443
443
444
- function nothing(string memory g_0, bytes3 g_1, bytes5 g_2, bytes5 g_3, bytes3 g_4, bytes3 g_5, bytes3 g_6, bytes3 g_7, bytes3 g_8, bytes3 g_9, bytes3 g_10, bytes3 g_11) public view returns (bool){
444
+ function nothing(string memory g_0, bytes3 g_5, bytes3 g_6, bytes3 g_7, bytes3 g_8, bytes3 g_9, bytes3 g_10, bytes3 g_11) public view returns (bool){
445
445
if (!stringCompare(g_0, x_0)) return false;
446
446
447
- if (g_1 != x_1) return false;
448
-
449
- if (g_2 != x_2) return false;
450
-
451
- if (g_3 != x_3) return false;
452
-
453
- if (g_4 != x_4) return false;
454
447
455
448
if (g_5 != x_5) return false;
456
449
@@ -472,7 +465,7 @@ Consider the following contract:
472
465
}
473
466
474
467
475
- When this contract is directly executed, by using the following command:
468
+ When this contract is directly executed by using the following command:
476
469
477
470
.. code-block :: bash
478
471
@@ -490,17 +483,20 @@ We encounter the following error:
490
483
1 | import "@openzeppelin/contracts/token/PRC20/PRC20.sol";
491
484
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
492
485
493
- This is because Mythril uses Solidity to compile the program, to circumvent this issue we can use the following solc-json file:
486
+ This is because Mythril uses Solidity to compile the program. Solidity does not have access to the import locations.
487
+ This import information has to be explicitly provided to Solidity through Mythril.
488
+ We can do this by providing the remapping information to Mythril as follows:
494
489
495
490
.. code-block :: json
496
491
497
492
{
498
- "remappings" : [ " @openzeppelin/contracts/token/PRC20/=node_modules/PRC20" ],
493
+ "remappings" : [ " @openzeppelin/contracts/token/PRC20/=node_modules/PRC20/ " ]
499
494
}
500
495
501
- Here we are mapping the import ``@openzeppelin/contracts/token/PRC20/ `` to the path which contains ``PRC20.sol `` which in this case
502
- is ``node_modules/PRC20 ``. This instructs the compiler to search for anything with the prefix ``@openzeppelin/contracts/token/PRC20/` `
503
- in the path ``node_modules/PRC20 `` in our file system. We feed to file to Mythril using ``--solc-json `` argument.
496
+ Here we are mapping the import ``@openzeppelin/contracts/token/PRC20/ `` to the path which contains ``PRC20.sol ``, which this example
497
+ assumes as ``node_modules/PRC20 ``. This instructs the compiler to search for anything with the prefix ``@openzeppelin/contracts/token/PRC20/` `
498
+ in the path ``node_modules/PRC20 `` in our file system. We feed this file to Mythril using ``--solc-json `` argument, which
499
+ relays it to the solc compiler.
504
500
505
501
.. code-block :: bash
506
502
0 commit comments