Skip to content
Verified contractExactMIT

FlashUSDTLiquidityBot

Address0x031b715b535c1ad02dfd0bbba4ed8c40c1a2fc1e
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.30

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,431,348
Creation transaction
0x1352014ac4…20fa1df73a

Usdt simulado/usdt red simulda.sol


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

/*
 * SIMULADOR EDUCATIVO DE SALDOS
 *
 * IMPORTANTE:
 * - No crea USDT real.
 * - No modifica el contrato oficial de USDT.
 * - Consulta el saldo real mediante balanceOf().
 * - Mantiene los saldos simulados separados.
 * - Los registros simulados vencen después de 365 días.
 */

interface IERC20BalanceReader {
    function balanceOf(address account)
        external
        view
        returns (uint256);

    function decimals()
        external
        view
        returns (uint8);
}

contract FlashUSDTLiquidityBot {

    // Datos descriptivos del simulador, no de un token ERC20.
    string public simulationName;
    string public simulationLabel;

    // La billetera que despliega el contrato queda autorizada.
    address public immutable SIMULATION_WALLET;

    uint256 public constant MIN_GENERATION = 10_000;
    uint256 public constant SIMULATION_DURATION = 365 days;

    struct SimulatedUSDT {
        uint256 amount;
        uint256 createdAt;
        uint256 expiresAt;
    }

    SimulatedUSDT[] private simulatedGenerations;

    event USDTGenerated(
        address indexed wallet,
        uint256 amount,
        uint256 createdAt,
        uint256 expiresAt
    );

    constructor(
        string memory _simulationName,
        string memory _simulationLabel
    ) {
        simulationName = _simulationName;
        simulationLabel = _simulationLabel;
        SIMULATION_WALLET = msg.sender;
    }

    // -------------------------------------------------
    // 1. REGISTRAR UN SALDO SIMULADO
    // -------------------------------------------------

    function startSimulation(uint256 amount) external {
        _recordSimulatedUSDT(amount);
    }

    // Se conserva el nombre de la función anterior.
    function generateUSDTMirror(uint256 amount) external {
        _recordSimulatedUSDT(amount);
    }

    function _recordSimulatedUSDT(uint256 amount) internal {
        require(
            msg.sender == SIMULATION_WALLET,
            "Unauthorized wallet"
        );

        require(
            amount >= MIN_GENERATION,
            "Minimum generation is 10,000"
        );

        uint256 created = block.timestamp;
        uint256 expiration = created + SIMULATION_DURATION;

        simulatedGenerations.push(
            SimulatedUSDT({
                amount: amount,
                createdAt: created,
                expiresAt: expiration
            })
        );

        emit USDTGenerated(
            SIMULATION_WALLET,
            amount,
            created,
            expiration
        );
    }

    // -------------------------------------------------
    // 2. CONSULTAR EL SALDO SIMULADO ACTIVO
    // -------------------------------------------------

    function simulatedUSDTBalance()
        public
        view
        returns (uint256 total)
    {
        for (
            uint256 i = 0;
            i < simulatedGenerations.length;
            i++
        ) {
            if (
                block.timestamp <
                simulatedGenerations[i].expiresAt
            ) {
                total += simulatedGenerations[i].amount;
            }
        }
    }

    // -------------------------------------------------
    // 3. CONSULTAR EL SALDO REAL + SIMULADO
    // -------------------------------------------------

    /*
     * Consulta balanceOf() en el contrato USDT indicado.
     *
     * Devuelve:
     * realBalance          = saldo real de la billetera.
     * simulatedBalance     = saldo del simulador.
     * informationalTotal  = suma informativa.
     * tokenDecimals        = decimales del token consultado.
     *
     * No transfiere ni modifica ningún token.
     */

    function getCombinedBalance(address usdtToken)
        external
        view
        returns (
            uint256 realBalance,
            uint256 simulatedBalance,
            uint256 informationalTotal,
            uint8 tokenDecimals
        )
    {
        require(usdtToken != address(0), "Invalid token address");
        require(usdtToken.code.length > 0, "Token is not a contract");

        IERC20BalanceReader token =
            IERC20BalanceReader(usdtToken);

        realBalance = token.balanceOf(SIMULATION_WALLET);

        simulatedBalance = simulatedUSDTBalance();

        informationalTotal = realBalance + simulatedBalance;

        tokenDecimals = token.decimals();
    }

    // -------------------------------------------------
    // 4. CONSULTAR EL NUMERO DE GENERACIONES
    // -------------------------------------------------

    function totalUSDTGenerations()
        external
        view
        returns (uint256)
    {
        return simulatedGenerations.length;
    }

    // -------------------------------------------------
    // 5. CONSULTAR UNA GENERACION INDIVIDUAL
    // -------------------------------------------------

    function getUSDTGeneration(uint256 index)
        external
        view
        returns (
            uint256 amount,
            uint256 createdAt,
            uint256 expiresAt,
            bool active
        )
    {
        require(
            index < simulatedGenerations.length,
            "Invalid generation"
        );

        SimulatedUSDT storage generation =
            simulatedGenerations[index];

        return (
            generation.amount,
            generation.createdAt,
            generation.expiresAt,
            block.timestamp < generation.expiresAt
        );
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.