dsa-connectors-old/contracts/mapping/instapoolFee.sol

42 lines
1.2 KiB
Solidity
Raw Permalink Normal View History

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface IndexInterface {
function master() external view returns (address);
}
contract Helpers {
2020-07-17 16:43:43 +00:00
event LogChangeFee(uint256 _fee);
event LogChangeFeeCollector(address _feeCollector);
address public constant instaIndex = 0x2971AdFa57b20E5a416aE5a708A8655A9c74f723;
uint256 public fee;
address public feeCollector;
modifier isChief {
require(IndexInterface(instaIndex).master() == msg.sender, "not-Master");
_;
}
2020-07-17 14:26:06 +00:00
function changeFee(uint256 _fee) external isChief {
2020-07-17 19:26:22 +00:00
require(_fee <= 2 * 10 ** 15, "Fee is more than 0.2%");
fee = uint64(_fee);
2020-07-17 16:43:43 +00:00
emit LogChangeFee(_fee);
}
2020-07-17 14:26:06 +00:00
function changeFeeCollector(address _feeCollector) external isChief {
require(feeCollector != _feeCollector, "Same-feeCollector");
require(_feeCollector != address(0), "feeCollector-is-address(0)");
feeCollector = _feeCollector;
2020-07-17 16:43:43 +00:00
emit LogChangeFeeCollector(_feeCollector);
2020-07-17 14:26:06 +00:00
}
}
contract InstaPoolFee is Helpers {
constructor () public {
2020-07-17 14:35:47 +00:00
fee = 9 * 10 ** 14; // 0.09%
2020-07-17 14:26:06 +00:00
feeCollector = IndexInterface(instaIndex).master();
}
}