2018-10-29 12:06:21 +00:00
|
|
|
// pragma solidity ^0.4.24;
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// interface AddressRegistry {
|
|
|
|
// function getAddr(string name) external view returns(address);
|
|
|
|
// }
|
2018-10-26 20:55:26 +00:00
|
|
|
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// contract Registry {
|
2018-10-26 20:55:26 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// address public registryAddress;
|
|
|
|
// modifier onlyAdmin() {
|
|
|
|
// require(
|
|
|
|
// msg.sender == getAddress("admin"),
|
|
|
|
// "Permission Denied"
|
|
|
|
// );
|
|
|
|
// _;
|
|
|
|
// }
|
2018-10-26 20:55:26 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// function getAddress(string name) internal view returns(address addr) {
|
|
|
|
// AddressRegistry addrReg = AddressRegistry(registryAddress);
|
|
|
|
// addr = addrReg.getAddr(name);
|
|
|
|
// require(addr != address(0), "Invalid Address");
|
|
|
|
// }
|
2018-10-28 05:28:10 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// }
|
2018-10-26 16:16:23 +00:00
|
|
|
|
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// contract FeeDetail is Registry {
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// uint public fees;
|
|
|
|
// function setFees(uint cut) public onlyAdmin { // 200 means 0.5%
|
|
|
|
// fees = cut;
|
|
|
|
// }
|
2018-10-28 16:59:07 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// }
|
2018-10-26 16:16:23 +00:00
|
|
|
|
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// contract MoatResolver is FeeDetail {
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// function () public payable {}
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// constructor(address rAddr, uint cut) public { // 200 means 0.5%
|
|
|
|
// registryAddress = rAddr;
|
|
|
|
// setFees(cut);
|
|
|
|
// }
|
2018-10-26 16:16:23 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// function collectAsset(address tokenAddress, uint amount) public onlyAdmin {
|
|
|
|
// if (tokenAddress == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
|
|
|
|
// msg.sender.transfer(amount);
|
|
|
|
// } else {
|
|
|
|
// IERC20 tokenFunctions = IERC20(tokenAddress);
|
|
|
|
// tokenFunctions.transfer(msg.sender, amount);
|
|
|
|
// }
|
|
|
|
// }
|
2018-10-26 20:55:26 +00:00
|
|
|
|
2018-10-29 12:06:21 +00:00
|
|
|
// }
|