Address Contract Verified
Address
0x6bd73b115e57E28Df2695003754838EDf8eE6d65
Balance
0 ETH
Nonce
1
Code Size
8253 bytes
Creator
0x158a9e87...7f1c at tx 0x98a69f9c...194529
Indexed Transactions
0
Contract Bytecode
8253 bytes
0x608060405234801561000f575f5ffd5b50600436106100fe575f3560e01c8063715018a611610095578063d1ce754e11610064578063d1ce754e146102ae578063e4b4da3d146102e2578063f2fde38b146102fe578063f737d21d1461031a576100fe565b8063715018a61461023a5780638da5cb5b14610244578063bd6018bb14610262578063c7fa13291461027e576100fe565b80635d4bc0ce116100d15780635d4bc0ce146101b057806362f11dd2146101e657806367dd74ca146102025780636de27c671461021e576100fe565b8063041bb6ff146101025780633013ce29146101325780634465e60e146101505780634843d2b114610180575b5f5ffd5b61011c600480360381019061011791906118b8565b610336565b60405161012991906118fd565b60405180910390f35b61013a610353565b6040516101479190611971565b60405180910390f35b61016a600480360381019061016591906119bd565b610377565b60405161017791906118fd565b60405180910390f35b61019a600480360381019061019591906119bd565b6103d9565b6040516101a791906118fd565b60405180910390f35b6101ca60048036038101906101c591906119fb565b610403565b6040516101dd9796959493929190611a98565b60405180910390f35b61020060048036038101906101fb91906118b8565b6104be565b005b61021c600480360381019061021791906119fb565b61063b565b005b61023860048036038101906102339190611b2f565b610a39565b005b610242610b8b565b005b61024c610b9e565b6040516102599190611b6d565b60405180910390f35b61027c600480360381019061027791906118b8565b610bc5565b005b61029860048036038101906102939190611bb0565b610d40565b6040516102a59190611b6d565b60405180910390f35b6102c860048036038101906102c391906119fb565b610d7d565b6040516102d9959493929190611bee565b60405180910390f35b6102fc60048036038101906102f79190611c69565b610eaa565b005b610318600480360381019061031391906118b8565b6111ca565b005b610334600480360381019061032f91906119fb565b61124e565b005b6005602052805f5260405f205f915054906101000a900460ff1681565b7f0000000000000000000000008962f7352eb3326c15d4820f9fad214b9327714a81565b5f60035f8481526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b6003602052815f5260405f20602052805f5260405f205f915091509054906101000a900460ff1681565b6002602052805f5260405f205f91509050805f015f9054906101000a90046fffffffffffffffffffffffffffffffff1690805f0160109054906101000a900463ffffffff1690805f0160149054906101000a900463ffffffff1690805f0160189054906101000a900460ff1690805f0160199054906101000a900460ff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160149054906101000a900460ff16905087565b6104c66114f7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361052b576040517f52a7e56200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16156105ac576040517fdc70d06d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160055f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055507f7cc57cf452d10f473b5304ea98d93b6c468367a9411803385d30c10b47ee9399816040516106309190611b6d565b60405180910390a150565b61064361157e565b8061064e60066115cd565b8110610686576040517f85761f7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60035f8481526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050801561071a576040517ff526332c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025f8581526020019081526020015f2090505f429050815f0160109054906101000a900463ffffffff1663ffffffff168163ffffffff16108061077d5750815f0160149054906101000a900463ffffffff1663ffffffff168163ffffffff16115b156107b4576040517f2ae47f7300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010160149054906101000a900460ff16156107fd576040517f502fd88d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815f0160189054906101000a900460ff1660ff16825f0160199054906101000a900460ff1660ff161061085c576040517f0771de3300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108d93330845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff167f0000000000000000000000008962f7352eb3326c15d4820f9fad214b9327714a73ffffffffffffffffffffffffffffffffffffffff166115d9909392919063ffffffff16565b5f825f0160199054906101000a900460ff1690503360045f8881526020019081526020015f205f8360ff1660ff1681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160035f8881526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550825f01601981819054906101000a900460ff16809291906109d590611cfa565b91906101000a81548160ff021916908360ff160217905550507fe889b3dc10d31e126aa93ffc718b91364323274db119c933aa6abd402bfe7723863383604051610a2193929190611d31565b60405180910390a15050505050610a3661165b565b50565b610a416114f7565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610aa6576040517f52a7e56200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f816fffffffffffffffffffffffffffffffff1603610af1576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b4e82826fffffffffffffffffffffffffffffffff167f0000000000000000000000008962f7352eb3326c15d4820f9fad214b9327714a73ffffffffffffffffffffffffffffffffffffffff166116649092919063ffffffff16565b7f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8282604051610b7f929190611d96565b60405180910390a15050565b610b936114f7565b610b9c5f6116e3565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610bcd6114f7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c32576040517f52a7e56200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16610cb2576040517f987ffcf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60055f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055507f94a409f50d78dc8628b7499ba5af0848a134b9a935a59c0a45313b67f66920f881604051610d359190611b6d565b60405180910390a150565b6004602052815f5260405f20602052805f5260405f205f915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f5f5f5f85610d8d60066115cd565b8110610dc5576040517f85761f7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025f8981526020019081526020015f2090505f429050815f0160109054906101000a900463ffffffff1663ffffffff168163ffffffff1610158015610e2b5750815f0160149054906101000a900463ffffffff1663ffffffff168163ffffffff1611155b825f0160149054906101000a900463ffffffff1663ffffffff168263ffffffff16118360010160149054906101000a900460ff16846001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16855f0160199054906101000a900460ff169750975097509750975050505091939590929450565b60055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16610f2a576040517fc52a162400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f846fffffffffffffffffffffffffffffffff1603610f75576040517f06f6808b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8163ffffffff168363ffffffff1610610fba576040517f536a71af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428363ffffffff161015610ffa576040517fb290253c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff16148061100e575060ff8160ff16115b15611045576040517fc41630e200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61105060066115cd565b905061105c60066117a4565b5f60025f8381526020019081526020015f20905085815f015f6101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555084815f0160106101000a81548163ffffffff021916908363ffffffff16021790555083815f0160146101000a81548163ffffffff021916908363ffffffff16021790555082815f0160186101000a81548160ff021916908360ff1602179055505f8160010160146101000a81548160ff0219169083151502179055505f816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f815f0160196101000a81548160ff021916908360ff1602179055507fe7156d53e35bec76ac3212d41037e6d79cff1d7c78c4994042416634d8b48b3682878787876040516111ba959493929190611dbd565b60405180910390a1505050505050565b6111d26114f7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611242575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016112399190611b6d565b60405180910390fd5b61124b816116e3565b50565b61125661157e565b8061126160066115cd565b8110611299576040517f85761f7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025f8481526020019081526020015f2090505f429050815f0160149054906101000a900463ffffffff1663ffffffff168163ffffffff1611611309576040517fd571841a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010160149054906101000a900460ff1615611352576040517f841364aa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f825f0160199054906101000a900460ff1660ff160361139e576040517f8b6a473000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f448243855f0160199054906101000a900460ff1660ff166040516020016113c99493929190611e62565b604051602081830303815290604052805190602001205f1c90505f835f0160199054906101000a900460ff1660ff16826114039190611edc565b90505f60045f8881526020019081526020015f205f8360ff1660ff1681526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080856001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018560010160146101000a81548160ff0219169083151502179055507f7286599a58b2822d6e330944038c6d3424134069b04156404050720b942d87ee87826040516114de929190611f0c565b60405180910390a15050505050506114f461165b565b50565b6114ff6117b8565b73ffffffffffffffffffffffffffffffffffffffff1661151d610b9e565b73ffffffffffffffffffffffffffffffffffffffff161461157c576115406117b8565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016115739190611b6d565b60405180910390fd5b565b6002600154036115c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ba90611f8d565b60405180910390fd5b6002600181905550565b5f815f01549050919050565b611655848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161160e93929190611fab565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506117bf565b50505050565b60018081905550565b6116de838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611697929190611fe0565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506117bf565b505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001815f015f828254019250508190555050565b5f33905090565b5f5f60205f8451602086015f885af1806117de576040513d5f823e3d81fd5b3d92505f519150505f82146117f7576001811415611812565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561185457836040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161184b9190611b6d565b60405180910390fd5b50505050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6118878261185e565b9050919050565b6118978161187d565b81146118a1575f5ffd5b50565b5f813590506118b28161188e565b92915050565b5f602082840312156118cd576118cc61185a565b5b5f6118da848285016118a4565b91505092915050565b5f8115159050919050565b6118f7816118e3565b82525050565b5f6020820190506119105f8301846118ee565b92915050565b5f819050919050565b5f61193961193461192f8461185e565b611916565b61185e565b9050919050565b5f61194a8261191f565b9050919050565b5f61195b82611940565b9050919050565b61196b81611951565b82525050565b5f6020820190506119845f830184611962565b92915050565b5f819050919050565b61199c8161198a565b81146119a6575f5ffd5b50565b5f813590506119b781611993565b92915050565b5f5f604083850312156119d3576119d261185a565b5b5f6119e0858286016119a9565b92505060206119f1858286016118a4565b9150509250929050565b5f60208284031215611a1057611a0f61185a565b5b5f611a1d848285016119a9565b91505092915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b611a4a81611a26565b82525050565b5f63ffffffff82169050919050565b611a6881611a50565b82525050565b5f60ff82169050919050565b611a8381611a6e565b82525050565b611a928161187d565b82525050565b5f60e082019050611aab5f83018a611a41565b611ab86020830189611a5f565b611ac56040830188611a5f565b611ad26060830187611a7a565b611adf6080830186611a7a565b611aec60a0830185611a89565b611af960c08301846118ee565b98975050505050505050565b611b0e81611a26565b8114611b18575f5ffd5b50565b5f81359050611b2981611b05565b92915050565b5f5f60408385031215611b4557611b4461185a565b5b5f611b52858286016118a4565b9250506020611b6385828601611b1b565b9150509250929050565b5f602082019050611b805f830184611a89565b92915050565b611b8f81611a6e565b8114611b99575f5ffd5b50565b5f81359050611baa81611b86565b92915050565b5f5f60408385031215611bc657611bc561185a565b5b5f611bd3858286016119a9565b9250506020611be485828601611b9c565b9150509250929050565b5f60a082019050611c015f8301886118ee565b611c0e60208301876118ee565b611c1b60408301866118ee565b611c286060830185611a89565b611c356080830184611a7a565b9695505050505050565b611c4881611a50565b8114611c52575f5ffd5b50565b5f81359050611c6381611c3f565b92915050565b5f5f5f5f60808587031215611c8157611c8061185a565b5b5f611c8e87828801611b1b565b9450506020611c9f87828801611c55565b9350506040611cb087828801611c55565b9250506060611cc187828801611b9c565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611d0482611a6e565b915060ff8203611d1757611d16611ccd565b5b600182019050919050565b611d2b8161198a565b82525050565b5f606082019050611d445f830186611d22565b611d516020830185611a89565b611d5e6040830184611a7a565b949350505050565b5f611d80611d7b611d7684611a26565b611916565b61198a565b9050919050565b611d9081611d66565b82525050565b5f604082019050611da95f830185611a89565b611db66020830184611d87565b9392505050565b5f60a082019050611dd05f830188611d22565b611ddd6020830187611a41565b611dea6040830186611a5f565b611df76060830185611a5f565b611e046080830184611a7a565b9695505050505050565b5f819050919050565b611e28611e238261198a565b611e0e565b82525050565b5f8160e01b9050919050565b5f611e4482611e2e565b9050919050565b611e5c611e5782611a50565b611e3a565b82525050565b5f611e6d8287611e17565b602082019150611e7d8286611e4b565b600482019150611e8d8285611e17565b602082019150611e9d8284611e17565b60208201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611ee68261198a565b9150611ef18361198a565b925082611f0157611f00611eaf565b5b828206905092915050565b5f604082019050611f1f5f830185611d22565b611f2c6020830184611a89565b9392505050565b5f82825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f611f77601f83611f33565b9150611f8282611f43565b602082019050919050565b5f6020820190508181035f830152611fa481611f6b565b9050919050565b5f606082019050611fbe5f830186611a89565b611fcb6020830185611a89565b611fd86040830184611d22565b949350505050565b5f604082019050611ff35f830185611a89565b6120006020830184611d22565b939250505056fea2646970667358221220a63b7cd4489ebd73db86b11433184b925b69fa829ab71b702a54bc9113f4422564736f6c634300081e0033
Verified Source Code Full Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
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);
}
}
IERC1363.sol 86 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
IERC165.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";
IERC20.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @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;
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
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// 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;
}
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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);
}
SafeERC20.sol 212 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}
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;
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 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);
}
rugdollzraffles.sol 220 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract RugDollzRaffles is Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
using SafeERC20 for IERC20;
// Custom errors instead of require strings
error InvalidPaymentToken();
error NotWhitelistedCreator();
error RaffleDoesNotExist();
error TicketAlreadyPurchased();
error RaffleFull();
error RaffleNotEnded();
error WinnerAlreadyPicked();
error NoTicketsSold();
error UserIsNotParticipant();
error InvalidWinnerAddress();
error InvalidCreatorAddress();
error CreatorAlreadyWhitelisted();
error CreatorNotWhitelisted();
error InvalidAmount();
error InvalidTicketPrice();
error InvalidTimeRange();
error InvalidStartTime();
error InvalidMaxParticipants();
error RaffleNotActive();
error RaffleEnded();
error RaffleStillActive();
error NoParticipants();
// Immutable payment token
IERC20 public immutable paymentToken;
// Optimized struct layout without mappings
struct Raffle {
uint128 ticketPrice;
uint32 startTime;
uint32 endTime;
uint8 maxParticipants;
uint8 totalTickets;
address winner;
bool winnerPicked;
}
// Storage variables
mapping(uint256 => Raffle) public raffles;
mapping(uint256 => mapping(address => bool)) public hasTicket;
mapping(uint256 => mapping(uint8 => address)) public ticketOwners;
mapping(address => bool) public whitelistedCreators;
Counters.Counter private _raffleIds;
// Events - all fields are non-indexed to save gas
event RaffleCreated(
uint256 id,
uint128 ticketPrice,
uint32 startTime,
uint32 endTime,
uint8 maxParticipants
);
event TicketPurchased(uint256 raffleId, address buyer, uint8 ticketNumber);
event WinnerPicked(uint256 raffleId, address winner);
event CreatorWhitelisted(address creator);
event CreatorRemoved(address creator);
event TokensWithdrawn(address to, uint256 amount);
constructor(address _paymentToken) Ownable(msg.sender) {
if (_paymentToken == address(0)) revert InvalidPaymentToken();
paymentToken = IERC20(_paymentToken);
}
modifier onlyWhitelistedCreator() {
if (!whitelistedCreators[msg.sender]) revert NotWhitelistedCreator();
_;
}
modifier raffleExists(uint256 raffleId) {
if (raffleId >= _raffleIds.current())
revert RaffleDoesNotExist();
_;
}
function createRaffle(
uint128 ticketPrice, // Changed from uint256
uint32 startTime, // Changed from uint64
uint32 endTime, // Changed from uint64
uint8 maxParticipants // Changed from uint256
) external onlyWhitelistedCreator {
if (ticketPrice == 0) revert InvalidTicketPrice();
if (startTime >= endTime) revert InvalidTimeRange();
if (startTime < block.timestamp) revert InvalidStartTime();
if (maxParticipants == 0 || maxParticipants > 255) revert InvalidMaxParticipants();
uint256 raffleId = _raffleIds.current();
_raffleIds.increment();
Raffle storage newRaffle = raffles[raffleId];
newRaffle.ticketPrice = ticketPrice;
newRaffle.startTime = startTime;
newRaffle.endTime = endTime;
newRaffle.maxParticipants = maxParticipants;
newRaffle.winnerPicked = false;
newRaffle.winner = address(0);
newRaffle.totalTickets = 0;
emit RaffleCreated(raffleId, ticketPrice, startTime, endTime, maxParticipants);
}
function userHasTicket(uint256 raffleId, address user) external view returns (bool) {
return hasTicket[raffleId][user];
}
function buyTicket(uint256 raffleId) external nonReentrant raffleExists(raffleId) {
// Store the check result in a local variable first
bool userAlreadyHasTicket = hasTicket[raffleId][msg.sender];
if (userAlreadyHasTicket) revert TicketAlreadyPurchased();
Raffle storage raffle = raffles[raffleId];
uint32 currentTime = uint32(block.timestamp);
if (currentTime < raffle.startTime || currentTime > raffle.endTime) revert RaffleNotActive();
if (raffle.winnerPicked) revert RaffleEnded();
if (raffle.totalTickets >= raffle.maxParticipants) revert RaffleFull();
// Transfer tokens
paymentToken.safeTransferFrom(msg.sender, address(this), raffle.ticketPrice);
// Update state
uint8 ticketNumber = raffle.totalTickets;
ticketOwners[raffleId][ticketNumber] = msg.sender; // Updated mapping access
hasTicket[raffleId][msg.sender] = true; // Updated mapping access
raffle.totalTickets++;
emit TicketPurchased(raffleId, msg.sender, ticketNumber);
}
function pickWinner(uint256 raffleId) external nonReentrant raffleExists(raffleId) {
Raffle storage raffle = raffles[raffleId];
uint32 currentTime = uint32(block.timestamp);
if (currentTime <= raffle.endTime) revert RaffleStillActive();
if (raffle.winnerPicked) revert WinnerAlreadyPicked();
if (raffle.totalTickets == 0) revert NoParticipants();
uint256 randomNumber = uint256(
keccak256(
abi.encodePacked(
block.prevrandao,
currentTime,
block.number,
uint256(raffle.totalTickets)
)
)
);
uint8 winnerIndex = uint8(randomNumber % uint256(raffle.totalTickets));
address winner = ticketOwners[raffleId][winnerIndex]; // Updated mapping access
raffle.winner = winner;
raffle.winnerPicked = true;
emit WinnerPicked(raffleId, winner);
}
// View functions
function getRaffleStatus(
uint256 raffleId
)
external
view
raffleExists(raffleId)
returns (
bool isActive,
bool hasEnded,
bool winnerPicked,
address winner,
uint8 totalTickets
)
{
Raffle storage raffle = raffles[raffleId];
uint32 currentTime = uint32(block.timestamp);
return (
currentTime >= raffle.startTime && currentTime <= raffle.endTime,
currentTime > raffle.endTime,
raffle.winnerPicked,
raffle.winner,
raffle.totalTickets
);
}
// Admin functions
function whitelistCreator(address creator) external onlyOwner {
if (creator == address(0)) revert InvalidCreatorAddress();
if (whitelistedCreators[creator]) revert CreatorAlreadyWhitelisted();
whitelistedCreators[creator] = true;
emit CreatorWhitelisted(creator);
}
function removeCreator(address creator) external onlyOwner {
if (creator == address(0)) revert InvalidCreatorAddress();
if (!whitelistedCreators[creator]) revert CreatorNotWhitelisted();
whitelistedCreators[creator] = false;
emit CreatorRemoved(creator);
}
function withdrawTokens(address to, uint128 amount) external onlyOwner {
if (to == address(0)) revert InvalidCreatorAddress();
if (amount == 0) revert InvalidAmount();
paymentToken.safeTransfer(to, amount);
emit TokensWithdrawn(to, amount);
}
}
Read Contract
getRaffleStatus 0xd1ce754e → bool, bool, bool, address, uint8
hasTicket 0x4843d2b1 → bool
owner 0x8da5cb5b → address
paymentToken 0x3013ce29 → address
raffles 0x5d4bc0ce → uint128, uint32, uint32, uint8, uint8, address, bool
ticketOwners 0xc7fa1329 → address
userHasTicket 0x4465e60e → bool
whitelistedCreators 0x041bb6ff → bool
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
buyTicket 0x67dd74ca
uint256 raffleId
createRaffle 0xe4b4da3d
uint128 ticketPrice
uint32 startTime
uint32 endTime
uint8 maxParticipants
pickWinner 0xf737d21d
uint256 raffleId
removeCreator 0xbd6018bb
address creator
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
whitelistCreator 0x62f11dd2
address creator
withdrawTokens 0x6de27c67
address to
uint128 amount
Recent Transactions
No transactions found for this address