编译器
0.8.23+commit.f704f362
文件 1 的 4:BatchClaimUsers.sol
pragma solidity ^0.8.23;
import {Ownable} from "node_modules/@openzeppelin/contracts/access/Ownable.sol";
import {IClaimVault} from "../interfaces/IClaimVault.sol";
contract BatchClaimUsers is Ownable {
IClaimVault public claimVault;
event ClaimVaultUpdated(address indexed newClaimVault);
constructor(address _claimVault) Ownable(msg.sender) {
claimVault = IClaimVault(_claimVault);
}
function claimRewardsForMultiple(address[] calldata lsts) external {
uint256 len = lsts.length;
for (uint i; i < len; ++i) {
claimVault.claimRewardsFor(lsts[i], msg.sender);
}
}
function updateClaimVault(address _newClaimVault) external onlyOwner {
require(_newClaimVault != address(0), "BatchClaim: ClaimVault address cannot be the zero address");
claimVault = IClaimVault(_newClaimVault);
emit ClaimVaultUpdated(_newClaimVault);
}
}
文件 2 的 4:Context.sol
pragma solidity ^0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 3 的 4:IClaimVault.sol
pragma solidity ^0.8.23;
interface IClaimVault {
function claimRewards(address lst) external;
function claimRewardsFor(address lst, address user) external;
function getLSTs() external view returns (address[] memory);
}
文件 4 的 4:Ownable.sol
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
error OwnableUnauthorizedAccount(address account);
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
{
"compilationTarget": {
"src/rewards/BatchClaimUsers.sol": "BatchClaimUsers"
},
"evmVersion": "paris",
"libraries": {
":__CACHE_BREAKER__": "0x0000000000000031373239353934323535333231"
},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_claimVault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newClaimVault","type":"address"}],"name":"ClaimVaultUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address[]","name":"lsts","type":"address[]"}],"name":"claimRewardsForMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimVault","outputs":[{"internalType":"contract IClaimVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newClaimVault","type":"address"}],"name":"updateClaimVault","outputs":[],"stateMutability":"nonpayable","type":"function"}]