// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/**
 * @title Mock LINK Token
 * @notice Simple ERC20 token for testing and development
 * @dev Minimal ERC20 implementation for CCIP fee payments
 */
contract MockLinkToken {
    string public name = "Chainlink Token";
    string public symbol = "LINK";
    uint8 public decimals = 18;
    
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;
    
    uint256 public totalSupply;
    
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    
    /**
     * @notice Mint tokens to an address
     * @param to Address to mint tokens to
     * @param amount Amount of tokens to mint
     */
    function mint(address to, uint256 amount) external {
        balanceOf[to] += amount;
        totalSupply += amount;
        emit Transfer(address(0), to, amount);
    }
    
    /**
     * @notice Transfer tokens
     * @param to Address to transfer to
     * @param amount Amount of tokens to transfer
     * @return success True if transfer was successful
     */
    function transfer(address to, uint256 amount) external returns (bool success) {
        require(balanceOf[msg.sender] >= amount, "MockLinkToken: insufficient balance");
        balanceOf[msg.sender] -= amount;
        balanceOf[to] += amount;
        emit Transfer(msg.sender, to, amount);
        return true;
    }
    
    /**
     * @notice Transfer tokens from one address to another
     * @param from Address to transfer from
     * @param to Address to transfer to
     * @param amount Amount of tokens to transfer
     * @return success True if transfer was successful
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool success) {
        require(balanceOf[from] >= amount, "MockLinkToken: insufficient balance");
        require(allowance[from][msg.sender] >= amount, "MockLinkToken: insufficient allowance");
        balanceOf[from] -= amount;
        balanceOf[to] += amount;
        allowance[from][msg.sender] -= amount;
        emit Transfer(from, to, amount);
        return true;
    }
    
    /**
     * @notice Approve spender to spend tokens
     * @param spender Address to approve
     * @param amount Amount of tokens to approve
     * @return success True if approval was successful
     */
    function approve(address spender, uint256 amount) external returns (bool success) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }
}

