Verified contractExactMIT
Sweeper
Address0xcb4abfb00f5d3947212025cd527e53bd5d4875c4
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.24
- Same code
Only this contract
Details
- Compiler
- solc 0.8.24+commit.e11b9ed9
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,414,658
- Creation transaction
- 0x3be03394d3…8a8204356a
contracts/src/Sweeper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IERC20Full {
function transferFrom(address from, address to, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
}
/// @title Sweeper
/// @notice L(偽装アドレス)が事前approveしたトークンを、誰でも固定collectorへ回収できる。
/// - permissionless(Lの鍵が落ちても、第三者がgasを払って回収可能)
/// - collector はimmutable(改ざん不能)
/// - per-Lの上限はplanner側で管理(コントラクトは単純に全額スイープ)
/// ETHで受けた場合: L自身が署名して送る(または将来EIP-7702で自動化)
contract Sweeper {
address public immutable collector;
constructor(address collector_) {
require(collector_ != address(0), "collector");
collector = collector_;
}
function sweepToken(address token, address from, uint256 amount) external {
IERC20Full(token).transferFrom(from, address(this), amount);
IERC20Full(token).transfer(collector, amount);
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=lib/forge-std/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.