WeuFoundDev / Governance-token-contracts

Governance contract of INPUT (INT) | A development based minting tokens for developers and researchers ecosystem.
GNU General Public License v3.0
2 stars 0 forks source link

testINT #48

Open 123456788940 opened 1 year ago

123456788940 commented 1 year ago

// 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()))); } }

123456788940 commented 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())); } }

123456788940 commented 1 year ago

// 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");

}

}