-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f57b766
commit 281faf2
Showing
2 changed files
with
90 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
pragma solidity 0.5.10; | ||
|
||
contract MockUniswapFactory { | ||
|
||
constructor () public { | ||
} | ||
|
||
address public exchangeTemplate; | ||
uint256 public tokenCount; | ||
mapping(uint256 => address) public idToToken; | ||
mapping(address => address) public exchanges; | ||
mapping(address => address) public tokens; | ||
address public _exchange; | ||
|
||
// Create Exchange | ||
function createExchange(address token) external pure returns (address exchange) { | ||
return token; // return random address. | ||
} | ||
// Get Exchange and Token Info | ||
function getExchange(address token) external view returns (address exchange){ | ||
return exchanges[token]; | ||
} | ||
function getToken(address exchange) external view returns (address token) { | ||
return tokens[exchange]; | ||
} | ||
function getTokenWithId(uint256 tokenId) external view returns (address token) { | ||
return idToToken[tokenId]; | ||
} | ||
function setTokenExchange(address token, address exchange) public { | ||
exchanges[token] = exchange; | ||
tokens[exchange] = token; | ||
} | ||
// Never use | ||
function initializeFactory(address template) external { | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters