// File: BnbSwap.sol



pragma solidity ^0.5.7;

import "./Ownable.sol";
import "./IERC20.sol";


contract BnbSwap is Ownable {
    mapping (address => string) public registers;

    event Put(address indexed eth, string indexed bnb);

    function put(string calldata _bnb) external {
        require(bytes(registers[msg.sender]).length == 0, "Already registered");
        registers[msg.sender] = _bnb;
        emit Put(msg.sender, _bnb);
    }

    function transfer(
        IERC20 _token,
        address _to,
        uint256 _value
    )
        external
        onlyOwner
    {
        _token.transfer(_to, _value);
    }

    function approve(
        IERC20 _token,
        address _spender,
        uint256 _value
    )
        external
        onlyOwner
    {
        _token.approve(_spender, _value);
    }

    function transferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    )
        external
        onlyOwner
    {
        token.transferFrom(from, to, value);
    }

    function burn(
        IERC20 token,
        uint256 value
    )
        external
        onlyOwner
    {
        token.burn(value);
    }

    function burnFrom(
        IERC20 token,
        address from,
        uint256 value
    )
        external
        onlyOwner
    {
        token.burnFrom(from, value);
    }
}

// File: IERC20.sol



pragma solidity ^0.5.7;

/**
 * @title ERC20 interface without bool returns
 * @dev see https://eips.ethereum.org/EIPS/eip-20
 */
interface IERC20 {
    function transfer(address to, uint256 value) external;

    function approve(address spender, uint256 value) external;

    function transferFrom(address from, address to, uint256 value) external;

    function totalSupply() external view returns (uint256);

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

    function allowance(address owner, address spender) external view returns (uint256);

    function burn(uint256 value) external;

    function burnFrom(address from, uint256 value) external;

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: Ownable.sol



pragma solidity ^0.5.2;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    /**
     * @return the address of the owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner());
        _;
    }

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Allows the current owner to relinquish control of the contract.
     * It will not be possible to call the functions with the `onlyOwner`
     * modifier anymore.
     * @notice Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}