Files
dodo-contractV2/contracts/lib/ConstFeeRateModel.sol

37 lines
853 B
Solidity
Raw Normal View History

2020-11-05 00:26:45 +08:00
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
2020-11-22 18:20:09 +08:00
interface IConstFeeRateModel {
2020-11-05 00:26:45 +08:00
function init(address owner, uint256 feeRate) external;
2020-11-24 00:20:23 +08:00
2020-11-05 00:26:45 +08:00
function setFeeRate(uint256 newFeeRate) external;
2020-11-24 00:20:23 +08:00
function getFeeRate(address trader) external view returns (uint256);
2020-11-05 00:26:45 +08:00
}
2020-11-22 18:20:09 +08:00
contract ConstFeeRateModel is InitializableOwnable {
2020-11-05 00:26:45 +08:00
uint256 public _FEE_RATE_;
function init(address owner, uint256 feeRate) external {
initOwner(owner);
_FEE_RATE_ = feeRate;
}
2020-11-22 18:20:09 +08:00
function setFeeRate(uint256 newFeeRate) external onlyOwner {
2020-11-05 00:26:45 +08:00
_FEE_RATE_ = newFeeRate;
}
2020-11-24 00:20:23 +08:00
function getFeeRate(address trader) external view returns (uint256) {
2020-11-05 00:26:45 +08:00
return _FEE_RATE_;
}
}