From d8e72ea20646d72c595fad1433c2e8face0ab5b4 Mon Sep 17 00:00:00 2001 From: Jerome P Date: Thu, 2 Mar 2023 01:40:37 +0200 Subject: [PATCH] Update how-to-test-a-property.md --- .../echidna/introduction/how-to-test-a-property.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/program-analysis/echidna/introduction/how-to-test-a-property.md b/program-analysis/echidna/introduction/how-to-test-a-property.md index a2bd447b..fa929c88 100644 --- a/program-analysis/echidna/introduction/how-to-test-a-property.md +++ b/program-analysis/echidna/introduction/how-to-test-a-property.md @@ -16,8 +16,8 @@ We will see how to test a smart contract with Echidna. The target is the followi ```Solidity contract Token{ - mapping(address => uint) public balances; - function airdrop() public{ + mapping(address => uint) public balances; + function airdrop() public{ balances[msg.sender] = 1000; } function consume() public{ @@ -101,12 +101,13 @@ $ echidna-test contract.sol --contract MyContract The following summarizes the run of Echidna on our example: ```Solidity - contract TestToken is Token{ + contract TestToken is Token { constructor() public {} - function echidna_balance_under_1000() public view returns(bool){ + + function echidna_balance_under_1000() public view returns(bool) { return balances[msg.sender] <= 1000; - } - } + } + } ``` ```bash