Package: eth-wake
Wake, a Python-based Solidity development and testing framework with built-in vulnerability detectorsFeatures:testing framework based onpytestproperty-based fuzzerdeployments & mainnet interactionsvulnerability and code quality detectorsprinters for extracting useful information from Solidity codestatic analysis framework for implementing custom detectors and printersGithub actions forsetting up Wakeandrunning detectorslanguage server (LSP)VS Code extension (Tools for Solidity)solc version managerDependenciesPython (version 3.7 or higher)Rosetta must be enabled on Apple Silicon Macs⚠️ Python 3.12 is experimentally supported.Installationviapippip3installeth-wakeDocumentation & ContributionWake documentation can be foundhere.There you can also find a section oncontributing.Discovered vulnerabilitiesVulnerabilitySeverityProjectMethodDiscovered byResourcesProfit & loss accounted twiceCriticalIPORFuzz testAckee BlockchainReport,Wake testsConsole permanent denial of serviceHighBrahmaFuzz testAckee BlockchainReportSwap unwinding formula errorHighIPORFuzz testAckee BlockchainReport,Wake testsSwap unwinding fee accounted twiceHighIPORFuzz testAckee BlockchainReport,Wake testsIncorrect event dataHighSoladyIntegration testAckee BlockchainReport,Wake testsINTEREST_FROM_STRATEGY_BELOW_ZEROreverts DoSMediumIPORFuzz testAckee BlockchainReport,Wake testsInaccurate hypothetical interest formulaMediumIPORFuzz testAckee BlockchainReport,Wake testsSwap unwinding fee normalization errorMediumIPORFuzz testAckee BlockchainReport,Wake testsLiquidation deposits accounted into LP balanceMediumIPORFuzz testAckee BlockchainReport,Wake testsMissing receive functionMediumAxelarFuzz testAckee BlockchainWake testsSafeERC20not used forapproveMediumLidoFuzz testAckee BlockchainWake testsFeaturesTesting frameworkSeeexamplesanddocumentationfor more information.Writing tests is as simple as:fromwake.testingimport*frompytypes.contracts.CounterimportCounter@default_chain.connect()deftest_counter():counter=Counter.deploy()assertcounter.count()==0counter.increment()assertcounter.count()==1FuzzerFuzzer builds on top of the testing framework and allows efficient fuzz testing of Solidity smart contracts.fromwake.testingimport*fromwake.testing.fuzzingimport*frompytypes.contracts.CounterimportCounterclassCounterTest(FuzzTest):defpre_sequence(self)->None:self.counter=Counter.deploy()self.count=0@flow()defincrement(self)->None:self.counter.increment()self.count+=1@flow()defdecrement(self)->None:withmay_revert(PanicCodeEnum.UNDERFLOW_OVERFLOW)ase:self.counter.decrement()ife.valueisnotNone:assertself.count==0else:self.count-=1@invariant(period=10)defcount(self)->None:assertself.counter.count()==self.count@default_chain.connect()deftest_counter():CounterTest().run(sequences_count=30,flows_count=100)DetectorsAll vulnerability & code quality detectors can be run using:wakedetectallA specific detector can be run using:wakedetect<detector-name>See thedocumentationfor a list of all detectors.PrintersA specific printer can be run using:wakeprint<printer-name>See thedocumentationfor a list of all printers.Custom detectors & printersRefer to thegetting startedguide for more information.
Also check outwake_detectorsandwake_printersfor the implementation of built-in detectors and printers.LSP serverWake implements anLSPserver for Solidity. The only currently supported communication channel is TCP.Wake LSP server can be run using:wakelspOr with an optional --port argument (default 65432):wakelsp--port1234All LSP server features can be found in thedocumentation.LicenseThis project is licensed under theISC license.PartnersRockawayXCoinbase