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

Compute offset to contracts #2382

Closed
wants to merge 11 commits into from
7 changes: 7 additions & 0 deletions FUNDING.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Optimism": {
"op-mainnet": {
"ownedBy": "0xc44F30Be3eBBEfdDBB5a85168710b4f0e18f4Ff0"
}
}
}
97 changes: 49 additions & 48 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/printers/human_printer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract SimpleVulnerableToken{

/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @param _owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
description="Slither is a Solidity and Vyper static analysis framework written in Python 3.",
url="https://github.com/crytic/slither",
author="Trail of Bits",
version="0.10.0",
version="0.10.1",
packages=find_packages(),
python_requires=">=3.8",
install_requires=[
"packaging",
"prettytable>=3.3.0",
"pycryptodome>=3.4.6",
"crytic-compile>=0.3.5,<0.4.0",
"crytic-compile>=0.3.6,<0.4.0",
# "crytic-compile@git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile",
"web3>=6.0.0",
"eth-abi>=4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion slither/core/declarations/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def get_modifier_from_signature(self, modifier_signature: str) -> Optional["Modi

def get_function_from_canonical_name(self, canonical_name: str) -> Optional["Function"]:
"""
Return a function from a a canonical name (contract.signature())
Return a function from a canonical name (contract.signature())
Args:
canonical_name (str): canonical name of the function (without return statement)
Returns:
Expand Down
2 changes: 1 addition & 1 deletion slither/core/slither_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _compute_offsets_from_thing(self, thing: SourceMapping):
for offset in range(definition.start, definition.end + 1):

if (
isinstance(thing, TopLevel)
isinstance(thing, (TopLevel, Contract))
or (
isinstance(thing, FunctionContract)
and thing.contract_declarer == thing.contract
Expand Down
2 changes: 1 addition & 1 deletion slither/vyper_parsing/cfg/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def analyze_expressions(self, caller_context) -> None:
if self._node.expression:

if self._node.type == NodeType.VARIABLE:
# Update the expression to be an assignement to the variable
# Update the expression to be an assignment to the variable
_expression = AssignmentOperation(
Identifier(self._node.variable_declaration),
self._node.expression,
Expand Down
2 changes: 1 addition & 1 deletion slither/vyper_parsing/declarations/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def _parse_params(self, params: Arguments):
def _parse_returns(self, returns: Union[Name, TupleVyper, Subscript]):

self._function.returns_src().set_offset(returns.src, self._function.compilation_unit)
# Only the type of the arg is given, not a name. We create an an `Arg` with an empty name
# Only the type of the arg is given, not a name. We create an `Arg` with an empty name
# so that the function has the correct return type in its signature but doesn't clash with
# other identifiers during name resolution (`find_variable`).
if isinstance(returns, (Name, Subscript)):
Expand Down
Loading