文件 1 的 1:ClaimSmartMain.sol
pragma solidity ^0.8.20;
interface SmartToken{
function claim() external ;
function prepapreClaim() external ;
function transfer(address to, uint256 amount)external returns (bool);
function balanceOf(address owner) external view returns (uint256 result);
}
contract ClaimSmart {
function claim() external {
SmartToken token = SmartToken(0x91fF962f7DE9865D3ca8CA151BAc28969F52F34b);
token.prepapreClaim();
token.claim();
uint256 b = token.balanceOf(address(this));
require(b>0,"zero");
require(token.transfer(msg.sender, b),"FF");
}
}
contract ClaimSmartMain {
address private owner;
constructor(){
owner=msg.sender;
}
SmartToken constant token = SmartToken(0x91fF962f7DE9865D3ca8CA151BAc28969F52F34b);
function withdraw(address to) public {
require(owner==msg.sender,"F");
uint256 b = token.balanceOf(address(this));
require(b>0,"zero");
token.transfer(to, b);
}
function execute(address traget,bytes calldata data) external {
require(owner==msg.sender,"F");
(bool ok,)=traget.call(data);
require(ok,"FF");
}
function deleteCall(address traget,bytes calldata data) external {
require(owner==msg.sender,"F");
(bool ok,)=traget.delegatecall(data);
require(ok,"FF");
}
function claim() external {
ClaimSmart cs = new ClaimSmart();
cs.claim();
}
}
{
"compilationTarget": {
"ClaimSmartMain.sol": "ClaimSmartMain"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}