Xaureum (XETH)

Description:

Decentralized Finance (DeFi) protocol contract providing Liquidity functionality.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: MIT
/*
   _  __ ___   __  ______  ________  ____  ___
  | |/ //   | / / / / __ \/ ____/ / / /  |/  /
  |   // /| |/ / / / /_/ / __/ / / / / /|_/ / 
 /   |/ ___ / /_/ / _, _/ /___/ /_/ / /  / /  
/_/|_/_/  |_\____/_/ |_/_____/\____/_/  /_/   
                                              
*/

pragma solidity ^0.8.19;

// --------------------------------------------
// Interfaces
// --------------------------------------------
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);
}

interface IERC20 {
    function approve(address spender, uint256 amount) external returns (bool);
}

// --------------------------------------------
// Ownable
// --------------------------------------------
contract Ownable {
    address internal _owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor () {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    modifier onlyOwner() {
        require(msg.sender == _owner, "Not owner");
        _;
    }

    function owner() public view returns (address) {
        return _owner;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "Zero address");
        _owner = newOwner;
        emit OwnershipTransferred(msg.sender, newOwner);
    }
}

// --------------------------------------------
// Mock Structs (for Fee Config)
// --------------------------------------------
struct Allot { uint256 liquidity; uint256 marketing; uint256 burn; uint256 dividend; uint256 total; }
struct Fee { uint256 buy; uint256 sell; uint256 transfer; uint256 denominator; }

// --------------------------------------------
// Helpers
// --------------------------------------------
contract TokenDistributor {
    constructor(address rewardToken) {}
}

contract DividendDistributor {
    constructor(address rewardToken, uint256 minPeriod, uint256 minDistribution, uint256 minHold) {}
}

// --------------------------------------------
// XETH Contract
// --------------------------------------------
contract XETH is Ownable {
    // Core token data
    string private constant _name = "Xaureum";
    string private constant _symbol = "XETH";
    uint8 private constant _decimals = 18;
    uint256 private constant _totalSupply = 1_000_000 * 10**_decimals;

    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;

    // Router, Tokens, and Pair
    address public rewardToken; // PAXG (Gold)
    address public baseToken;   // WETH
    address public pair;
    IDEXRouter public router;

    TokenDistributor public _tokenDistributor;
    DividendDistributor public distributor;

    Allot public allot;
    Fee public fees;
    address public marketingFeeReceiver;

    // Events
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    // --------------------------------------------
    // Constructor
    // --------------------------------------------
    constructor () Ownable() {
        router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // UniswapV2 Router

        rewardToken = address(0x68749665FF8D2d112Fa859AA293F07A622782F38); // PAXG (Gold)
        baseToken   = router.WETH(); // Use WETH for pair

        // Create pair (XETH/WETH)
        pair = IDEXFactory(router.factory()).createPair(baseToken, address(this));

        // Max approvals
        _allowances[address(this)][address(router)] = type(uint256).max;
        IERC20(rewardToken).approve(address(router), type(uint256).max);

        // Setup helper contracts
        _tokenDistributor = new TokenDistributor(rewardToken);
        distributor = new DividendDistributor(
            rewardToken,
            5 minutes,
            1 * 10 ** 18,
            _totalSupply / 10000
        );

        // Fee exemptions
        isFeeExempt[msg.sender] = true;
        isFeeExempt[address(router)] = true;
        isFeeExempt[address(this)] = true;
        isTxLimitExempt[msg.sender] = true;
        isWalletLimitExempt[msg.sender] = true;
        isWalletLimitExempt[address(0xdead)] = true;
        isWalletLimitExempt[address(this)] = true;
        isWalletLimitExempt[pair] = true;
        isDividendExempt[pair] = true;
        isDividendExempt[address(this)] = true;
        isDividendExempt[address(0xdead)] = true;

        // Default fees
        allot = Allot(2, 2, 0, 6, 10);
        fees = Fee(10, 10, 0, 100);
        marketingFeeReceiver = msg.sender;

        // Mint total supply to owner
        _balances[msg.sender] = _totalSupply;
        emit Transfer(address(0), msg.sender, _totalSupply);
    }

    // --------------------------------------------
    // ERC20 Standard Functions
    // --------------------------------------------
    function name() public pure returns (string memory) { return _name; }
    function symbol() public pure returns (string memory) { return _symbol; }
    function decimals() public pure returns (uint8) { return _decimals; }
    function totalSupply() public pure returns (uint256) { return _totalSupply; }
    function balanceOf(address account) public view returns (uint256) { return _balances[account]; }

    function transfer(address recipient, uint256 amount) public returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    function approve(address spender, uint256 amount) public returns (bool) {
        _allowances[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }

    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        uint256 currentAllowance = _allowances[sender][msg.sender];
        require(currentAllowance >= amount, "ERC20: insufficient allowance");
        _allowances[sender][msg.sender] = currentAllowance - amount;
        _transfer(sender, recipient, amount);
        return true;
    }

    // Internal transfer logic
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(sender != address(0) && recipient != address(0), "ERC20: zero address");
        require(_balances[sender] >= amount, "ERC20: insufficient balance");

        _balances[sender] -= amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }
}

Tags:
ERC20, DeFi, Liquidity|addr:0x20eeab66a5d20f0e2807ef6960ac82e9308f53fd|verified:true|block:23607735|tx:0x285e2f31ecbc2f086354a403fa3964273e8f6af452b4f63f4433fbed91db5c7b|first_check:1760863876

Submitted on: 2025-10-19 10:51:18

Comments

Log in to comment.

No comments yet.