Skip to content

Commit 94fab45

Browse files
authored
Fix docs (#1710)
1 parent a96a127 commit 94fab45

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

docs/source/tutorial.rst

+10-14
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,9 @@ Consider the following contract:
441441
}
442442
}
443443
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){
445445
if (!stringCompare(g_0, x_0)) return false;
446446
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;
454447
455448
if (g_5 != x_5) return false;
456449
@@ -472,7 +465,7 @@ Consider the following contract:
472465
}
473466
474467
475-
When this contract is directly executed, by using the following command:
468+
When this contract is directly executed by using the following command:
476469

477470
.. code-block:: bash
478471
@@ -490,17 +483,20 @@ We encounter the following error:
490483
1 | import "@openzeppelin/contracts/token/PRC20/PRC20.sol";
491484
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
492485
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:
494489

495490
.. code-block:: json
496491
497492
{
498-
"remappings": [ "@openzeppelin/contracts/token/PRC20/=node_modules/PRC20" ],
493+
"remappings": [ "@openzeppelin/contracts/token/PRC20/=node_modules/PRC20/"]
499494
}
500495
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.
504500

505501
.. code-block:: bash
506502

0 commit comments

Comments
 (0)