Merge pull request #713 from crytic/dev-external-totalSupply

Allow totalSupply() to be an external method in the ERC20 properties
pull/725/head
Feist Josselin 4 years ago committed by GitHub
commit 3826d51795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      slither/tools/properties/properties/ercs/erc20/properties/mint.py
  2. 4
      slither/tools/properties/properties/ercs/erc20/properties/transfer.py

@ -10,7 +10,7 @@ ERC20_NotMintable = [
name="crytic_supply_constant_ERC20PropertiesNotMintable()",
description="The total supply does not increase.",
content="""
\t\treturn initialTotalSupply >= totalSupply();""",
\t\treturn initialTotalSupply >= this.totalSupply();""",
type=PropertyType.MEDIUM_SEVERITY,
return_type=PropertyReturn.SUCCESS,
is_unit_test=True,

@ -37,7 +37,7 @@ ERC20_Transferable = [
name="crytic_less_than_total_ERC20Properties()",
description="Balance of one user must be less or equal to the total supply.",
content="""
\t\treturn this.balanceOf(msg.sender) <= totalSupply();""",
\t\treturn this.balanceOf(msg.sender) <= this.totalSupply();""",
type=PropertyType.MEDIUM_SEVERITY,
return_type=PropertyReturn.SUCCESS,
is_unit_test=True,
@ -48,7 +48,7 @@ ERC20_Transferable = [
name="crytic_totalSupply_consistant_ERC20Properties()",
description="Balance of the crytic users must be less or equal to the total supply.",
content="""
\t\treturn this.balanceOf(crytic_owner) + this.balanceOf(crytic_user) + this.balanceOf(crytic_attacker) <= totalSupply();""",
\t\treturn this.balanceOf(crytic_owner) + this.balanceOf(crytic_user) + this.balanceOf(crytic_attacker) <= this.totalSupply();""",
type=PropertyType.MEDIUM_SEVERITY,
return_type=PropertyReturn.SUCCESS,
is_unit_test=True,

Loading…
Cancel
Save