interface UniswapFactoryInterface {// Public Variablesaddress public exchangeTemplate;uint256 public tokenCount;// Create Exchangefunction createExchange(address token) external returns (address exchange);// Get Exchange and Token Infofunction getExchange(address token) external view returns (address exchange);function getToken(address exchange) external view returns (address token);function getTokenWithId(uint256 tokenId) external view returns (address token);// Never usefunction initializeFactory(address template) external;}
contract UniswapFactoryInterface():# Create Exchangedef createExchange(token: address) -> address: modifying# Public Variablesdef exchangeTemplate() -> address: constantdef tokenCount() -> uint256: constant# Get Exchange and Token Infodef getExchange(token_addr: address) -> address: constantdef getToken(exchange: address) -> address: constantdef getTokenWithId(token_id: uint256) -> address: constant# Initialize Factorydef initializeFactory(template: address): modifying
interface UniswapExchangeInterface {// Address of ERC20 token sold on this exchangefunction tokenAddress() external view returns (address token);// Address of Uniswap Factoryfunction factoryAddress() external view returns (address factory);// Provide Liquidityfunction addLiquidity(uint256 min_liquidity, uint256 max_tokens, uint256 deadline) external payable returns (uint256);function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) external returns (uint256, uint256);// Get Pricesfunction getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought);function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256 eth_sold);function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought);function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256 tokens_sold);// Trade ETH to ERC20function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought);function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) external payable returns (uint256 tokens_bought);function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256 eth_sold);function ethToTokenTransferOutput(uint256 tokens_bought, uint256 deadline, address recipient) external payable returns (uint256 eth_sold);// Trade ERC20 to ETHfunction tokenToEthSwapInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline) external returns (uint256 eth_bought);function tokenToEthTransferInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient) external returns (uint256 eth_bought);function tokenToEthSwapOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline) external returns (uint256 tokens_sold);function tokenToEthTransferOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline, address recipient) external returns (uint256 tokens_sold);// Trade ERC20 to ERC20function tokenToTokenSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr) external returns (uint256 tokens_bought);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);function tokenToTokenSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address token_addr) external returns (uint256 tokens_sold);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);// Trade ERC20 to Custom Poolfunction tokenToExchangeSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address exchange_addr) external returns (uint256 tokens_bought);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);function tokenToExchangeSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address exchange_addr) external returns (uint256 tokens_sold);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);// ERC20 comaptibility for liquidity tokensbytes32 public name;bytes32 public symbol;uint256 public decimals;function transfer(address _to, uint256 _value) external returns (bool);function transferFrom(address _from, address _to, uint256 value) external returns (bool);function approve(address _spender, uint256 _value) external returns (bool);function allowance(address _owner, address _spender) external view returns (uint256);function balanceOf(address _owner) external view returns (uint256);function totalSupply() external view returns (uint256);// Never usefunction setup(address token_addr) external;}
contract UniswapExchangeInterface():# Public Variablesdef tokenAddress() -> address: constantdef factoryAddress() -> address: constant# Providing Liquiditydef addLiquidity(min_liquidity: uint256, max_tokens: uint256, deadline: timestamp) -> uint256: modifyingdef removeLiquidity(amount: uint256, min_eth: uint256(wei), min_tokens: uint256, deadline: timestamp) -> (uint256(wei), uint256): modifying# Tradingdef ethToTokenSwapInput(min_tokens: uint256, deadline: timestamp) -> uint256: modifyingdef ethToTokenTransferInput(min_tokens: uint256, deadline: timestamp, recipient: address) -> uint256: modifyingdef ethToTokenSwapOutput(tokens_bought: uint256, deadline: timestamp) -> uint256(wei): modifyingdef ethToTokenTransferOutput(tokens_bought: uint256, deadline: timestamp, recipient: address) -> uint256(wei): modifyingdef tokenToEthSwapInput(tokens_sold: uint256, min_eth: uint256(wei), deadline: timestamp) -> uint256(wei): modifyingdef tokenToEthTransferInput(tokens_sold: uint256, min_eth: uint256(wei), deadline: timestamp, recipient: address) -> uint256(wei): modifyingdef tokenToEthSwapOutput(eth_bought: uint256(wei), max_tokens: uint256, deadline: timestamp) -> uint256: modifyingdef tokenToEthTransferOutput(eth_bought: uint256(wei), max_tokens: uint256, deadline: timestamp, recipient: address) -> uint256: modifyingdef tokenToTokenSwapInput(tokens_sold: uint256, min_tokens_bought: uint256, min_eth_bought: uint256(wei), deadline: timestamp, token_addr: address) -> uint256: modifyingdef tokenToTokenTransferInput(tokens_sold: uint256, min_tokens_bought: uint256, min_eth_bought: uint256(wei), deadline: timestamp, recipient: address, token_addr: address) -> uint256: modifyingdef tokenToTokenSwapOutput(tokens_bought: uint256, max_tokens_sold: uint256, max_eth_sold: uint256(wei), deadline: timestamp, token_addr: address) -> uint256: modifyingdef tokenToTokenTransferOutput(tokens_bought: uint256, max_tokens_sold: uint256, max_eth_sold: uint256(wei), deadline: timestamp, recipient: address, token_addr: address) -> uint256: modifyingdef tokenToExchangeSwapInput(tokens_sold: uint256, min_tokens_bought: uint256, min_eth_bought: uint256(wei), deadline: timestamp, exchange_addr: address) -> uint256: modifyingdef tokenToExchangeTransferInput(tokens_sold: uint256, min_tokens_bought: uint256, min_eth_bought: uint256(wei), deadline: timestamp, recipient: address, exchange_addr: address) -> uint256: modifyingdef tokenToExchangeSwapOutput(tokens_bought: uint256, max_tokens_sold: uint256, max_eth_sold: uint256(wei), deadline: timestamp, exchange_addr: address) -> uint256: modifyingdef tokenToExchangeTransferOutput(tokens_bought: uint256, max_tokens_sold: uint256, max_eth_sold: uint256(wei), deadline: timestamp, recipient: address, exchange_addr: address) -> uint256: modifying# Get Pricedef getEthToTokenInputPrice(eth_sold: uint256(wei)) -> uint256: constantdef getEthToTokenOutputPrice(tokens_bought: uint256) -> uint256(wei): constantdef getTokenToEthInputPrice(tokens_sold: uint256) -> uint256(wei): constantdef getTokenToEthOutputPrice(eth_bought: uint256(wei)) -> uint256: constant# Pool Token ERC20 Compatibilitydef balanceOf() -> address: constantdef allowance(_owner : address, _spender : address) -> uint256: constantdef transfer(_to : address, _value : uint256) -> bool: modifyingdef transferFrom(_from : address, _to : address, _value : uint256) -> bool: modifyingdef approve(_spender : address, _value : uint256) -> bool: modifying# Setupdef setup(token_addr: address): modifying
interface ERC20Interface {function totalSupply() public view returns (uint);function balanceOf(address tokenOwner) public view returns (uint balance);function allowance(address tokenOwner, address spender) public view returns (uint remaining);function transfer(address to, uint tokens) public returns (bool success);function approve(address spender, uint tokens) public returns (bool success);function transferFrom(address from, address to, uint tokens) public returns (bool success);// optionalfunction name() external view returns (string);function symbol() external view returns (string);function decimals() external view returns (string);event Transfer(address indexed from, address indexed to, uint tokens);event Approval(address indexed tokenOwner, address indexed spender, uint tokens);}
contract ERC20Interface():def totalSupply() -> uint256: constantdef balanceOf(_owner: address) -> uint256: constantdef allowance(_owner : address, _spender : address) -> uint256: constantdef transfer(_to : address, _value : uint256) -> bool: modifyingdef approve(_spender : address, _value : uint256) -> bool: modifyingdef transferFrom(_from : address, _to : address, _value : uint256) -> bool: modifying# optionaldef name() -> bytes32: constantdef symbol() -> bytes32: constantdef decimals() -> uint256: constant