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

34 lines
832 B
Solidity
Raw Normal View History

2020-11-22 18:20:09 +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";
2021-01-21 21:48:40 +08:00
interface IFeeRateImpl {
function getFeeRate(address pool, address trader) external view returns (uint256);
}
2020-11-22 18:20:09 +08:00
interface IFeeRateModel {
function getFeeRate(address trader) external view returns (uint256);
}
2021-01-21 21:48:40 +08:00
contract FeeRateModel is InitializableOwnable {
address public feeRateImpl;
2020-11-22 18:20:09 +08:00
2021-01-21 21:48:40 +08:00
function setFeeProxy(address _feeRateImpl) public onlyOwner {
feeRateImpl = _feeRateImpl;
2020-11-22 18:20:09 +08:00
}
2021-01-21 21:48:40 +08:00
2020-11-22 18:20:09 +08:00
function getFeeRate(address trader) external view returns (uint256) {
2021-01-21 21:48:40 +08:00
if(feeRateImpl == address(0))
return 0;
return IFeeRateImpl(feeRateImpl).getFeeRate(msg.sender,trader);
2020-11-22 18:20:09 +08:00
}
}