Ethereum: Solidity
Provide protocol logic using the ethereum virtual machine
Swap/Exchange Protocol Guide
Implementing the Protocol
The Manifest File
yamlCopy# Author information helps us reach out in case of issues
author:
name: Propellerheads.xyz
email: [email protected]
# Protocol Constants
constants:
# Minimum gas usage for a swap, excluding token transfers
protocol_gas: 30000
# Minimum expected capabilities (individual pools may extend these)
# To learn about Capabilities, see ISwapAdapter.sol
capabilities:
- SellSide
- BuySide
- PriceFunction
# Adapter contract (byte)code files
contract:
# Contract runtime (deployed) bytecode (required if no source is provided)
runtime: UniswapV2SwapAdapter.bin
# Source code (our CI can generate bytecode if you submit this)
source: UniswapV2SwapAdapter.sol
# Deployment instances for chain-specific bytecode
# Used by the runtime bytecode build script
instances:
- chain:
name: mainnet
id: 1
# Constructor arguments for building the contract
arguments:
- "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"
# Automatic test cases (useful if getPoolIds and getTokens aren't implemented)
tests:
instances:
- pool_id: "0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc"
sell_token: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
buy_token: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
block: 17000000
chain:
name: mainnet
id: 1Key Functions
Price (optional)
Swap
GetLimits
getCapabilities
getTokens (optional)
getPoolIds (optional)
Last updated