// File: contracts/interfaces/ISaltsToken.sol



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

//TODO: Remove this interface and use reward wallet.

interface ISaltsToken {

    function transfer( address _to, uint256 _value ) external returns (bool success);

    function balanceOf(address account) external view returns (uint256);

    function registerUser(address _user, address _referer) external;

    function approve( address _spender, uint256 _value ) external returns (bool success);

    function transferFrom( address _from, address _to, uint256 _value ) external returns (bool success);

    function burn(uint256 amount) external;

    function burnFrom(address account, uint256 amount) external;

    function CurrentSupply() external view returns (uint256);

    function setRewardsWallet(address _rewardsContractAddress) external;

    function BurnedTokens() external view returns (uint256);

    // sets developer wallet address for receiving fee
    function setDevWallet(address _devWallet) external;

    function claimReferalReward() external;

    event Taxes(uint256 burnTax, uint256 devTax, uint256 rewardstax);

    event UserRegistered( address indexed user, address indexed referer, uint256 timestamp );

    event Burn(address account, uint256 amount, uint256 timestamp);

}

// File: contracts/SingleSwap.sol



// SPDX-License-Identifier: Unlicensed

interface IUniswapV2Router02 {
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
}


pragma solidity ^0.8.0;
import "./interfaces/ISaltsToken.sol";

contract SingleSwap {

    IUniswapV2Router02 public swapRouter;
    ISaltsToken public saltsToken;

    constructor(address _saltsToken, address _routerAddress) {
        saltsToken = ISaltsToken(_saltsToken);
        swapRouter = IUniswapV2Router02(_routerAddress);
    }

    function swapExactEthForTokens(uint256 amountOutMin,address[] calldata path,address recipient,address _referer)
    external payable
    {
        saltsToken.registerUser(recipient, _referer);
        swapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{value: msg.value}(amountOutMin,path,recipient,block.timestamp+1000);
    }
}