GPv2Settlement API
The core settlement contract for executing batch trades in Gnosis Protocol v2. Inherits:GPv2Signing, ReentrancyGuard, StorageAccessible
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Core settlement contract API for executing batch trades in Gnosis Protocol v2
GPv2Signing, ReentrancyGuard, StorageAccessible
GPv2Authentication public immutable authenticator;
IVault public immutable vault;
GPv2VaultRelayer public immutable vaultRelayer;
mapping(bytes => uint256) public filledAmount;
event Trade(
address indexed owner,
IERC20 sellToken,
IERC20 buyToken,
uint256 sellAmount,
uint256 buyAmount,
uint256 feeAmount,
bytes orderUid
);
event Interaction(address indexed target, uint256 value, bytes4 selector);
event Settlement(address indexed solver);
event OrderInvalidated(address indexed owner, bytes orderUid);
function settle(
IERC20[] calldata tokens,
uint256[] calldata clearingPrices,
GPv2Trade.Data[] calldata trades,
GPv2Interaction.Data[][3] calldata interactions
) external nonReentrant onlySolver;
| Name | Type | Description |
|---|---|---|
tokens | IERC20[] | Array of tokens involved in the settlement |
clearingPrices | uint256[] | Clearing prices for each token (aligned with tokens array) |
trades | GPv2Trade.Data[] | Encoded trade data |
interactions | GPv2Interaction.Data[][3] | Pre, intra, and post-settlement interactions |
function swap(
IVault.SingleSwap calldata singleSwap,
GPv2Trade.Data calldata trade
) external nonReentrant onlySolver returns (int256);
function invalidateOrder(bytes calldata orderUid) external;
function freeFilledAmountStorage(bytes[] calldata orderUids) external;
function freePreSignatureStorage(bytes[] calldata orderUids) external;
order.sellAmount * sellPrice >= order.buyAmount * buyPrice
Was this page helpful?