Skip to content

Develop#2

Open
lgahdl wants to merge 61 commits intomainfrom
develop
Open

Develop#2
lgahdl wants to merge 61 commits intomainfrom
develop

Conversation

@lgahdl
Copy link

@lgahdl lgahdl commented Dec 19, 2025

This branch has all the 3 milestones proposed on the Grant Application - Offline Mode.
Includes:

  • 5 tokens (USDT, USDC, DAI, WETH and GNO);
  • Uniswap V2;
  • Cow Protocol Core;
  • Cow Protocol Auxiliary contracts (HooksTrampoline, Signatures, Balances, CowShed and Composable Cow);
  • Safe Wallet Contracts;
  • Coingecko Mocked API;
  • E2E Testing for market and limit orders, Stop Loss, TWAP, CowShed + Safe and Pre-hooks using HooksTrampoline.

Improvements:

  • Deployment addresses are the same from mainnet;
  • Chain ID 1;
  • Modular deployment scripts;
  • configurable balances with balances.json file;
    ¸
    How to test:
  • Run docker-compose up -d;
  • Wait for everything to build (orderbook sometimes takes very long for the first build, be patient);
  • Run npm test
  • Or, if you want to manually send an order, run npm run order:playground -- --sellToken WETH --buyToken DAI --sellAmount 0.1e18 --from 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --surplus 10 (You can set any token symbol from the 5 available);

Luiz Gustavo Abou Hatem de Liz and others added 10 commits December 18, 2025 16:31
… Uniswap V2, Mocked Balancer Vault, Cow Protocol Core and Auxiliary contracts and Cow Shed;
… necessary;

chore: replacing the local hooks-trampoline folder by a submodule;
chore: moving the SetBlockNumber solidity script to the contracts/script instead of scripts/deploy, since it's a solidity file, not a TS;
fix: using public rpc from environment variables;
refactor: getting weth bytecode from mainnet instead of hardcoded;
@lgahdl lgahdl requested a review from mfw78 December 19, 2025 18:52
Luiz Gustavo Abou Hatem de Liz added 5 commits December 24, 2025 00:11
…al twap orders being settled;

wip: missing stop loss and good-after-time functional tests;
feat: Improving the twap test;
feat: Completed Stop loss test:
note: The good-after-time test will not be able to be executed, is missing a solver specialized in conditional orders that is not part of the scope.
fix: Fixing enumeration of steps;
…g package.json accordingly;

feat: Creating jest setup with limit and market order tests.
refactor: Changing the oracle mock to return up to date prices always;
@lgahdl lgahdl self-assigned this Jan 6, 2026
Luiz Gustavo Abou Hatem de Liz added 5 commits January 6, 2026 16:59
…ogrammatic-orders' into luizhatem/cow-579-add-a-balancesjson-file-to-configure-initial-pairs-and-users
…initial-pairs-and-users' into luizhatem/cow-556-create-e2e-tests-for-limit-and-market-orders

# Conflicts:
#	scripts/orders/composable-cow/good-after-time.ts
…-orders' into luizhatem/cow-557-create-e2e-tests-for-composablecow-conditional-orders
fix: increasing time for limit order;
chore: Increasing the balances of the users and pool liquidity;
fix: Changing WETH using testERC20Bytecode to be able to mint tokens.
Luiz Gustavo Abou Hatem de Liz and others added 7 commits January 8, 2026 14:48
fix: Adding hooks contract address to the orderbook;
…ntracts-for-programmatic-orders

# Conflicts:
#	scripts/deploy/04-deploy-auxiliary.ts
chore: Applying changes from code review to make the readability better;
…ogrammatic-orders' into luizhatem/cow-579-add-a-balancesjson-file-to-configure-initial-pairs-and-users

# Conflicts:
#	scripts/deploy-all.ts
#	scripts/deploy/02-deploy-tokens.ts
#	scripts/deploy/04-deploy-cow-protocol.ts
#	scripts/deploy/06-add-liquidity.ts
…posablecow-contracts-for-programmatic-orders

feat: Deploying the composable cow with working twap tests, condition…
…ncesjson-file-to-configure-initial-pairs-and-users

feat: Adding configuration file for balances;
@mfw78
Copy link
Member

mfw78 commented Jan 16, 2026

Testing Feedback

Attempted to run the environment on Linux x86_64 (kernel 6.18.5) and encountered an error loading the Anvil state:

error: invalid value '/state/anvil-state.json' for '--load-state <PATH>': 
failed to parse json file: data did not match any variant of untagged enum SerializableTransactionType 
at line 1 column 709095

The chain container fails to start as a result. Happy to re-test once this is addressed.

@mfw78
Copy link
Member

mfw78 commented Jan 16, 2026

Additionally, when testing, I just followed the readme. Note that this didn't work from a first initial clone of the repository, as I by default cloned the repository within automatically pulling in submodules, and so this resulted in docker compose up -d failing with files missing. Please kindly insert a specific instruction in the README.md for how to clone to start.

@lgahdl
Copy link
Author

lgahdl commented Jan 16, 2026

Hey @mfw78 , Thanks for your feedback, I'm sorry to hear that failed in your machine, I will try to replicate your environment here and investigate this problem right now. Everything I find I'll put on the README.md, I was really expecting that only cloning the repository normally and running docker-compose up -d would work out-of-the-box, sorry for that.

@lgahdl
Copy link
Author

lgahdl commented Jan 19, 2026

Hi @mfw78 , I ran the project in a Ubuntu x86_64 machine, found and fixed some issues and updated the README.md:

  • Some docker containers were being initialized with arm64 config (breaking on x86_64 or x64 architectures)
  • foundry:latest was installing a version that was not compatible with the state.json file, fixed on 1.5.0-nightly.
  • Dockerfile was missing a step to install "make".
  • Added foundry as prerequisite in the README.md.
  • Added instructions to clone the repo with submodules.

Can you try run the project in your machine again? Let me know if you still have any trouble.

@mfw78
Copy link
Member

mfw78 commented Feb 27, 2026

FYI I was going through and reviewing this and I got up to the port offsets and received this:
image

Of interest, after running the set-port command, there was no change observed to my .env file.

@mfw78
Copy link
Member

mfw78 commented Feb 27, 2026

OK, further to the above, it seems that if the user's previous / current .env file does not have any PORT configuration declared within it, after running the npm run set-port command, it doesn't set the corresponding ports given that the default / other ports were absent.

ie. the issue that I had is I just used my previous .env file which didn't have these ports in it, and so it didn't work.

@mfw78
Copy link
Member

mfw78 commented Feb 27, 2026

On the most recent try with the above fix (I checked the diff on the .env vs the .env.example and I confirm the only difference is the ports and the RPC, I now receive:

[+] up 17/17
 ✔ Network offline-mode-review_default            Created                                                                                                                                                                                                                         0.1ss
 ✔ Container offline-mode-review-tempo-1          Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-chain-deployer-1 Healthy                                                                                                                                                                                                                         7.5ss
 ✔ Container offline-mode-review-frontend-1       Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-explorer-1       Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-db-1             Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-prometheus-1     Created                                                                                                                                                                                                                         0.5ss
 ✔ Container offline-mode-review-grafana-1        Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-adminer-1        Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-db-migrations-1  Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-chain-1          Healthy                                                                                                                                                                                                                         12.0s
 ✔ Container offline-mode-review-coingecko-mock-1 Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-driver-1         Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-baseline-1       Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-orderbook-1      Created                                                                                                                                                                                                                         0.1ss
 ✔ Container offline-mode-review-watch-tower-1    Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-autopilot-1      Created                                                                                                                                                                                                                         0.2ss
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "baseline": executable file not found in $PATH

@lgahdl
Copy link
Author

lgahdl commented Mar 2, 2026

On the most recent try with the above fix (I checked the diff on the .env vs the .env.example and I confirm the only difference is the ports and the RPC, I now receive:

[+] up 17/17
 ✔ Network offline-mode-review_default            Created                                                                                                                                                                                                                         0.1ss
 ✔ Container offline-mode-review-tempo-1          Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-chain-deployer-1 Healthy                                                                                                                                                                                                                         7.5ss
 ✔ Container offline-mode-review-frontend-1       Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-explorer-1       Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-db-1             Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-prometheus-1     Created                                                                                                                                                                                                                         0.5ss
 ✔ Container offline-mode-review-grafana-1        Created                                                                                                                                                                                                                         0.4ss
 ✔ Container offline-mode-review-adminer-1        Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-db-migrations-1  Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-chain-1          Healthy                                                                                                                                                                                                                         12.0s
 ✔ Container offline-mode-review-coingecko-mock-1 Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-driver-1         Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-baseline-1       Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-orderbook-1      Created                                                                                                                                                                                                                         0.1ss
 ✔ Container offline-mode-review-watch-tower-1    Created                                                                                                                                                                                                                         0.2ss
 ✔ Container offline-mode-review-autopilot-1      Created                                                                                                                                                                                                                         0.2ss
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "baseline": executable file not found in $PATH

This is odd, I deleted the images and volumes, started all over again, and was not able to reproduce this error, did you delete the images before running docker-compose up -d?

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.

3 participants