Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenadams committed Sep 12, 2019
1 parent 3a44db7 commit 6272d96
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 9 deletions.
Empty file added contracts/UniswapERC20.sol
Empty file.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.5.11;
import "./UniswapExchange.sol";
import "./interfaces/IUniswapExchange.sol";
import "./UniswapERC20.sol";
import "./interfaces/IUniswapERC20.sol";


contract UniswapFactory {
contract UniswapERC20Factory {

event NewExchange(address indexed token, address indexed exchange);

Expand Down
4 changes: 2 additions & 2 deletions contracts/UniswapETH.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pragma solidity ^0.5.11;
import './ERC20.sol';
import './interfaces/IERC20.sol';
import './interfaces/IUniswapFactory.sol';
import './interfaces/IUniswapExchange.sol';
import './interfaces/IUniswapETHFactory.sol';
import './interfaces/IUniswapETH.sol';


contract UniswapETH is ERC20 {
Expand Down
27 changes: 27 additions & 0 deletions contracts/UniswapETHFactory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
pragma solidity ^0.5.11;
import "./UniswapETH.sol";
import "./interfaces/IUniswapETH.sol";


contract UniswapETHFactory {

event NewExchange(address indexed token, address indexed exchange);

uint256 public tokenCount;
mapping (address => address) public getExchange;
mapping (address => address) public getToken;
mapping (uint256 => address) public getTokenWithId;

function createExchange(address token) public returns (address) {
require(token != address(0));
require(getExchange[token] == address(0), 'EXCHANGE_EXISTS');
UniswapExchange exchange = new UniswapExchange(token);
getExchange[token] = address(exchange);
getToken[address(exchange)] = token;
uint256 tokenId = tokenCount + 1;
tokenCount = tokenId;
getTokenWithId[tokenId] = token;
emit NewExchange(token, address(exchange));
return address(exchange);
}
}
4 changes: 0 additions & 4 deletions contracts/interfaces/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
pragma solidity ^0.5.11;

/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
Expand Down
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.

0 comments on commit 6272d96

Please sign in to comment.