Skip to content

Conversation

@lgahdl
Copy link

@lgahdl lgahdl commented Dec 2, 2025

Description
Fixing the Uniswap V2 Bytecode bug, the contracts, when built using "forge build", were generating a different bytecode than the expected, the original UniswapV2Pair bytecode was needed in order to have the correct initPoolCode working in the UniswapV2Router and in the driver.toml, so this was critical.
Solution: Use the bytecode directly from the @uniswap/v2-core npm package, without building with forge.

How to test
Go to playground folder and run docker-compose -f docker-compose.offline.yml up -d
Run ./test_playground_offline.sh --sellToken DAI --buyToken USDC --sellAmount 100e18 --from 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
If it doesn't throw the error "No Liquidity", it means it's working, because the driver.toml pool-code parameter is the original one.

Luiz Gustavo Abou Hatem de Liz added 4 commits November 27, 2025 10:26
…nto luizhatem/cow-566-replace-custom-balancessol-with-official-gpv2tradesimulator

# Conflicts:
#	configs/offline/driver.toml
#	playground/.env.offline
#	playground/offline-mode/state/anvil-state.json
…nto luizhatem/cow-566-replace-custom-balancessol-with-official-gpv2tradesimulator
…ng unused interfaces;

feat: Replacing uniswap built contract by prebuilt bytecodes directly from npm dependency;
@linear
Copy link

linear bot commented Dec 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants