IUniswapExchange.sol 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. pragma solidity ^0.5.0;
  2. contract IUniswapExchange {
  3. // Address of ERC20 token sold on this exchange
  4. function tokenAddress() external view returns (address token) {}
  5. // Address of Uniswap Factory
  6. function factoryAddress() external view returns (address factory) {}
  7. // Provide Liquidity
  8. function addLiquidity(uint256 min_liquidity, uint256 max_tokens, uint256 deadline) external payable returns (uint256) {}
  9. function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) external returns (uint256, uint256) {}
  10. // Get Prices
  11. function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought) {}
  12. function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256 eth_sold) {}
  13. function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought) {}
  14. function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256 tokens_sold) {}
  15. // Trade ETH to ERC20
  16. function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought) {}
  17. function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) external payable returns (uint256 tokens_bought) {}
  18. function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256 eth_sold) {}
  19. function ethToTokenTransferOutput(uint256 tokens_bought, uint256 deadline, address recipient) external payable returns (uint256 eth_sold) {}
  20. // Trade ERC20 to ETH
  21. function tokenToEthSwapInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline) external returns (uint256 eth_bought) {}
  22. function tokenToEthTransferInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient) external returns (uint256 eth_bought) {}
  23. function tokenToEthSwapOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline) external returns (uint256 tokens_sold) {}
  24. function tokenToEthTransferOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline, address recipient) external returns (uint256 tokens_sold) {}
  25. // Trade ERC20 to ERC20
  26. function tokenToTokenSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr) external returns (uint256 tokens_bought) {}
  27. function tokenToTokenTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr) external returns (uint256 tokens_bought) {}
  28. function tokenToTokenSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address token_addr) external returns (uint256 tokens_sold) {}
  29. function tokenToTokenTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address token_addr) external returns (uint256 tokens_sold) {}
  30. // Trade ERC20 to Custom Pool
  31. function tokenToExchangeSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address exchange_addr) external returns (uint256 tokens_bought) {}
  32. function tokenToExchangeTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address exchange_addr) external returns (uint256 tokens_bought) {}
  33. function tokenToExchangeSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address exchange_addr) external returns (uint256 tokens_sold) {}
  34. function tokenToExchangeTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address exchange_addr) external returns (uint256 tokens_sold) {}
  35. // ERC20 comaptibility for liquidity tokens
  36. bytes32 public name;
  37. bytes32 public symbol;
  38. uint256 public decimals;
  39. function transfer(address _to, uint256 _value) external returns (bool) {}
  40. function transferFrom(address _from, address _to, uint256 value) external returns (bool) {}
  41. function approve(address _spender, uint256 _value) external returns (bool) {}
  42. function allowance(address _owner, address _spender) external view returns (uint256) {}
  43. function balanceOf(address _owner) external view returns (uint256) {}
  44. function totalSupply() external view returns (uint256) {}
  45. // Never use
  46. function setup(address token_addr) external {}
  47. }