add support for self.balance

pull/2099/head
alpharush 1 year ago
parent a61ca34226
commit 4b07cbbc56
  1. 1
      slither/core/declarations/solidity_variables.py
  2. 2
      slither/vyper_parsing/expressions/expression_parsing.py

@ -39,6 +39,7 @@ SOLIDITY_VARIABLES_COMPOSED = {
# Vyper
"chain.id": "uint256",
"block.prevhash": "bytes32",
"self.balance": "uint256",
}

@ -368,7 +368,7 @@ def parse_expression(expression: Dict, caller_context) -> "Expression":
member_name = expression.attr
if isinstance(expression.value, Name):
if expression.value.id == "self":
if expression.value.id == "self" and member_name != "balance":
var, was_created = find_variable(member_name, caller_context)
# TODO replace with self
if was_created:

Loading…
Cancel
Save