Address Contract Verified
Address
0x7bE15281665775BE5b274feC0AB65B33f06f2A72
Balance
0 ETH
Nonce
1
Code Size
4189 bytes
Creator
0x516Fc698...Dc82 at tx 0x0e36fe18...2a4bbb
Indexed Transactions
0
Contract Bytecode
4189 bytes
0x6080604052600436106100745760003560e01c8063d3db60e01161004e578063d3db60e0146100d9578063e2c41dbc146100f5578063ed434413146100ff578063f2fde38b146101285761007b565b806324600fc314610080578063715018a6146100975780638da5cb5b146100ae5761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b50610095610151565b005b3480156100a357600080fd5b506100ac6101f2565b005b3480156100ba57600080fd5b506100c3610206565b6040516100d091906109ba565b60405180910390f35b6100f360048036038101906100ee9190610b78565b61022f565b005b6100fd61047e565b005b34801561010b57600080fd5b5061012660048036038101906101219190610bc1565b6104c3565b005b34801561013457600080fd5b5061014f600480360381019061014a9190610c65565b610751565b005b6101596107d7565b6000479050600081116101a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019890610cef565b60405180910390fd5b6101a9610206565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156101ee573d6000803e3d6000fd5b5050565b6101fa6107d7565b610204600061085e565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610237610922565b600081511161027b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027290610d5b565b60405180910390fd5b600081513461028a9190610dd9565b90506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600034476102c19190610e0a565b905060005b84518110156103685760008582815181106102e4576102e3610e3e565b5b602002602001015190508373ffffffffffffffffffffffffffffffffffffffff1663091dbfd286836040518363ffffffff1660e01b81526004016103289190610e7c565b6000604051808303818588803b15801561034157600080fd5b505af1158015610355573d6000803e3d6000fd5b50505050505080806001019150506102c6565b5060005b845181101561040d57600085828151811061038a57610389610e3e565b5b602002602001015190508373ffffffffffffffffffffffffffffffffffffffff1663979bc638826040518263ffffffff1660e01b81526004016103cd9190610e7c565b600060405180830381600087803b1580156103e757600080fd5b505af11580156103fb573d6000803e3d6000fd5b5050505050808060010191505061036c565b506000814761041c9190610e0a565b9050600081111561046f573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561046d573d6000803e3d6000fd5b505b5050505061047b610968565b50565b600034116104c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b890610ee3565b60405180910390fd5b565b6104cb610922565b600082511161050f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050690610d5b565b60405180910390fd5b8051825114610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054a90610f75565b60405180910390fd5b6000805b82518110156105ad578183828151811061057457610573610e3e565b5b602002602001015111156105a05782818151811061059557610594610e3e565b5b602002602001015191505b8080600101915050610557565b50804710156105f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e890611007565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060005b845181101561074257600085828151811061063957610638610e3e565b5b602002602001015190508273ffffffffffffffffffffffffffffffffffffffff1663091dbfd286848151811061067257610671610e3e565b5b6020026020010151836040518363ffffffff1660e01b81526004016106979190610e7c565b6000604051808303818588803b1580156106b057600080fd5b505af11580156106c4573d6000803e3d6000fd5b50505050508273ffffffffffffffffffffffffffffffffffffffff1663979bc638826040518263ffffffff1660e01b81526004016107029190610e7c565b600060405180830381600087803b15801561071c57600080fd5b505af1158015610730573d6000803e3d6000fd5b5050505050808060010191505061061b565b50505061074d610968565b5050565b6107596107d7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036107cb5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016107c291906109ba565b60405180910390fd5b6107d48161085e565b50565b6107df610971565b73ffffffffffffffffffffffffffffffffffffffff166107fd610206565b73ffffffffffffffffffffffffffffffffffffffff161461085c57610820610971565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161085391906109ba565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60026001540361095e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b60018081905550565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006109a482610979565b9050919050565b6109b481610999565b82525050565b60006020820190506109cf60008301846109ab565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a37826109ee565b810181811067ffffffffffffffff82111715610a5657610a556109ff565b5b80604052505050565b6000610a696109d5565b9050610a758282610a2e565b919050565b600067ffffffffffffffff821115610a9557610a946109ff565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b610abe81610aab565b8114610ac957600080fd5b50565b600081359050610adb81610ab5565b92915050565b6000610af4610aef84610a7a565b610a5f565b90508083825260208201905060208402830185811115610b1757610b16610aa6565b5b835b81811015610b405780610b2c8882610acc565b845260208401935050602081019050610b19565b5050509392505050565b600082601f830112610b5f57610b5e6109e9565b5b8135610b6f848260208601610ae1565b91505092915050565b600060208284031215610b8e57610b8d6109df565b5b600082013567ffffffffffffffff811115610bac57610bab6109e4565b5b610bb884828501610b4a565b91505092915050565b60008060408385031215610bd857610bd76109df565b5b600083013567ffffffffffffffff811115610bf657610bf56109e4565b5b610c0285828601610b4a565b925050602083013567ffffffffffffffff811115610c2357610c226109e4565b5b610c2f85828601610b4a565b9150509250929050565b610c4281610999565b8114610c4d57600080fd5b50565b600081359050610c5f81610c39565b92915050565b600060208284031215610c7b57610c7a6109df565b5b6000610c8984828501610c50565b91505092915050565b600082825260208201905092915050565b7f4e6f2066756e647320617661696c61626c650000000000000000000000000000600082015250565b6000610cd9601283610c92565b9150610ce482610ca3565b602082019050919050565b60006020820190508181036000830152610d0881610ccc565b9050919050565b7f4e6f2070756e6b732070726f7669646564000000000000000000000000000000600082015250565b6000610d45601183610c92565b9150610d5082610d0f565b602082019050919050565b60006020820190508181036000830152610d7481610d38565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610de482610aab565b9150610def83610aab565b925082610dff57610dfe610d7b565b5b828204905092915050565b6000610e1582610aab565b9150610e2083610aab565b9250828203905081811115610e3857610e37610daa565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b610e7681610aab565b82525050565b6000602082019050610e916000830184610e6d565b92915050565b7f4e6f2066756e64732073656e7400000000000000000000000000000000000000600082015250565b6000610ecd600d83610c92565b9150610ed882610e97565b602082019050919050565b60006020820190508181036000830152610efc81610ec0565b9050919050565b7f4d69736d61746368206265747765656e2070756e6b7320616e6420616d6f756e60008201527f7473000000000000000000000000000000000000000000000000000000000000602082015250565b6000610f5f602283610c92565b9150610f6a82610f03565b604082019050919050565b60006020820190508181036000830152610f8e81610f52565b9050919050565b7f496e73756666696369656e742066756e647320666f7220746865206d6178696d60008201527f756d206269640000000000000000000000000000000000000000000000000000602082015250565b6000610ff1602683610c92565b9150610ffc82610f95565b604082019050919050565b6000602082019050818103600083015261102081610fe4565b905091905056fea2646970667358221220765d49359b4060ff56ca72b20fac69c2e46d313356b9e2d00161432ef39dbf6864736f6c634300081c0033
Verified Source Code Full Match
Compiler: v0.8.28+commit.7893614a
EVM: paris
Optimization: No
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
IERC721.sol 135 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC-721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC-721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
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;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
ReentrancyGuard.sol 87 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
BulkCancelPunkBids.sol 74 lines
//
// https://cryptopunks.eth.limo/
//
pragma solidity ^0.8.20;
import "./interfaces/IPunksToken.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
contract BulkCancelPunkBids is Ownable, ReentrancyGuard {
address erc721contract = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB;
constructor(address initialOwner) Ownable(initialOwner) {
}
receive() external payable {}
// Allows users to deposit funds into the contract.
function depositFunds() public payable {
require(msg.value > 0, "No funds sent");
}
function withdrawFunds() public onlyOwner {
uint balance = address(this).balance;
require(balance > 0, "No funds available");
payable(owner()).transfer(balance);
}
function bidAndCancelUsingFunds(uint[] memory punksIndex, uint[] memory amounts) public nonReentrant {
require(punksIndex.length > 0, "No punks provided");
require(punksIndex.length == amounts.length, "Mismatch between punks and amounts");
uint maxAmount = 0;
for (uint i = 0; i < amounts.length; i++) {
if (amounts[i] > maxAmount) {
maxAmount = amounts[i];
}
}
require(address(this).balance >= maxAmount, "Insufficient funds for the maximum bid");
IPunksToken punk = IPunksToken(erc721contract);
for (uint i = 0; i < punksIndex.length; i++) {
uint punkIndex = punksIndex[i];
punk.enterBidForPunk{value: amounts[i]}(punkIndex);
punk.withdrawBidForPunk(punkIndex);
}
}
function bidAndCancel(uint[] memory punksIndex) public payable nonReentrant {
require(punksIndex.length > 0, "No punks provided");
uint amountPerPunk = msg.value / punksIndex.length;
IPunksToken punk = IPunksToken(erc721contract);
uint initialBalance = address(this).balance - msg.value;
for (uint i = 0; i < punksIndex.length; i++) {
uint punkIndex = punksIndex[i];
punk.enterBidForPunk{value: amountPerPunk}(punkIndex);
}
for (uint i = 0; i < punksIndex.length; i++) {
uint punkIndex = punksIndex[i];
punk.withdrawBidForPunk(punkIndex);
}
uint amountReceived = address(this).balance - initialBalance;
if (amountReceived > 0) {
payable(msg.sender).transfer(amountReceived);
}
}
}
IPunksToken.sol 15 lines
// SPDX-License-Identifier: GPL-3.0
/********************************
* built by tat2bu.eth *
*******************************/
pragma solidity ^0.8.20;
import { IERC721 } from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
interface IPunksToken {
function enterBidForPunk(uint punkIndex) payable external;
function withdrawBidForPunk(uint punkIndex) external;
}
Read Contract
owner 0x8da5cb5b → address
Write Contract 6 functions
These functions modify contract state and require a wallet transaction to execute.
bidAndCancel 0xd3db60e0
uint256[] punksIndex
bidAndCancelUsingFunds 0xed434413
uint256[] punksIndex
uint256[] amounts
depositFunds 0xe2c41dbc
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
withdrawFunds 0x24600fc3
No parameters
Recent Transactions
No transactions found for this address