Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
WhitelistRegistry
Compiler Version
v0.8.24+commit.e11b9ed9
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract WhitelistRegistry is Ownable { // The authorized frontend contract address address public frontendContract; // Mapping to store whitelisted addresses mapping(address => bool) public whitelistedAddresses; // Events event AddressWhitelisted(address indexed userAddress); event AddressRemoved(address indexed userAddress); event FrontendContractUpdated(address indexed newFrontendContract); constructor() Ownable(msg.sender) {} modifier onlyFrontend() { require(msg.sender == frontendContract, "Caller is not the frontend contract"); _; } // Function to set the frontend contract address function setFrontendContract(address _frontendContract) external onlyOwner { require(_frontendContract != address(0), "Invalid address"); frontendContract = _frontendContract; emit FrontendContractUpdated(_frontendContract); } // Function for frontend to submit a user's address function submitAddress(address userAddress) external onlyFrontend { require(userAddress != address(0), "Invalid address"); require(!whitelistedAddresses[userAddress], "Address already whitelisted"); whitelistedAddresses[userAddress] = true; emit AddressWhitelisted(userAddress); } // Function for owner to add multiple addresses at once function addAddressesBulk(address[] calldata addresses) external onlyOwner { for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != address(0), "Invalid address in array"); if (!whitelistedAddresses[addresses[i]]) { whitelistedAddresses[addresses[i]] = true; emit AddressWhitelisted(addresses[i]); } } } // Function to remove a single address function removeAddress(address userAddress) external onlyOwner { require(whitelistedAddresses[userAddress], "Address not whitelisted"); whitelistedAddresses[userAddress] = false; emit AddressRemoved(userAddress); } // Function to remove multiple addresses at once function removeAddressesBulk(address[] calldata addresses) external onlyOwner { for (uint i = 0; i < addresses.length; i++) { if (whitelistedAddresses[addresses[i]]) { whitelistedAddresses[addresses[i]] = false; emit AddressRemoved(addresses[i]); } } } // Function to check if an address is whitelisted function isWhitelisted(address userAddress) external view returns (bool) { return whitelistedAddresses[userAddress]; } }
// 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); } }
// 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; } }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": false, "libraries": {} }
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"}],"name":"AddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"}],"name":"AddressWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newFrontendContract","type":"address"}],"name":"FrontendContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"addAddressesBulk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"frontendContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"removeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"removeAddressesBulk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_frontendContract","type":"address"}],"name":"setFrontendContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"submitAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
9c4d535b0000000000000000000000000000000000000000000000000000000000000000010000c309f7a892d40ae446db8a0fbd3c624450bfaa581376ef009cce5d6c4900000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x0001000000000002000400000000000200000000000103550000008003000039000000400030043f00000001002001900000001d0000c13d00000060021002700000009a02200197000000040020008c0000022d0000413d000000000301043b000000e003300270000000a00030009c0000003d0000a13d000000a10030009c0000006d0000213d000000a50030009c000001570000613d000000a60030009c0000016b0000613d000000a70030009c0000022d0000c13d0000000001000416000000000001004b0000022d0000c13d0000000101000039000000000101041a0000016f0000013d0000000001000416000000000001004b0000022d0000c13d0000000006000411000000000006004b000000280000c13d000000b601000041000000800010043f000000840000043f000000b0010000410000026400010430000000000100041a0000009b02100197000000000262019f000000000020041b00000000020004140000009c051001970000009a0020009c0000009a02008041000000c0012002100000009d011001c70000800d0200003900000003030000390000009e04000041026202580000040f00000001002001900000022d0000613d0000002001000039000001000010044300000120000004430000009f01000041000002630001042e000000a80030009c000000da0000a13d000000a90030009c000001730000613d000000aa0030009c000001420000613d000000ab0030009c0000022d0000c13d000000240020008c0000022d0000413d0000000002000416000000000002004b0000022d0000c13d0000000401100370000000000101043b0000009c0010009c0000022d0000213d000000000200041a0000009c032001970000000002000411000000000023004b000001cd0000c13d0000009c01100197000400000001001d000000000010043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d0000000402000029000000000101043b000000000101041a000000ff001001900000020f0000c13d000000400100043d0000004402100039000000bd03000041000000000032043500000024021000390000001703000039000002350000013d000000a20030009c000001910000613d000000a30030009c000001ac0000613d000000a40030009c0000022d0000c13d000000240020008c0000022d0000413d0000000003000416000000000003004b0000022d0000c13d0000000403100370000000000303043b000000ae0030009c0000022d0000213d0000002304300039000000000024004b0000022d0000813d0000000404300039000000000141034f000000000101043b000200000001001d000000ae0010009c0000022d0000213d000100240030003d000000020100002900000005011002100000000101100029000000000021004b0000022d0000213d000000000100041a0000009c021001970000000001000411000000000012004b000001de0000c13d000000020000006b0000022b0000613d000400000000001d000000990000013d00000004020000290000000102200039000400000002001d000000020020006c0000022b0000813d000000040100002900000005011002100000000101100029000300000001001d0000000001100367000000000101043b0000009c0010009c0000022d0000213d000000000001004b000002400000613d000000000010043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000101041a000000ff00100190000000940000c13d00000003010000290000000001100367000000000101043b0000009c0010009c0000022d0000213d000000000010043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000201041a000000c10220019700000001022001bf000000000021041b00000003010000290000000001100367000000000501043b0000009c0050009c0000022d0000213d00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d020000390000000203000039000000b204000041026202580000040f0000000100200190000000940000c13d0000022d0000013d000000ac0030009c000001420000613d000000ad0030009c0000022d0000c13d000000240020008c0000022d0000413d0000000003000416000000000003004b0000022d0000c13d0000000403100370000000000303043b000000ae0030009c0000022d0000213d0000002304300039000000000024004b0000022d0000813d0000000404300039000000000141034f000000000101043b000200000001001d000000ae0010009c0000022d0000213d000100240030003d000000020100002900000005011002100000000101100029000000000021004b0000022d0000213d000000000100041a0000009c021001970000000001000411000000000012004b000001de0000c13d000000020000006b0000022b0000613d000400000000001d000001040000013d00000004020000290000000102200039000400000002001d000000020020006c0000022b0000813d000000040100002900000005011002100000000101100029000300000001001d0000000001100367000000000101043b0000009c0010009c0000022d0000213d000000000010043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000101041a000000ff00100190000000ff0000613d00000003010000290000000001100367000000000101043b0000009c0010009c0000022d0000213d000000000010043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000201041a000000c102200197000000000021041b00000003010000290000000001100367000000000501043b0000009c0050009c0000022d0000213d00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d020000390000000203000039000000bc04000041026202580000040f0000000100200190000000ff0000c13d0000022d0000013d000000240020008c0000022d0000413d0000000002000416000000000002004b0000022d0000c13d0000000401100370000000000101043b0000009c0010009c0000022d0000213d000000000010043f0000000201000039000000200010043f0000000001000019026202470000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f000000bb01000041000002630001042e0000000001000416000000000001004b0000022d0000c13d000000000100041a0000009c021001970000000005000411000000000052004b000001c80000c13d0000009b01100197000000000010041b00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d0200003900000003030000390000009e040000410000000006000019000002280000013d0000000001000416000000000001004b0000022d0000c13d000000000100041a0000009c01100197000000800010043f000000bb01000041000002630001042e000000240020008c0000022d0000413d0000000002000416000000000002004b0000022d0000c13d0000000401100370000000000101043b0000009c0010009c0000022d0000213d000000000200041a0000009c032001970000000002000411000000000023004b000001cd0000c13d0000009c05100198000001a20000613d0000000101000039000000000201041a0000009b02200197000000000252019f000000000021041b00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d020000390000000203000039000000be04000041000002280000013d000000240020008c0000022d0000413d0000000002000416000000000002004b0000022d0000c13d0000000401100370000000000101043b0000009c0010009c0000022d0000213d0000000102000039000000000202041a0000009c022001970000000003000411000000000023004b000001d20000c13d0000009c03100198000001e30000c13d000000b401000041000000800010043f0000002001000039000000840010043f0000000f01000039000000a40010043f000000bf01000041000000c40010043f000000c0010000410000026400010430000000240020008c0000022d0000413d0000000002000416000000000002004b0000022d0000c13d0000000401100370000000000101043b0000009c0010009c0000022d0000213d000000000200041a0000009c032001970000000005000411000000000053004b000001c80000c13d0000009c06100198000000230000613d0000009b01200197000000000161019f000000000010041b00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d0200003900000003030000390000009e04000041000002280000013d000000af01000041000000800010043f000000840050043f000000b0010000410000026400010430000000af01000041000000800010043f000000840020043f000000b0010000410000026400010430000000b401000041000000800010043f0000002001000039000000840010043f0000002301000039000000a40010043f000000b701000041000000c40010043f000000b801000041000000e40010043f000000b9010000410000026400010430000000af02000041000000800020043f000000840010043f000000b0010000410000026400010430000000000030043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c70000801002000039000400000003001d0262025d0000040f00000001002001900000022d0000613d0000000402000029000000000101043b000000000101041a000000ff001001900000022f0000c13d000000000020043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000201041a000000c10220019700000001022001bf000000000021041b00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d020000390000000203000039000000b204000041000002270000013d000000000020043f0000000201000039000000200010043f00000000010004140000009a0010009c0000009a01008041000000c001100210000000b1011001c700008010020000390262025d0000040f00000001002001900000022d0000613d000000000101043b000000000201041a000000c102200197000000000021041b00000000010004140000009a0010009c0000009a01008041000000c0011002100000009d011001c70000800d020000390000000203000039000000bc040000410000000405000029026202580000040f00000001002001900000022d0000613d0000000001000019000002630001042e00000000010000190000026400010430000000400100043d0000004402100039000000ba03000041000000000032043500000024021000390000001b030000390000000000320435000000b40200004100000000002104350000000402100039000000200300003900000000003204350000009a0010009c0000009a010080410000004001100210000000b5011001c70000026400010430000000400100043d0000004402100039000000b303000041000000000032043500000024021000390000001803000039000002350000013d00000000020004140000009a0020009c0000009a02008041000000c0022002100000009a0010009c0000009a010080410000004001100210000000000121019f000000b1011001c700008010020000390262025d0000040f0000000100200190000002560000613d000000000101043b000000000001042d000000000100001900000264000104300000025b002104210000000102000039000000000001042d0000000002000019000000000001042d00000260002104230000000102000039000000000001042d0000000002000019000000000001042d0000026200000432000002630001042e000002640001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff02000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000715018a500000000000000000000000000000000000000000000000000000000ef97ba3800000000000000000000000000000000000000000000000000000000ef97ba3900000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000fd4ce34900000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000b1f665e0000000000000000000000000000000000000000000000000000000002502ad18000000000000000000000000000000000000000000000000000000002502ad19000000000000000000000000000000000000000000000000000000003af32abf000000000000000000000000000000000000000000000000000000004ba79dfe0000000000000000000000000000000000000000000000000000000006c933d800000000000000000000000000000000000000000000000000000000090a1c18000000000000000000000000000000000000000000000000ffffffffffffffff118cdaa700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000080000000000000000002000000000000000000000000000000000000400000000000000000000000004f783c179409b4127238bc9c990bc99b9a651666a0d20b51d6c42849eb88466d496e76616c6964206164647265737320696e206172726179000000000000000008c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000001e4fbdf70000000000000000000000000000000000000000000000000000000043616c6c6572206973206e6f74207468652066726f6e74656e6420636f6e7472616374000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000840000008000000000000000004164647265737320616c72656164792077686974656c69737465640000000000000000000000000000000000000000000000002000000080000000000000000024a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb41646472657373206e6f742077686974656c6973746564000000000000000000501de82d3e4e18cd1ebccc740aa5d59a060e2e767ffbad1ef9210d29698b7ebc496e76616c6964206164647265737300000000000000000000000000000000000000000000000000000000000000000000000064000000800000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009fecafacf7c5f04936eb6138675bde09f8ac4982734bdceb169f06d2ab9ca782
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.