More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 34 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Code | 48545841 | 430 days ago | IN | 0 POL | 0.00709977 | ||||
Create Code | 47329034 | 460 days ago | IN | 0 POL | 0.01233092 | ||||
Create Code | 45604445 | 504 days ago | IN | 0 POL | 0.00793334 | ||||
Create Code | 45604217 | 504 days ago | IN | 0 POL | 0.00814313 | ||||
Create Code | 44387594 | 535 days ago | IN | 0 POL | 0.01354548 | ||||
Create Code | 43829520 | 549 days ago | IN | 0 POL | 0.03974215 | ||||
Create Code | 43747852 | 551 days ago | IN | 0 POL | 0.01697585 | ||||
Create Code | 43131361 | 567 days ago | IN | 0 POL | 0.01931239 | ||||
Set Referral Cod... | 42728214 | 578 days ago | IN | 0 POL | 0.00826743 | ||||
Set Referral Cod... | 42727706 | 578 days ago | IN | 0 POL | 0.00998669 | ||||
Set Referral Cod... | 42727501 | 578 days ago | IN | 0 POL | 0.00463608 | ||||
Set Referral Cod... | 42727352 | 578 days ago | IN | 0 POL | 0.00826939 | ||||
Create Code | 42653006 | 579 days ago | IN | 0 POL | 0.01671097 | ||||
Create Code | 42652768 | 579 days ago | IN | 0 POL | 0.01384569 | ||||
Set Referral Cod... | 42604765 | 581 days ago | IN | 0 POL | 0.0047433 | ||||
Create Code | 42604659 | 581 days ago | IN | 0 POL | 0.01403941 | ||||
Transfer Ownersh... | 42587553 | 581 days ago | IN | 0 POL | 0.00516428 | ||||
Create Code | 42587469 | 581 days ago | IN | 0 POL | 0.01631524 | ||||
Create Code | 42587210 | 581 days ago | IN | 0 POL | 0.0147171 | ||||
Create Code | 42587190 | 581 days ago | IN | 0 POL | 0.01440064 | ||||
Create Code | 42587175 | 581 days ago | IN | 0 POL | 0.01401569 | ||||
Create Code | 42586620 | 581 days ago | IN | 0 POL | 0.01280618 | ||||
Create Code | 42583006 | 581 days ago | IN | 0 POL | 0.01818822 | ||||
Create Code | 42577039 | 581 days ago | IN | 0 POL | 0.01793475 | ||||
Set Referral Cod... | 42575521 | 581 days ago | IN | 0 POL | 0.00919008 |
Loading...
Loading
Contract Name:
Referral
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 5000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../utils/Ownable.sol"; abstract contract ReferralEvents { event UpdateGame(address game, bool state); event CreateReferralCode( address player, uint256 referralId, string referralCode ); event UpdateCommission(uint256 referralId, uint256 commission); event UpdateReferralCodeByUser(address player, string code); } contract Referral is ReferralEvents, Ownable { using SafeERC20 for IERC20; mapping(address => bool) enabledGames; mapping(address => uint256) public usedReferralCodes; uint256 public ids; mapping(string => uint256) public referralIds; mapping(uint256 => string) public referralCodes; mapping(uint256 => address) public referralOwner; //to calculate downlines off-chain we need a commission to start with. mapping(uint256 => uint256) public baseCommissions; constructor() {} function createCode(string calldata code) public { require(referralIds[code] == 0, "code already taken"); ++ids; referralCodes[ids] = code; referralIds[code] = ids; referralOwner[ids] = msg.sender; emit CreateReferralCode(msg.sender, ids, code); } function setBaseCommissions( uint256[] calldata _referralIds, uint256[] calldata _commissions ) public onlyOwner { require(_referralIds.length == _commissions.length, "invalid arrays"); for (uint256 index = 0; index < _referralIds.length; index++) { baseCommissions[_referralIds[index]] = _commissions[index]; emit UpdateCommission(_referralIds[index], _commissions[index]); } } function updateUser(address player, uint256 referralId) public { if ( (referralId == 0) || (enabledGames[msg.sender] == false) || (usedReferralCodes[player] != 0) ) { return; } usedReferralCodes[player] = referralId; } function setReferralCodeByUser(string memory code) external { require(referralIds[code] != 0, "code id is 0"); usedReferralCodes[msg.sender] = referralIds[code]; emit UpdateReferralCodeByUser(msg.sender, code); } function getCodeId( string memory code, address player ) external view returns (uint256) { if (usedReferralCodes[player] != 0) return usedReferralCodes[player]; return referralIds[code]; } function toggleGames( address[] calldata games, bool[] calldata toggles ) external onlyOwner { require(games.length == toggles.length, "invalid arrays"); for (uint256 index = 0; index < games.length; index++) { enabledGames[games[index]] = toggles[index]; emit UpdateGame(games[index], toggles[index]); } } function recoverToken(address token, uint256 amount) external onlyOwner { IERC20(token).transfer(msg.sender, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 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 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // 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(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev basic openzeppelin implementation without _msgSender() and Context. */ abstract contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(msg.sender); } /** * @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 { require(owner() == msg.sender, "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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); } }
{ "remappings": [ "@chainlink/=node_modules/@chainlink/", "@gelatonetwork/=node_modules/@gelatonetwork/", "@openzeppelin/=node_modules/@openzeppelin/", "@uniswap/=node_modules/@uniswap/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 5000 }, "metadata": { "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"referralId","type":"uint256"},{"indexed":false,"internalType":"string","name":"referralCode","type":"string"}],"name":"CreateReferralCode","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"referralId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"commission","type":"uint256"}],"name":"UpdateCommission","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"game","type":"address"},{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"UpdateGame","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"string","name":"code","type":"string"}],"name":"UpdateReferralCodeByUser","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"baseCommissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"}],"name":"createCode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"},{"internalType":"address","name":"player","type":"address"}],"name":"getCodeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ids","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"referralCodes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"referralIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"referralOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_referralIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_commissions","type":"uint256[]"}],"name":"setBaseCommissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"}],"name":"setReferralCodeByUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"games","type":"address[]"},{"internalType":"bool[]","name":"toggles","type":"bool[]"}],"name":"toggleGames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"referralId","type":"uint256"}],"name":"updateUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usedReferralCodes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6112168061007e6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a980def211610097578063e7657e1511610066578063e7657e1514610281578063e893ceba1461028a578063ebb9c5ab1461029d578063f2fde38b146102b057600080fd5b8063a980def21461021b578063afbcb2691461022e578063b29a81401461024e578063e5da6b801461026157600080fd5b80635112d04c116100d35780635112d04c1461018b578063715018a61461019e5780638da5cb5b146101a6578063a7fba828146101e557600080fd5b80631350db0c146101055780632d2fe8041461014357806337b1f2ab146101585780633e7629a114610178575b600080fd5b610130610113366004610c73565b805160208183018101805160048252928201919093012091525481565b6040519081526020015b60405180910390f35b610156610151366004610cb0565b6102c3565b005b610130610166366004610d4b565b60026020526000908152604090205481565b610156610186366004610c73565b61040d565b610130610199366004610d6d565b6104e7565b610156610566565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161013a565b6101c06101f3366004610dbb565b60066020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b610156610229366004610dd4565b61057a565b61024161023c366004610dbb565b6105f8565b60405161013a9190610e4e565b61015661025c366004610dd4565b610692565b61013061026f366004610dbb565b60076020526000908152604090205481565b61013060035481565b610156610298366004610ead565b610736565b6101566102ab366004610ead565b61086b565b6101566102be366004610d4b565b610a22565b600482826040516102d5929190610f19565b9081526020016040518091039020546000146103385760405162461bcd60e51b815260206004820152601260248201527f636f646520616c72656164792074616b656e000000000000000000000000000060448201526064015b60405180910390fd5b60036000815461034790610f29565b90915550600354600090815260056020526040902061036782848361100b565b506003546004838360405161037d929190610f19565b908152604080516020928190038301812093909355600380546000908152600690935291208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915590547f3e3f215fb454dad7cc9dc55453b5d146a0cfd73af67a3c51a867e50d9b3b154b92610401929190869086906110cb565b60405180910390a15050565b60048160405161041d919061111e565b90815260200160405180910390205460000361047b5760405162461bcd60e51b815260206004820152600c60248201527f636f646520696420697320300000000000000000000000000000000000000000604482015260640161032f565b60048160405161048b919061111e565b90815260408051918290036020908101832054336000818152600290935292909120557f44f0894c3362ee8223b182dfd2d85fe0f81066983f573dd880f33c016d6e53be916104dc9190849061113a565b60405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600260205260408120541561053e575073ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054610560565b60048360405161054e919061111e565b90815260200160405180910390205490505b92915050565b61056e610abf565b6105786000610b42565b565b80158061059757503360009081526001602052604090205460ff16155b806105c6575073ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205415155b156105cf575050565b73ffffffffffffffffffffffffffffffffffffffff909116600090815260026020526040902055565b6005602052600090815260409020805461061190610f6a565b80601f016020809104026020016040519081016040528092919081815260200182805461063d90610f6a565b801561068a5780601f1061065f5761010080835404028352916020019161068a565b820191906000526020600020905b81548152906001019060200180831161066d57829003601f168201915b505050505081565b61069a610abf565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081523360048201526024810182905273ffffffffffffffffffffffffffffffffffffffff83169063a9059cbb906044016020604051808303816000875af115801561070d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107319190611177565b505050565b61073e610abf565b82811461078d5760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420617272617973000000000000000000000000000000000000604482015260640161032f565b60005b83811015610864578282828181106107aa576107aa611194565b90506020020135600760008787858181106107c7576107c7611194565b905060200201358152602001908152602001600020819055507f0c77380d0b73c79a1f7ca53f0f9aae872bc5e0e86132ff08a539c02b8726c63685858381811061081357610813611194565b9050602002013584848481811061082c5761082c611194565b9050602002013560405161084a929190918252602082015260400190565b60405180910390a18061085c81610f29565b915050610790565b5050505050565b610873610abf565b8281146108c25760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420617272617973000000000000000000000000000000000000604482015260640161032f565b60005b83811015610864578282828181106108df576108df611194565b90506020020160208101906108f491906111c3565b6001600087878581811061090a5761090a611194565b905060200201602081019061091f9190610d4b565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557fe2c3cb67eba3dd113d118915c423dbc8b96670c4bcab1ede2b906df689591f8f8585838181106109a5576109a5611194565b90506020020160208101906109ba9190610d4b565b8484848181106109cc576109cc611194565b90506020020160208101906109e191906111c3565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835290151560208301520160405180910390a180610a1a81610f29565b9150506108c5565b610a2a610abf565b73ffffffffffffffffffffffffffffffffffffffff8116610ab35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161032f565b610abc81610b42565b50565b33610adf60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146105785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161032f565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610bf757600080fd5b813567ffffffffffffffff80821115610c1257610c12610bb7565b604051601f8301601f19908116603f01168101908282118183101715610c3a57610c3a610bb7565b81604052838152866020858801011115610c5357600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215610c8557600080fd5b813567ffffffffffffffff811115610c9c57600080fd5b610ca884828501610be6565b949350505050565b60008060208385031215610cc357600080fd5b823567ffffffffffffffff80821115610cdb57600080fd5b818501915085601f830112610cef57600080fd5b813581811115610cfe57600080fd5b866020828501011115610d1057600080fd5b60209290920196919550909350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610d4657600080fd5b919050565b600060208284031215610d5d57600080fd5b610d6682610d22565b9392505050565b60008060408385031215610d8057600080fd5b823567ffffffffffffffff811115610d9757600080fd5b610da385828601610be6565b925050610db260208401610d22565b90509250929050565b600060208284031215610dcd57600080fd5b5035919050565b60008060408385031215610de757600080fd5b610df083610d22565b946020939093013593505050565b60005b83811015610e19578181015183820152602001610e01565b50506000910152565b60008151808452610e3a816020860160208601610dfe565b601f01601f19169290920160200192915050565b602081526000610d666020830184610e22565b60008083601f840112610e7357600080fd5b50813567ffffffffffffffff811115610e8b57600080fd5b6020830191508360208260051b8501011115610ea657600080fd5b9250929050565b60008060008060408587031215610ec357600080fd5b843567ffffffffffffffff80821115610edb57600080fd5b610ee788838901610e61565b90965094506020870135915080821115610f0057600080fd5b50610f0d87828801610e61565b95989497509550505050565b8183823760009101908152919050565b60006000198203610f63577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600181811c90821680610f7e57607f821691505b602082108103610fb7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561073157600081815260208120601f850160051c81016020861015610fe45750805b601f850160051c820191505b8181101561100357828155600101610ff0565b505050505050565b67ffffffffffffffff83111561102357611023610bb7565b611037836110318354610f6a565b83610fbd565b6000601f84116001811461106b57600085156110535750838201355b600019600387901b1c1916600186901b178355610864565b600083815260209020601f19861690835b8281101561109c578685013582556020948501946001909201910161107c565b50868210156110b95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b60008251611130818460208701610dfe565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000610ca86040830184610e22565b8015158114610abc57600080fd5b60006020828403121561118957600080fd5b8151610d6681611169565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156111d557600080fd5b8135610d668161116956fea26469706673582212202c35a8c4e0a349ca3ea2f368cf80abb3fd1618653723515af5abb070e95efa7464736f6c63430008130033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a980def211610097578063e7657e1511610066578063e7657e1514610281578063e893ceba1461028a578063ebb9c5ab1461029d578063f2fde38b146102b057600080fd5b8063a980def21461021b578063afbcb2691461022e578063b29a81401461024e578063e5da6b801461026157600080fd5b80635112d04c116100d35780635112d04c1461018b578063715018a61461019e5780638da5cb5b146101a6578063a7fba828146101e557600080fd5b80631350db0c146101055780632d2fe8041461014357806337b1f2ab146101585780633e7629a114610178575b600080fd5b610130610113366004610c73565b805160208183018101805160048252928201919093012091525481565b6040519081526020015b60405180910390f35b610156610151366004610cb0565b6102c3565b005b610130610166366004610d4b565b60026020526000908152604090205481565b610156610186366004610c73565b61040d565b610130610199366004610d6d565b6104e7565b610156610566565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161013a565b6101c06101f3366004610dbb565b60066020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b610156610229366004610dd4565b61057a565b61024161023c366004610dbb565b6105f8565b60405161013a9190610e4e565b61015661025c366004610dd4565b610692565b61013061026f366004610dbb565b60076020526000908152604090205481565b61013060035481565b610156610298366004610ead565b610736565b6101566102ab366004610ead565b61086b565b6101566102be366004610d4b565b610a22565b600482826040516102d5929190610f19565b9081526020016040518091039020546000146103385760405162461bcd60e51b815260206004820152601260248201527f636f646520616c72656164792074616b656e000000000000000000000000000060448201526064015b60405180910390fd5b60036000815461034790610f29565b90915550600354600090815260056020526040902061036782848361100b565b506003546004838360405161037d929190610f19565b908152604080516020928190038301812093909355600380546000908152600690935291208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915590547f3e3f215fb454dad7cc9dc55453b5d146a0cfd73af67a3c51a867e50d9b3b154b92610401929190869086906110cb565b60405180910390a15050565b60048160405161041d919061111e565b90815260200160405180910390205460000361047b5760405162461bcd60e51b815260206004820152600c60248201527f636f646520696420697320300000000000000000000000000000000000000000604482015260640161032f565b60048160405161048b919061111e565b90815260408051918290036020908101832054336000818152600290935292909120557f44f0894c3362ee8223b182dfd2d85fe0f81066983f573dd880f33c016d6e53be916104dc9190849061113a565b60405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600260205260408120541561053e575073ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054610560565b60048360405161054e919061111e565b90815260200160405180910390205490505b92915050565b61056e610abf565b6105786000610b42565b565b80158061059757503360009081526001602052604090205460ff16155b806105c6575073ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205415155b156105cf575050565b73ffffffffffffffffffffffffffffffffffffffff909116600090815260026020526040902055565b6005602052600090815260409020805461061190610f6a565b80601f016020809104026020016040519081016040528092919081815260200182805461063d90610f6a565b801561068a5780601f1061065f5761010080835404028352916020019161068a565b820191906000526020600020905b81548152906001019060200180831161066d57829003601f168201915b505050505081565b61069a610abf565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081523360048201526024810182905273ffffffffffffffffffffffffffffffffffffffff83169063a9059cbb906044016020604051808303816000875af115801561070d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107319190611177565b505050565b61073e610abf565b82811461078d5760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420617272617973000000000000000000000000000000000000604482015260640161032f565b60005b83811015610864578282828181106107aa576107aa611194565b90506020020135600760008787858181106107c7576107c7611194565b905060200201358152602001908152602001600020819055507f0c77380d0b73c79a1f7ca53f0f9aae872bc5e0e86132ff08a539c02b8726c63685858381811061081357610813611194565b9050602002013584848481811061082c5761082c611194565b9050602002013560405161084a929190918252602082015260400190565b60405180910390a18061085c81610f29565b915050610790565b5050505050565b610873610abf565b8281146108c25760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420617272617973000000000000000000000000000000000000604482015260640161032f565b60005b83811015610864578282828181106108df576108df611194565b90506020020160208101906108f491906111c3565b6001600087878581811061090a5761090a611194565b905060200201602081019061091f9190610d4b565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557fe2c3cb67eba3dd113d118915c423dbc8b96670c4bcab1ede2b906df689591f8f8585838181106109a5576109a5611194565b90506020020160208101906109ba9190610d4b565b8484848181106109cc576109cc611194565b90506020020160208101906109e191906111c3565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835290151560208301520160405180910390a180610a1a81610f29565b9150506108c5565b610a2a610abf565b73ffffffffffffffffffffffffffffffffffffffff8116610ab35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161032f565b610abc81610b42565b50565b33610adf60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146105785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161032f565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610bf757600080fd5b813567ffffffffffffffff80821115610c1257610c12610bb7565b604051601f8301601f19908116603f01168101908282118183101715610c3a57610c3a610bb7565b81604052838152866020858801011115610c5357600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215610c8557600080fd5b813567ffffffffffffffff811115610c9c57600080fd5b610ca884828501610be6565b949350505050565b60008060208385031215610cc357600080fd5b823567ffffffffffffffff80821115610cdb57600080fd5b818501915085601f830112610cef57600080fd5b813581811115610cfe57600080fd5b866020828501011115610d1057600080fd5b60209290920196919550909350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610d4657600080fd5b919050565b600060208284031215610d5d57600080fd5b610d6682610d22565b9392505050565b60008060408385031215610d8057600080fd5b823567ffffffffffffffff811115610d9757600080fd5b610da385828601610be6565b925050610db260208401610d22565b90509250929050565b600060208284031215610dcd57600080fd5b5035919050565b60008060408385031215610de757600080fd5b610df083610d22565b946020939093013593505050565b60005b83811015610e19578181015183820152602001610e01565b50506000910152565b60008151808452610e3a816020860160208601610dfe565b601f01601f19169290920160200192915050565b602081526000610d666020830184610e22565b60008083601f840112610e7357600080fd5b50813567ffffffffffffffff811115610e8b57600080fd5b6020830191508360208260051b8501011115610ea657600080fd5b9250929050565b60008060008060408587031215610ec357600080fd5b843567ffffffffffffffff80821115610edb57600080fd5b610ee788838901610e61565b90965094506020870135915080821115610f0057600080fd5b50610f0d87828801610e61565b95989497509550505050565b8183823760009101908152919050565b60006000198203610f63577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600181811c90821680610f7e57607f821691505b602082108103610fb7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561073157600081815260208120601f850160051c81016020861015610fe45750805b601f850160051c820191505b8181101561100357828155600101610ff0565b505050505050565b67ffffffffffffffff83111561102357611023610bb7565b611037836110318354610f6a565b83610fbd565b6000601f84116001811461106b57600085156110535750838201355b600019600387901b1c1916600186901b178355610864565b600083815260209020601f19861690835b8281101561109c578685013582556020948501946001909201910161107c565b50868210156110b95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b60008251611130818460208701610dfe565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000610ca86040830184610e22565b8015158114610abc57600080fd5b60006020828403121561118957600080fd5b8151610d6681611169565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156111d557600080fd5b8135610d668161116956fea26469706673582212202c35a8c4e0a349ca3ea2f368cf80abb3fd1618653723515af5abb070e95efa7464736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.