Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- SpunksRoyaltyDisperse
- Optimization enabled
- true
- Compiler version
- v0.8.24+commit.e11b9ed9
- Optimization runs
- 1000
- EVM Version
- paris
- Verified at
- 2024-02-03T20:57:06.462612Z
src/SpunksRoyaltyDisperse.sol
// SPDX-License-Identifier: UNLICENSED
// (c) 2023 @0xLuckyGreen All rights are reserved. IT IS NOT LICENSED FOR COPYING
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
contract SpunksRoyaltyDisperse is Ownable, ReentrancyGuard {
uint256 public foundersBalance = 0;
uint256 public constant dispersePeriod = 180 days;
uint256 public nextDisperseTimestamp = 1714521600; // 1 May 2024 00:00
uint256 balanceToDisperse;
uint256 public disperseNextTokenId = 0;
address public constant pulseSpunks =
0x83fc7f94867B495E092A7538c1eb44dF8b4b937B;
address public founder1Wallet = 0x8928F06712B9fF8a876A4f0b5DC0f656a80ED68A;
address public founder2Wallet = 0x843a2E67E315b6a50b45A561d03238Fd6aEDeeF7;
constructor() Ownable(msg.sender) {}
receive() external payable {
// out of 8% assumed to be received here, 5% go to holders, 3% to founders
uint256 fraction = msg.value / 8;
// update part of balance balance belonging to founders
foundersBalance += fraction * 3;
// The rest of this contract's balance is considered belonging for the holders.
}
function fund() public payable {
// out of 8% assumed to be received here, 5% go to holders, 3% to founders
uint256 fraction = msg.value / 8;
// update part of balance balance belonging to founders
foundersBalance += fraction * 3;
// The rest of this contract's balance is considered belonging for the holders.
}
function disperseToHolders(
uint256 tokenCount,
uint256 stopGas
) public nonReentrant {
require(tokenCount > 0, "Too small step");
require(block.timestamp >= nextDisperseTimestamp, "Too soon");
if (disperseNextTokenId == 0) {
balanceToDisperse = address(this).balance - foundersBalance;
}
uint256 tokenSupply = IERC721Enumerable(pulseSpunks).totalSupply();
require(address(this).balance > 0, "No balance");
require(tokenSupply > 0, "No tokens");
uint256 transferAmount = balanceToDisperse / tokenSupply;
uint256 tokenIdBegin = disperseNextTokenId;
uint256 tokenIdEnd = disperseNextTokenId + tokenCount;
if (tokenIdEnd > tokenSupply) {
tokenIdEnd = tokenSupply;
}
uint256 tokenId = tokenIdBegin;
while (tokenId < tokenIdEnd) {
if (gasleft() < stopGas) break;
try IERC721(pulseSpunks).ownerOf(tokenId) returns (
address tokenOwner
) {
if (
!isContract(tokenOwner) &&
tokenOwner != 0x000000000000000000000000000000000000dEaD
) {
// send() has fixed gas limit, but may fail, but we ignore it
// because we want to save gas and we don't want to revert here
bool success = payable(tokenOwner).send(transferAmount);
success; // suppress compiler warning
}
} catch {}
unchecked {
++tokenId;
}
}
if (tokenId == tokenSupply) {
// disperse finished
nextDisperseTimestamp += dispersePeriod;
disperseNextTokenId = 0;
} else {
// disperse should continue in next transaction
disperseNextTokenId = tokenId;
}
}
function disperseToHolders() public {
disperseToHolders(10_000, 300_000);
}
function disperseToFounders() public nonReentrant {
if (foundersBalance > 0) {
payable(founder1Wallet).transfer(foundersBalance / 2);
payable(founder2Wallet).transfer(foundersBalance / 2);
foundersBalance = 0;
}
}
function setFounder1Wallet(address _addr) public onlyOwner {
founder1Wallet = _addr;
}
function setFounder2Wallet(address _addr) public onlyOwner {
founder2Wallet = _addr;
}
function saveTokens(address _tokenContract) public onlyOwner {
// emergency withdraw of tokens accidentally sent to this contract
uint256 amount = IERC20(_tokenContract).balanceOf(address(this));
IERC20(_tokenContract).transfer(owner(), amount);
}
function isContract(address _addr) private view returns (bool) {
uint32 size;
assembly {
size := extcodesize(_addr)
}
return size > 0;
}
}
lib/openzeppelin-contracts/contracts/access/Ownable.sol
// 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);
}
}
lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 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 ERC721 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 ERC721
* 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);
}
lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
lib/openzeppelin-contracts/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
lib/openzeppelin-contracts/contracts/utils/Context.sol
// 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;
}
}
lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.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 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;
}
}
lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* 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[EIP 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);
}
Compiler Settings
{"remappings":["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":1000,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"disperseNextTokenId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dispersePeriod","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"disperseToFounders","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"disperseToHolders","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"disperseToHolders","inputs":[{"type":"uint256","name":"tokenCount","internalType":"uint256"},{"type":"uint256","name":"stopGas","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"founder1Wallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"founder2Wallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"foundersBalance","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"fund","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextDisperseTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pulseSpunks","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"saveTokens","inputs":[{"type":"address","name":"_tokenContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFounder1Wallet","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFounder2Wallet","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x6080604052600060028190556366318600600355600555600680546001600160a01b0319908116738928f06712b9ff8a876a4f0b5dc0f656a80ed68a179091556007805490911673843a2e67e315b6a50b45a561d03238fd6aedeef717905534801561006a57600080fd5b50338061009157604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61009a816100a4565b50600180556100f4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610bde806101036000396000f3fe6080604052600436106101125760003560e01c80638da5cb5b116100a5578063b60d428811610074578063f2fde38b11610059578063f2fde38b146102ec578063f5023de91461030c578063fab7e6931461032c57600080fd5b8063b60d4288146102cf578063ea746b6a146102d757600080fd5b80638da5cb5b146102535780638e5fc117146102715780639633734a1461028757806398c99c9e146102af57600080fd5b8063715018a6116100e1578063715018a6146101e8578063781474dc146101fd5780637afcb5241461021d57806385fd7a411461023357600080fd5b80630ac36d851461014f57806320041a7c1461017957806337a1c5401461019b578063546db97c146101d357600080fd5b3661014a576000610124600834610a90565b9050610131816003610ab2565b600260008282546101429190610acf565b925050819055005b600080fd5b34801561015b57600080fd5b5061016662ed4e0081565b6040519081526020015b60405180910390f35b34801561018557600080fd5b50610199610194366004610af7565b610342565b005b3480156101a757600080fd5b506006546101bb906001600160a01b031681565b6040516001600160a01b039091168152602001610170565b3480156101df57600080fd5b50610199610379565b3480156101f457600080fd5b5061019961038a565b34801561020957600080fd5b50610199610218366004610af7565b61039c565b34801561022957600080fd5b5061016660025481565b34801561023f57600080fd5b5061019961024e366004610b1b565b6103d3565b34801561025f57600080fd5b506000546001600160a01b03166101bb565b34801561027d57600080fd5b5061016660055481565b34801561029357600080fd5b506101bb7383fc7f94867b495e092a7538c1eb44df8b4b937b81565b3480156102bb57600080fd5b506101996102ca366004610af7565b61071c565b610199610859565b3480156102e357600080fd5b5061019961088c565b3480156102f857600080fd5b50610199610307366004610af7565b61093d565b34801561031857600080fd5b506007546101bb906001600160a01b031681565b34801561033857600080fd5b5061016660035481565b61034a610994565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610388612710620493e06103d3565b565b610392610994565b61038860006109da565b6103a4610994565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6103db610a37565b600082116104305760405162461bcd60e51b815260206004820152600e60248201527f546f6f20736d616c6c207374657000000000000000000000000000000000000060448201526064015b60405180910390fd5b6003544210156104825760405162461bcd60e51b815260206004820152600860248201527f546f6f20736f6f6e0000000000000000000000000000000000000000000000006044820152606401610427565b60055460000361049d576002546104999047610b3d565b6004555b60007383fc7f94867b495e092a7538c1eb44df8b4b937b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610b50565b9050600047116105675760405162461bcd60e51b815260206004820152600a60248201527f4e6f2062616c616e6365000000000000000000000000000000000000000000006044820152606401610427565b600081116105b75760405162461bcd60e51b815260206004820152600960248201527f4e6f20746f6b656e7300000000000000000000000000000000000000000000006044820152606401610427565b6000816004546105c79190610a90565b60055490915060006105d98683610acf565b9050838111156105e65750825b815b818110156106d957855a106106d9576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018290527383fc7f94867b495e092a7538c1eb44df8b4b937b90636352211e90602401602060405180830381865afa92505050801561067c575060408051601f3d908101601f1916820190925261067991810190610b69565b60015b156106d15763ffffffff813b161580156106a1575061dead6001600160a01b03821614155b156106cf576040516000906001600160a01b0383169087156108fc0290889084818181858888f15050505050505b505b6001016105e8565b8481036107045762ed4e00600360008282546106f59190610acf565b9091555050600060055561070a565b60058190555b505050505061071860018055565b5050565b610724610994565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a89190610b50565b9050816001600160a01b031663a9059cbb6107cb6000546001600160a01b031690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108549190610b86565b505050565b6000610866600834610a90565b9050610873816003610ab2565b600260008282546108849190610acf565b909155505050565b610894610a37565b6002541561093457600654600280546001600160a01b03909216916108fc916108bc91610a90565b6040518115909202916000818181858888f193505050501580156108e4573d6000803e3d6000fd5b50600754600280546001600160a01b03909216916108fc9161090591610a90565b6040518115909202916000818181858888f1935050505015801561092d573d6000803e3d6000fd5b5060006002555b61038860018055565b610945610994565b6001600160a01b038116610988576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610427565b610991816109da565b50565b6000546001600160a01b03163314610388576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610427565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015403610a73576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b634e487b7160e01b600052601160045260246000fd5b600082610aad57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610ac957610ac9610a7a565b92915050565b80820180821115610ac957610ac9610a7a565b6001600160a01b038116811461099157600080fd5b600060208284031215610b0957600080fd5b8135610b1481610ae2565b9392505050565b60008060408385031215610b2e57600080fd5b50508035926020909101359150565b81810381811115610ac957610ac9610a7a565b600060208284031215610b6257600080fd5b5051919050565b600060208284031215610b7b57600080fd5b8151610b1481610ae2565b600060208284031215610b9857600080fd5b81518015158114610b1457600080fdfea2646970667358221220be8d93e182b890bddbd0a8ec7883f72069a80d8c694fc06e1ccedbb5f361c1e364736f6c63430008180033
Deployed ByteCode
0x6080604052600436106101125760003560e01c80638da5cb5b116100a5578063b60d428811610074578063f2fde38b11610059578063f2fde38b146102ec578063f5023de91461030c578063fab7e6931461032c57600080fd5b8063b60d4288146102cf578063ea746b6a146102d757600080fd5b80638da5cb5b146102535780638e5fc117146102715780639633734a1461028757806398c99c9e146102af57600080fd5b8063715018a6116100e1578063715018a6146101e8578063781474dc146101fd5780637afcb5241461021d57806385fd7a411461023357600080fd5b80630ac36d851461014f57806320041a7c1461017957806337a1c5401461019b578063546db97c146101d357600080fd5b3661014a576000610124600834610a90565b9050610131816003610ab2565b600260008282546101429190610acf565b925050819055005b600080fd5b34801561015b57600080fd5b5061016662ed4e0081565b6040519081526020015b60405180910390f35b34801561018557600080fd5b50610199610194366004610af7565b610342565b005b3480156101a757600080fd5b506006546101bb906001600160a01b031681565b6040516001600160a01b039091168152602001610170565b3480156101df57600080fd5b50610199610379565b3480156101f457600080fd5b5061019961038a565b34801561020957600080fd5b50610199610218366004610af7565b61039c565b34801561022957600080fd5b5061016660025481565b34801561023f57600080fd5b5061019961024e366004610b1b565b6103d3565b34801561025f57600080fd5b506000546001600160a01b03166101bb565b34801561027d57600080fd5b5061016660055481565b34801561029357600080fd5b506101bb7383fc7f94867b495e092a7538c1eb44df8b4b937b81565b3480156102bb57600080fd5b506101996102ca366004610af7565b61071c565b610199610859565b3480156102e357600080fd5b5061019961088c565b3480156102f857600080fd5b50610199610307366004610af7565b61093d565b34801561031857600080fd5b506007546101bb906001600160a01b031681565b34801561033857600080fd5b5061016660035481565b61034a610994565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610388612710620493e06103d3565b565b610392610994565b61038860006109da565b6103a4610994565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6103db610a37565b600082116104305760405162461bcd60e51b815260206004820152600e60248201527f546f6f20736d616c6c207374657000000000000000000000000000000000000060448201526064015b60405180910390fd5b6003544210156104825760405162461bcd60e51b815260206004820152600860248201527f546f6f20736f6f6e0000000000000000000000000000000000000000000000006044820152606401610427565b60055460000361049d576002546104999047610b3d565b6004555b60007383fc7f94867b495e092a7538c1eb44df8b4b937b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610b50565b9050600047116105675760405162461bcd60e51b815260206004820152600a60248201527f4e6f2062616c616e6365000000000000000000000000000000000000000000006044820152606401610427565b600081116105b75760405162461bcd60e51b815260206004820152600960248201527f4e6f20746f6b656e7300000000000000000000000000000000000000000000006044820152606401610427565b6000816004546105c79190610a90565b60055490915060006105d98683610acf565b9050838111156105e65750825b815b818110156106d957855a106106d9576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018290527383fc7f94867b495e092a7538c1eb44df8b4b937b90636352211e90602401602060405180830381865afa92505050801561067c575060408051601f3d908101601f1916820190925261067991810190610b69565b60015b156106d15763ffffffff813b161580156106a1575061dead6001600160a01b03821614155b156106cf576040516000906001600160a01b0383169087156108fc0290889084818181858888f15050505050505b505b6001016105e8565b8481036107045762ed4e00600360008282546106f59190610acf565b9091555050600060055561070a565b60058190555b505050505061071860018055565b5050565b610724610994565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a89190610b50565b9050816001600160a01b031663a9059cbb6107cb6000546001600160a01b031690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108549190610b86565b505050565b6000610866600834610a90565b9050610873816003610ab2565b600260008282546108849190610acf565b909155505050565b610894610a37565b6002541561093457600654600280546001600160a01b03909216916108fc916108bc91610a90565b6040518115909202916000818181858888f193505050501580156108e4573d6000803e3d6000fd5b50600754600280546001600160a01b03909216916108fc9161090591610a90565b6040518115909202916000818181858888f1935050505015801561092d573d6000803e3d6000fd5b5060006002555b61038860018055565b610945610994565b6001600160a01b038116610988576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610427565b610991816109da565b50565b6000546001600160a01b03163314610388576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610427565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015403610a73576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b634e487b7160e01b600052601160045260246000fd5b600082610aad57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610ac957610ac9610a7a565b92915050565b80820180821115610ac957610ac9610a7a565b6001600160a01b038116811461099157600080fd5b600060208284031215610b0957600080fd5b8135610b1481610ae2565b9392505050565b60008060408385031215610b2e57600080fd5b50508035926020909101359150565b81810381811115610ac957610ac9610a7a565b600060208284031215610b6257600080fd5b5051919050565b600060208284031215610b7b57600080fd5b8151610b1481610ae2565b600060208284031215610b9857600080fd5b81518015158114610b1457600080fdfea2646970667358221220be8d93e182b890bddbd0a8ec7883f72069a80d8c694fc06e1ccedbb5f361c1e364736f6c63430008180033