Verified contractExactMIT
YoinkAndClaim
Address0xe19a99d2a441dcf92d649594ad37b8a3d12ac4fa
- Balance
0 ETH
- Transactions
6
- Compiler
solc 0.8.34
- Same code
Only this contract
Details
- Compiler
- solc 0.8.34+commit.80d5c536
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,401,158
- Creation transaction
- 0x17140103ff…38572cfe1b
contracts/newcall.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
}
contract YoinkAndClaim {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner, "Not the owner");
_;
}
constructor() {
owner = msg.sender;
}
/**
* @dev Calls multiple target addresses with multiple data payloads
* @param targets Array of addresses to call
* @param datas Array of bytes data to send to each target
*/
function yoink(address[] calldata targets, bytes[] calldata datas) external onlyOwner {
require(targets.length == datas.length, "Arrays length mismatch");
for (uint256 i = 0; i < targets.length; i++) {
(bool success, ) = targets[i].call(datas[i]);
require(success, "Call failed");
}
}
/**
* @dev Sends entire token balance of this contract to owner
* @param token Address of the ERC20 token
*/
function claim(address token) external onlyOwner {
uint256 balance = IERC20(token).balanceOf(address(this));
require(balance > 0, "No tokens to claim");
bool success = IERC20(token).transfer(owner, balance);
require(success, "Transfer failed");
}
/**
* @dev Allows owner to transfer ownership
* @param newOwner Address of the new owner
*/
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "Invalid new owner");
owner = newOwner;
}
/**
* @dev Allows contract to receive ETH
*/
receive() external payable {}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.