Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-docs-audit-1775035615.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
GPv2VaultRelayer API
TheGPv2VaultRelayer contract serves as an intermediary between CoW Protocol’s settlement system and Balancer Vault, facilitating fund transfers and swap execution with protocol fees.
State Variables
Access Control
onlyCreator modifier.
Functions
transferFromAccounts
Moves sell token amounts from user accounts to the settlement contract.| Balance Type | Description |
|---|---|
| ERC20 | Standard ERC20 token transfers |
| External | Balancer Vault external balances |
| Internal | Balancer Vault internal balances |
batchSwapWithFee
Executes multi-step swaps through Balancer pools and simultaneously collects protocol fees.| Name | Type | Description |
|---|---|---|
swaps | BatchSwapStep[] | Batch swap steps to execute |
tokens | IERC20[] | Token addresses involved |
funds | FundManagement | Fund management configuration |
limits | int256[] | Maximum token amounts |
deadline | uint256 | Transaction deadline |
feeTransfer | Transfer.Data | Fee collection transfer |
int256[] - Token deltas indicating amounts sent and received.
The function handles both sell orders (GIVEN_IN) and buy orders (GIVEN_OUT) swap kinds.
Security
- Access restricted exclusively to the creator through
onlyCreator - Unauthorized calls revert with
"GPv2: not creator" - Immutable state prevents tampering
- Users never interact with this contract directly