-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27a351a
commit d43e490
Showing
6 changed files
with
99 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
|
||
import {PRECISION} from "@solarity/solidity-lib/utils/Globals.sol"; | ||
|
||
contract FeeParams is UUPSUpgradeable, OwnableUpgradeable { | ||
address public treasuryAddress; | ||
|
||
uint256 public baseFee; | ||
|
||
mapping(address => uint256) public fees; | ||
|
||
function __FeeParams_init(address treasuryAddress_, uint256 baseFee_) external initializer { | ||
__Ownable_init(); | ||
__UUPSUpgradeable_init(); | ||
|
||
treasuryAddress = treasuryAddress_; | ||
baseFee = baseFee_; | ||
} | ||
|
||
function setFee(address token_, uint256 fee_) external onlyOwner { | ||
require(fee_ < PRECISION, "FeeParams: invalid fee"); | ||
|
||
fees[token_] = fee_; | ||
} | ||
|
||
function setTreasury(address treasuryAddress_) external onlyOwner { | ||
treasuryAddress = treasuryAddress_; | ||
} | ||
|
||
function setBaseFee(uint256 baseFee_) external onlyOwner { | ||
require(baseFee_ < PRECISION, "FeeParams: invalid fee"); | ||
|
||
baseFee = baseFee_; | ||
} | ||
|
||
function getFeeAndTreasury(address distributionAddress_) external view returns (uint256, address) { | ||
uint256 fee_ = fees[distributionAddress_]; | ||
if (fee_ == 0) { | ||
fee_ = baseFee; | ||
} | ||
|
||
return (fee_, treasuryAddress); | ||
} | ||
|
||
function _authorizeUpgrade(address) internal override onlyOwner {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters