forked from dropdisco/dexs-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDexSwapFeeSetter.sol
45 lines (36 loc) · 1.48 KB
/
DexSwapFeeSetter.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.5.16;
import './interfaces/IDexSwapFactory.sol';
contract DexSwapFeeSetter {
address public owner;
mapping(address => address) public pairOwners;
IDexSwapFactory public factory;
constructor(address _owner, address _factory) public {
owner = _owner;
factory = IDexSwapFactory(_factory);
}
function transferOwnership(address newOwner) external {
require(msg.sender == owner, 'DexSwapFeeSetter: FORBIDDEN');
owner = newOwner;
}
function transferPairOwnership(address pair, address newOwner) external {
require(msg.sender == owner, 'DexSwapFeeSetter: FORBIDDEN');
pairOwners[pair] = newOwner;
}
function setFeeTo(address feeTo) external {
require(msg.sender == owner, 'DexSwapFeeSetter: FORBIDDEN');
factory.setFeeTo(feeTo);
}
function setFeeToSetter(address feeToSetter) external {
require(msg.sender == owner, 'DexSwapFeeSetter: FORBIDDEN');
factory.setFeeToSetter(feeToSetter);
}
function setProtocolFee(uint8 protocolFeeDenominator) external {
require(msg.sender == owner, 'DexSwapFeeSetter: FORBIDDEN');
factory.setProtocolFee(protocolFeeDenominator);
}
function setSwapFee(address pair, uint32 swapFee) external {
require((msg.sender == owner) || ((msg.sender == pairOwners[pair])), 'DexSwapFeeSetter: FORBIDDEN');
factory.setSwapFee(pair, swapFee);
}
}