// Contract: SxpSwap
// Target function: function isSolarAddress(string memory str) internal pure returns (bool)
// SPDX-License-Identifier: CC BY-ND 4.0
/*

███████╗██╗  ██╗██████╗     ███████╗██╗    ██╗ █████╗ ██████╗ 
██╔════╝╚██╗██╔╝██╔══██╗    ██╔════╝██║    ██║██╔══██╗██╔══██╗
███████╗ ╚███╔╝ ██████╔╝    ███████╗██║ █╗ ██║███████║██████╔╝
╚════██║ ██╔██╗ ██╔═══╝     ╚════██║██║███╗██║██╔══██║██╔═══╝ 
███████║██╔╝ ██╗██║         ███████║╚███╔███╔╝██║  ██║██║     
╚══════╝╚═╝  ╚═╝╚═╝         ╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝

Copyright (c) Solar Network <hello@solar.org>

Collaborators: leitesv <federico@solar.org>

Creative Commons Attribution-NoDerivatives 4.0 International Public
License
*/

pragma solidity 0.8.10;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() {
        _transferOwnership(_msgSender());
    }

    function owner() public view virtual returns (address) {
        return _owner;
    }

    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

contract SxpSwap is Ownable {
    struct Transfer {
        address sender;
        address token;
        uint256 amount;
        string message;
    }

    Transfer[] transfers;

    address private constant swipe_address = 0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9;
    event Swap(address _from, string _to, uint256 _amount);
    // Getters

    function getMessages(uint256 _index) view external returns(address, address, uint256, string memory) {
        Transfer memory selectedTransfer = transfers[_index];
        return (selectedTransfer.sender, selectedTransfer.token, selectedTransfer.amount, selectedTransfer.message);
    }