Open 123456788940 opened 1 year ago
// SPDX-License-Identifier: MIT pragma solidity ^0.8;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract TestUSDT is ERC20 { constructor(uint256 initialSupply) ERC20("testUSDT", "TUSDT") { _mint(msg.sender, initialSupply * 10 ** uint256(decimals())); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract tokenSwapper{ IERC20 public testINT; IERC20 public testUSDT;
constructor(IERC20 _testINT, IERC20 _testUSDT) {
testINT=IERC20(_testINT);
testUSDT=IERC20(_testUSDT);
}
function swap(uint amount) external{
require(amount > 0, "Amount must be greater than zero");
require(testINT.transferFrom(msg.sender, address(this), amount), "TransferFrom failed");
require(testUSDT.transfer(msg.sender, amount), "Transfer failed");
}
}
// SPDX-License-Identifier: MIT pragma solidity ^0.8;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract TestINT is ERC20 { constructor(uint256 initialSupply) ERC20("TestINT", "TINT") { _mint(msg.sender, initialSupply * (10 ** uint256(decimals()))); } }