Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"GLDR.sol": {
"content": "/**
GOLDRUSH - Your Digital Gold Mine
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣤⣤⣤⣤⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀
⠀⠀⠿⠿⠿⠿⠟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠉⠉⢉⡉⠉⠉⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣶⡆⠀⠀⣴⠟⠀⠀⢀⡼⣇⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⡇⢠⡾⠋⠀⠀⠘⡿⠶⣾⡆⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⠁⠘⠁⠀⠀⠀⠀⠛⠒⠋⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡇⠀⠀⠀⠀⠀⠀
⠀⠀⢠⣿⣿⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⢀⣤⣀⡀⠘⢉⣁⣀⣤⠀⠀⠀⠀
⠀⠀⢸⣿⣿⠀⠀⠀⠀⣾⡟⠓⠒⠂⢀⣀⣀⣉⣉⣉⣉⣉⣉⣉⣉⣉⣁⣀⠀⠀
⠀⠀⢸⣿⡇⠀⠀⠸⢿⡿⠿⠿⠿⠧⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀
⠀⠀⠉⠙⠃⠀⠰⢶⡿⠷⠶⠶⠶⠶⠆⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀
⠀⠀⠀⠀⠀⣀⣠⣿⣁⣀⣀⣀⣀⣀⣀⡀⠹⠿⠿⢿⣿⣿⣿⡿⠿⠿⡇⠀⠀⠀
⠀⠀⠀⠀⠀⠠⠿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣶⠀⠀⠀⠀⠀⢶⡦⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Earn Gold, Just For Holding
**/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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;
}
interface IDividendDistributor {
function setDistributionCriteria(uint256 _minPeriod, uint256 _minDistribution, uint256 _minHoldForDividends) external;
function setShare(address shareholder, uint256 amount) external;
function deposit(uint256 amount) external;
function process(uint256 gas) external;
function claimDividend() external;
function getUnpaidEarnings(address shareholder) external view returns (uint256);
}
contract DividendDistributor is IDividendDistributor {
using SafeMath for uint256;
struct Share {
uint256 amount;
uint256 totalExcluded;
uint256 totalRealised;
}
IERC20 public immutable rewardToken;
address public immutable token;
address[] public shareholders;
mapping (address => uint256) public shareholderIndexes;
mapping (address => uint256) public shareholderClaims;
mapping (address => Share) public shares;
uint256 public totalShares;
uint256 public totalDividends;
uint256 public totalDistributed;
uint256 public dividendsPerShare;
uint256 public constant dividendsPerShareAccuracyFactor = 10 ** 36;
uint256 public minPeriod;
uint256 public minDistribution;
uint256 public minTokenBalanceForDividends;
uint256 currentIndex;
modifier onlyToken() {
require(msg.sender == token, "Caller is not the token contract");
_;
}
constructor(address _rewardToken, uint256 _minPeriod, uint256 _minDistribution, uint256 _minHoldForDividends) {
token = msg.sender;
rewardToken = IERC20(_rewardToken);
minPeriod = _minPeriod;
minDistribution = _minDistribution;
minTokenBalanceForDividends = _minHoldForDividends;
}
function setDistributionCriteria(
uint256 _minPeriod,
uint256 _minDistribution,
uint256 _minHoldForDividends
) external override onlyToken {
minPeriod = _minPeriod;
minDistribution = _minDistribution;
minTokenBalanceForDividends = _minHoldForDividends;
}
function setShare(address shareholder, uint256 amount) external override onlyToken {
if (shares[shareholder].amount > 0) {
distributeDividend(shareholder);
}
if (amount >= minTokenBalanceForDividends && shares[shareholder].amount == 0) {
addShareholder(shareholder);
} else if (amount < minTokenBalanceForDividends && shares[shareholder].amount > 0) {
removeShareholder(shareholder);
}
totalShares = totalShares.sub(shares[shareholder].amount).add(amount);
shares[shareholder].amount = amount;
shares[shareholder].totalExcluded = getCumulativeDividends(amount);
}
function deposit(uint256 amount) external override onlyToken {
require(rewardToken.balanceOf(msg.sender) >= amount, "Insufficient reward tokens");
totalDividends = totalDividends.add(amount);
dividendsPerShare = dividendsPerShare.add(
dividendsPerShareAccuracyFactor.mul(amount).div(totalShares)
);
}
function process(uint256 gas) external override onlyToken {
uint256 shareholderCount = shareholders.length;
if (shareholderCount == 0) return;
uint256 gasUsed = 0;
uint256 gasLeft = gasleft();
uint256 iterations = 0;
while (gasUsed < gas && iterations < shareholderCount) {
if (currentIndex >= shareholderCount) {
currentIndex = 0;
}
if (shouldDistribute(shareholders[currentIndex])) {
distributeDividend(shareholders[currentIndex]);
}
gasUsed = gasUsed.add(gasLeft.sub(gasleft()));
gasLeft = gasleft();
currentIndex++;
iterations++;
}
}
function shouldDistribute(address shareholder) internal view returns (bool) {
return shareholderClaims[shareholder] + minPeriod < block.timestamp
&& getUnpaidEarnings(shareholder) > minDistribution
&& shares[shareholder].amount >= minTokenBalanceForDividends;
}
function distributeDividend(address shareholder) internal {
if (shares[shareholder].amount == 0) return;
uint256 amount = getUnpaidEarnings(shareholder);
if (amount > 0 && rewardToken.balanceOf(address(this)) >= amount) {
totalDistributed = totalDistributed.add(amount);
rewardToken.transfer(shareholder, amount);
shareholderClaims[shareholder] = block.timestamp;
shares[shareholder].totalRealised = shares[shareholder].totalRealised.add(amount);
shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount);
}
}
function claimDividend() external override {
require(shouldDistribute(msg.sender), "Too soon or insufficient earnings");
distributeDividend(msg.sender);
}
function getUnpaidEarnings(address shareholder) public view override returns (uint256) {
if (shares[shareholder].amount == 0) return 0;
uint256 shareholderTotalDividends = getCumulativeDividends(shares[shareholder].amount);
uint256 shareholderTotalExcluded = shares[shareholder].totalExcluded;
if (shareholderTotalDividends <= shareholderTotalExcluded) return 0;
return shareholderTotalDividends.sub(shareholderTotalExcluded);
}
function getCumulativeDividends(uint256 share) internal view returns (uint256) {
return share.mul(dividendsPerShare).div(dividendsPerShareAccuracyFactor);
}
function addShareholder(address shareholder) internal {
shareholderIndexes[shareholder] = shareholders.length;
shareholders.push(shareholder);
}
function removeShareholder(address shareholder) internal {
shareholders[shareholderIndexes[shareholder]] = shareholders[shareholders.length - 1];
shareholderIndexes[shareholders[shareholders.length - 1]] = shareholderIndexes[shareholder];
shareholders.pop();
}
}
contract GLDR is IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GoldRush";
string private constant _symbol = "GLDR";
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 100 * 10 ** 9 * 10 ** _decimals;
// Fixed reward token address
address public constant REWARD_TOKEN = 0x68749665FF8D2d112Fa859AA293F07A622782F38;
// Fees and allocations
struct FeeSettings {
uint256 buy;
uint256 sell;
uint256 transfer;
uint256 denominator;
}
struct Allocation {
uint256 marketing;
uint256 liquidity;
uint256 burn;
uint256 rewards;
uint256 total;
}
FeeSettings public fees;
Allocation public allocation;
// Limits
uint256 public maxTransactionAmount;
uint256 public maxWalletBalance;
// Addresses
address public marketingWallet;
address public baseToken;
address public pair;
// Mappings
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public isFeeExempt;
mapping (address => bool) public isTxLimitExempt;
mapping (address => bool) public isWalletLimitExempt;
mapping (address => bool) public isDividendExempt;
mapping (address => bool) public isBlacklisted;
// Contract instances
IDEXRouter public router;
DividendDistributor public distributor;
// Swap settings
bool public swapEnabled = true;
uint256 public swapThreshold;
uint256 public maxSwapAmount;
bool private inSwap;
// Trading state
uint256 public launchedAt;
// Events
event AutoLiquidity(uint256 tokens, uint256 baseToken);
event DistributionCriteriaUpdated(uint256 minPeriod, uint256 minDistribution, uint256 minHold);
event FeesUpdated(uint256 buy, uint256 sell, uint256 transfer);
event AllocationUpdated(uint256 marketing, uint256 liquidity, uint256 burn, uint256 rewards);
modifier swapping() {
inSwap = true;
_;
inSwap = false;
}
constructor(address _router) Ownable(msg.sender) {
router = IDEXRouter(_router);
baseToken = router.WETH(); // Use WETH as base token for trading
// Create pair with WETH
pair = IDEXFactory(router.factory()).createPair(baseToken, address(this));
// Initialize distributor with fixed reward token
distributor = new DividendDistributor(
REWARD_TOKEN, // Fixed reward token address
5 minutes, // minPeriod
1 * 10 ** 18, // minDistribution
_totalSupply.div(10000) // minHoldForDividends
);
// Approve router
_allowances[address(this)][address(router)] = type(uint256).max;
IERC20(baseToken).approve(address(router), type(uint256).max);
IERC20(REWARD_TOKEN).approve(address(router), type(uint256).max);
// Initialize settings
_initializeSettings();
_initializeExemptions();
// Mint total supply to deployer
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function _initializeSettings() private {
// FIXED: denominator = 100 (was 10000)
fees = FeeSettings({
buy: 7, // 7% (7/100)
sell: 7, // 7% (7/100)
transfer: 0, // 0%
denominator: 100 // FIXED: Now 100 instead of 10000
});
// Allocation (20% marketing, 20% liquidity, 0% burn, 60% rewards)
allocation = Allocation({
marketing: 20, // 20% of fees = 1.4% total
liquidity: 20, // 20% of fees = 1.4% total
burn: 0, // 0% of fees = 0% total
rewards: 60, // 60% of fees = 4.2% total
total: 100
});
// Limits (2% of supply)
maxTransactionAmount = _totalSupply.mul(200).div(10000); // 2%
maxWalletBalance = _totalSupply.mul(200).div(10000); // 2%
// Swap settings (0.1% threshold, 1% max swap)
swapThreshold = _totalSupply.mul(10).div(10000); // 0.1%
maxSwapAmount = _totalSupply.mul(100).div(10000); // 1%
marketingWallet = msg.sender;
}
function _initializeExemptions() private {
isFeeExempt[msg.sender] = true;
isFeeExempt[address(this)] = true;
isFeeExempt[address(router)] = true;
isTxLimitExempt[msg.sender] = true;
isTxLimitExempt[address(this)] = true;
isTxLimitExempt[address(router)] = true;
isWalletLimitExempt[msg.sender] = true;
isWalletLimitExempt[address(this)] = true;
isWalletLimitExempt[pair] = true;
isWalletLimitExempt[address(0xdead)] = true;
isDividendExempt[address(this)] = true;
isDividendExempt[pair] = true;
isDividendExempt[address(0xdead)] = true;
isDividendExempt[address(router)] = true;
}
// IERC20 functions - REMOVED override keyword
function totalSupply() external pure returns (uint256) { return _totalSupply; }
function decimals() external pure returns (uint8) { return _decimals; }
function symbol() external pure returns (string memory) { return _symbol; }
function name() external pure returns (string memory) { return _name; }
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address holder, address spender) external view returns (uint256) {
return _allowances[holder][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address recipient, uint256 amount) external returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
if (_allowances[sender][msg.sender] != type(uint256).max) {
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(!isBlacklisted[sender] && !isBlacklisted[recipient], "Address is blacklisted");
require(amount > 0, "Transfer amount must be greater than zero");
if (inSwap) {
return _basicTransfer(sender, recipient, amount);
}
// Check if trading is enabled
if (sender != owner() && recipient != owner()) {
require(launchedAt > 0, "Trading not yet enabled");
}
// Check transaction limit
if (!isTxLimitExempt[sender] && !isTxLimitExempt[recipient]) {
require(amount <= maxTransactionAmount, "Transfer amount exceeds max transaction limit");
}
// Check wallet limit
if (!isWalletLimitExempt[recipient]) {
require(balanceOf(recipient).add(amount) <= maxWalletBalance, "Exceeds max wallet balance");
}
// Swap back if conditions are met
if (shouldSwapBack() && recipient == pair) {
swapBack();
}
// Calculate actual transfer amount
uint256 amountReceived = shouldTakeFee(sender, recipient) ?
takeFee(sender, recipient, amount) : amount;
// Execute transfer
_balances[sender] = _balances[sender].sub(amount, "Insufficient balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
// Update dividend tracking
_updateDividendTracking(sender, recipient);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function _updateDividendTracking(address sender, address recipient) internal {
if (!isDividendExempt[sender]) {
try distributor.setShare(sender, _balances[sender]) {} catch {}
}
if (!isDividendExempt[recipient]) {
try distributor.setShare(recipient, _balances[recipient]) {} catch {}
}
try distributor.process(500000) {} catch {}
}
function shouldTakeFee(address sender, address recipient) internal view returns (bool) {
return !isFeeExempt[sender] && !isFeeExempt[recipient];
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount;
if (recipient == pair) {
feeAmount = amount.mul(fees.sell).div(fees.denominator);
} else if (sender == pair) {
feeAmount = amount.mul(fees.buy).div(fees.denominator);
} else {
feeAmount = amount.mul(fees.transfer).div(fees.denominator);
}
if (feeAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 contractTokenBalance = _balances[address(this)];
if (contractTokenBalance > maxSwapAmount) {
contractTokenBalance = maxSwapAmount;
}
// Calculate allocations
uint256 tokensForBurn = contractTokenBalance.mul(allocation.burn).div(allocation.total);
uint256 tokensForLiquidity = contractTokenBalance.mul(allocation.liquidity).div(allocation.total).div(2);
uint256 tokensToSwap = contractTokenBalance.sub(tokensForBurn).sub(tokensForLiquidity);
// Burn tokens if allocated
if (tokensForBurn > 0) {
_basicTransfer(address(this), address(0xdead), tokensForBurn);
}
// Swap tokens for ETH first
uint256 initialETHBalance = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = baseToken; // WETH
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokensToSwap,
0,
path,
address(this),
block.timestamp
);
uint256 ethReceived = address(this).balance.sub(initialETHBalance);
// Calculate ETH allocations
uint256 totalAllocation = allocation.total.sub(allocation.liquidity.div(2)).sub(allocation.burn);
uint256 ethForRewards = ethReceived.mul(allocation.rewards).div(totalAllocation);
uint256 ethForMarketing = ethReceived.mul(allocation.marketing).div(totalAllocation);
uint256 ethForLiquidity = ethReceived.sub(ethForRewards).sub(ethForMarketing);
// Buy reward tokens with ETH for rewards
if (ethForRewards > 0) {
_buyRewardTokens(ethForRewards);
}
// Send marketing share as ETH
if (ethForMarketing > 0) {
payable(marketingWallet).transfer(ethForMarketing);
}
// Add liquidity
if (tokensForLiquidity > 0 && ethForLiquidity > 0) {
router.addLiquidityETH{value: ethForLiquidity}(
address(this),
tokensForLiquidity,
0,
0,
marketingWallet,
block.timestamp
);
emit AutoLiquidity(tokensForLiquidity, ethForLiquidity);
}
}
function _buyRewardTokens(uint256 ethAmount) internal {
address[] memory path = new address[](2);
path[0] = baseToken; // WETH
path[1] = REWARD_TOKEN;
// Convert ETH to WETH first, then swap to reward token
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(
0,
path,
address(distributor),
block.timestamp
);
// Get the amount of reward tokens received and deposit to distributor
uint256 rewardTokenBalance = IERC20(REWARD_TOKEN).balanceOf(address(distributor));
if (rewardTokenBalance > 0) {
distributor.deposit(rewardTokenBalance);
}
}
// Administrative functions
function launch() external onlyOwner {
require(launchedAt == 0, "Already launched");
launchedAt = block.number;
}
// FIXED: Updated setFees function with new limits
function setFees(uint256 _buy, uint256 _sell, uint256 _transfer) external onlyOwner {
require(_buy <= 100 && _sell <= 100 && _transfer <= 100, "Fees too high"); // Max 100%
fees.buy = _buy;
fees.sell = _sell;
fees.transfer = _transfer;
emit FeesUpdated(_buy, _sell, _transfer);
}
function setAllocation(uint256 _marketing, uint256 _liquidity, uint256 _burn, uint256 _rewards) external onlyOwner {
uint256 total = _marketing.add(_liquidity).add(_burn).add(_rewards);
require(total == 100, "Allocations must sum to 100%");
allocation.marketing = _marketing;
allocation.liquidity = _liquidity;
allocation.burn = _burn;
allocation.rewards = _rewards;
allocation.total = total;
emit AllocationUpdated(_marketing, _liquidity, _burn, _rewards);
}
function setLimits(uint256 _maxTx, uint256 _maxWallet) external onlyOwner {
require(_maxTx >= _totalSupply.div(1000), "Max transaction too low"); // Min 0.1%
require(_maxWallet >= _totalSupply.div(1000), "Max wallet too low"); // Min 0.1%
maxTransactionAmount = _maxTx;
maxWalletBalance = _maxWallet;
}
function setSwapSettings(bool _enabled, uint256 _threshold, uint256 _maxSwap) external onlyOwner {
swapEnabled = _enabled;
swapThreshold = _threshold;
maxSwapAmount = _maxSwap;
}
function setDistributionCriteria(uint256 _minPeriod, uint256 _minDistribution, uint256 _minHold) external onlyOwner {
distributor.setDistributionCriteria(_minPeriod, _minDistribution, _minHold);
emit DistributionCriteriaUpdated(_minPeriod, _minDistribution, _minHold);
}
function setFeeExempt(address _address, bool _exempt) external onlyOwner {
isFeeExempt[_address] = _exempt;
}
function setTxLimitExempt(address _address, bool _exempt) external onlyOwner {
isTxLimitExempt[_address] = _exempt;
}
function setWalletLimitExempt(address _address, bool _exempt) external onlyOwner {
isWalletLimitExempt[_address] = _exempt;
}
function setDividendExempt(address _address, bool _exempt) external onlyOwner {
require(_address != address(this) && _address != pair, "Cannot exempt this address");
isDividendExempt[_address] = _exempt;
if (_exempt) {
distributor.setShare(_address, 0);
} else {
distributor.setShare(_address, _balances[_address]);
}
}
function setBlacklist(address _address, bool _blacklisted) external onlyOwner {
isBlacklisted[_address] = _blacklisted;
}
function setMarketingWallet(address _marketingWallet) external onlyOwner {
require(_marketingWallet != address(0), "Marketing wallet cannot be zero address");
marketingWallet = _marketingWallet;
}
// Emergency functions
function rescueTokens(address _token, uint256 _amount) external onlyOwner {
require(_token != address(this), "Cannot rescue native token");
IERC20(_token).transfer(owner(), _amount);
}
function rescueETH(uint256 _amount) external onlyOwner {
payable(owner()).transfer(_amount);
}
// View functions
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply.sub(balanceOf(address(0xdead)));
}
function getClaimableDividends(address shareholder) external view returns (uint256) {
return distributor.getUnpaidEarnings(shareholder);
}
function claimDividends() external {
distributor.claimDividend();
}
function getRewardToken() external pure returns (address) {
return REWARD_TOKEN;
}
// Helper function to get current tax rates
function getTaxRates() external view returns (uint256 buyTax, uint256 sellTax, uint256 transferTax) {
buyTax = fees.buy;
sellTax = fees.sell;
transferTax = fees.transfer;
}
receive() external payable {}
}"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
"
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-19 11:33:27
Comments
Log in to comment.
No comments yet.