• coverage_labs Profile Picture

    Coverage @coverage_labs

    5 months ago

    šŸ’” Solidity Tip of the Week Debugging the fuzzing process is essential for ensuring the effective testing of smart contract properties. With that in mind, here are some tips for debugging with Echidna: š—Øš˜€š—¶š—»š—“ š—–š—¼š˜ƒš—²š—æš—®š—“š—² š—„š—²š—½š—¼š—æš˜ A Coverage report is a file containing information on which parts of the code were covered during fuzzing. We can see in the first image a snippet of a coverage report containing only one function that is responsible for testing a specific property. The `*` on the left tells us that the fuzzer was capable of successfully executing all lines of code. There are other symbols, such as: • `r`, if execution finished with REVERT • `o`, if execution finished with out-of-gas error • `e`, if execution finished with another error It's possible to see more than one symbol in a single line, such as `*r`. In this case, `*r` indicates the fuzzer executed that line despite having reverted at another point. š—”š—¼š˜š—²: To generate reports, you must set the coverage flag to true. See link: lnkd.in/d6ux9DcA. But how do these coverage reports help us debug? šŸ¤” They will help us in two ways: 1ļøāƒ£ To verify if the tests are well implemented Echidna may show a test as successful even if it's a false positive. This happens when the property assertion isn't executed, often due to business logic errors in the test. Always verify test coverage to ensure assertions are executed and tests are correctly implemented.ļø 2ļøāƒ£ To verify the coverage of the smart contracts that are subject to testing The coverage report gives us which lines of code were tested by the fuzzer. Therefore, it makes sense to verify if the fuzzer has covered as many lines of code as possible. The more coverage, the more reliable the tests are likely to be. š—Øš˜€š—¶š—»š—“ `š—®š˜€š˜€š—²š—æš˜(š—³š—®š—¹š˜€š—²)` & š—˜š˜ƒš—²š—»š˜ š—˜š—ŗš—¶š˜€š˜€š—¶š—¼š—» Why `assert(false)`? Simple, is to intentionally break the execution so that we can observe the stack trace. This gives more detailed information about the execution flow, helping in the debugging process. We can combine `assert(false)` with event emission to log relevant values, as we can see in the second image. These events are also prompted in the stack trace, and this can be useful for comparing the obtained values with the expected ones. We can conclude the property failed because the obtained value was lower than expected. With this info, we can focus on why this situation occurred and investigate the code scope where this problem might originate. See Trail of Bits properties lib: lnkd.in/dDDhckyN. šŸ”’ We've got you covered! Follow us for the latest updates, tips, and insights on blockchain security and development!

    coverage_labs tweet picture
    coverage_labs tweet picture
    keyboard_arrow_left Previous keyboard_arrow_right Next

    0 0 1 130 0
    Download Image
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with Xā„¢. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro