Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
pragma solidity >=0.8.0 <0.9.0;
//Copyright of DataX Protocol contributors
//SPDX-License-Identifier: BSU-1.1
import "./Admin.sol";
contract FeeAdmin is Admin {
mapping(bytes32 => uint256) public fees;
function getFees(string memory key) public view returns (uint256) {
bytes32 _key = _stringToBytes32(key);
return fees[_key];
}
function updateFees(string memory key, uint256 value) external adminOnly {
bytes32 _key = _stringToBytes32(key);
fees[_key] = value;
}
function _stringToBytes32(string memory source)
private
pure
returns (bytes32 result)
{
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
}