Add psender

Improve properties
pull/428/head
Josselin 5 years ago
parent 5f12a00e1b
commit fa3ba105be
  1. 1
      slither/tools/properties/platforms/echidna.py
  2. 4
      slither/tools/properties/properties/ercs/erc20/properties/transfer.py

@ -14,6 +14,7 @@ def generate_echidna_config(output_dir: Path, addresses: Addresses) -> str:
content = 'prefix: crytic_\n' content = 'prefix: crytic_\n'
content += f'deployer: "{addresses.owner}"\n' content += f'deployer: "{addresses.owner}"\n'
content += f'sender: ["{addresses.user}", "{addresses.attacker}"]\n' content += f'sender: ["{addresses.user}", "{addresses.attacker}"]\n'
content += f'psender: "{addresses.user}"\n'
content += 'coverage: true\n' content += 'coverage: true\n'
filename = 'echidna_config.yaml' filename = 'echidna_config.yaml'
write_file(output_dir, filename, content) write_file(output_dir, filename, content)

@ -64,6 +64,10 @@ ERC20_Transferable = [
description='No one should be able to send tokens to the address 0x0 (transferFrom).', description='No one should be able to send tokens to the address 0x0 (transferFrom).',
content=''' content='''
\t\tuint balance = this.balanceOf(msg.sender); \t\tuint balance = this.balanceOf(msg.sender);
\t\tif (balance == 0){
\t\t\trevert();
\t\t}
\t\tapprove(msg.sender, balance);
\t\treturn transferFrom(msg.sender, address(0x0), this.balanceOf(msg.sender));''', \t\treturn transferFrom(msg.sender, address(0x0), this.balanceOf(msg.sender));''',
type=PropertyType.CODE_QUALITY, type=PropertyType.CODE_QUALITY,
return_type=PropertyReturn.FAIL_OR_THROW, return_type=PropertyReturn.FAIL_OR_THROW,

Loading…
Cancel
Save