Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Latest 8 from a total of 8 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Emit Event | 1385374 | 6 days ago | IN | 0 S | 0.00003084 | ||||
Transfer Ownersh... | 546043 | 12 days ago | IN | 0 S | 0.00003282 | ||||
Authorize | 545995 | 12 days ago | IN | 0 S | 0.00010172 | ||||
Authorize | 545985 | 12 days ago | IN | 0 S | 0.00010172 | ||||
Authorize | 545973 | 12 days ago | IN | 0 S | 0.00010121 | ||||
Authorize | 545952 | 12 days ago | IN | 0 S | 0.00010121 | ||||
Authorize | 545940 | 12 days ago | IN | 0 S | 0.0000668 | ||||
Authorize | 545929 | 12 days ago | IN | 0 S | 0.0000668 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EventEmitter
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract EventEmitter { // Define the owner of the contract address public owner; // Define a mapping to store the authorization status of each address for each identifier mapping(address => mapping(bytes32 => bool)) public isAuthorized; // Define the event that will be emitted when the function is called event LogArgument(address indexed sender, bytes32 indexed identifier, bytes message, uint256 value); // Define the event that will be emitted when an address is granted a permission event AuthorizationGranted(address indexed addr, bytes32 indexed identifier); // Define the event that will be emitted when an address has a permission revoked event AuthorizationRevoked(address indexed addr, bytes32 indexed identifier); // Define the event that will be emitted when an ownership is transferred event OwnershipTransferred(address indexed newOwner); constructor() { // Set the contract owner to the address that deployed the contract owner = msg.sender; } // Define the function that will emit the event function emitEvent(bytes32 identifier, bytes memory message, uint256 value) public { // Only allow authorized addresses to call this function require(isAuthorized[msg.sender][identifier], "Unauthorized address"); // Emit the event with the message sender, identifier, and message passed into the function emit LogArgument(msg.sender, identifier, message, value); } // Define a function to authorize an address for a specific identifier function authorize(bytes32 identifier, address addr) public { // Only allow the owner to authorize addresses require(msg.sender == owner, "Only the owner can authorize addresses"); // Set the authorization status of the address for the given identifier to true isAuthorized[addr][identifier] = true; emit AuthorizationGranted(addr, identifier); } // Define a function to remove authorization for an address for a specific identifier function removeAuthorization(bytes32 identifier, address addr) public { // Only allow the owner to remove authorization require(msg.sender == owner, "Only the owner can remove authorization"); // Set the authorization status of the address for the given identifier to false isAuthorized[addr][identifier] = false; emit AuthorizationRevoked(addr, identifier); } // Define a function to transfer ownership of the contract function transferOwnership(address newOwner) public { // Only allow the owner to transfer ownership require(msg.sender == owner, "Only the owner can transfer ownership"); // Transfer ownership to the new owner owner = newOwner; emit OwnershipTransferred(newOwner); } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"identifier","type":"bytes32"}],"name":"AuthorizationGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"identifier","type":"bytes32"}],"name":"AuthorizationRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"bytes32","name":"identifier","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LogArgument","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes32","name":"identifier","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"authorize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"identifier","type":"bytes32"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"emitEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"isAuthorized","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":"bytes32","name":"identifier","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"removeAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052348015600e575f5ffd5b505f80546001600160a01b031916331790556105ea8061002d5f395ff3fe608060405234801561000f575f5ffd5b5060043610610060575f3560e01c80634d89084b1461006457806384921f73146100795780638da5cb5b1461008c578063de11892b146100bb578063e50c7a8f146100f8578063f2fde38b1461010b575b5f5ffd5b610077610072366004610416565b61011e565b005b610077610087366004610454565b6101e5565b5f5461009e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e86100c936600461051a565b600160209081525f928352604080842090915290825290205460ff1681565b60405190151581526020016100b2565b610077610106366004610416565b61028e565b610077610119366004610542565b61034d565b5f546001600160a01b0316331461018b5760405162461bcd60e51b815260206004820152602660248201527f4f6e6c7920746865206f776e65722063616e20617574686f72697a652061646460448201526572657373657360d01b60648201526084015b60405180910390fd5b6001600160a01b0381165f818152600160208181526040808420878552909152808320805460ff1916909217909155518492917ff07876d0785a459b0f9410464818c9911adb4b27c05260aa301a13529e32270591a35050565b335f90815260016020908152604080832086845290915290205460ff166102455760405162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a6564206164647265737360601b6044820152606401610182565b82336001600160a01b03167fa751d5fc8246910008783a026d97c9df1c194346b52fa5bbb0d2c846583a93228484604051610281929190610562565b60405180910390a3505050565b5f546001600160a01b031633146102f75760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865206f776e65722063616e2072656d6f766520617574686f7260448201526634bd30ba34b7b760c91b6064820152608401610182565b6001600160a01b0381165f818152600160209081526040808320868452909152808220805460ff19169055518492917f257d2a0d66145c3f0ceaabbde2dc9639c6bd0027c301635c8f5127b26c8e40f591a35050565b5f546001600160a01b031633146103b45760405162461bcd60e51b815260206004820152602560248201527f4f6e6c7920746865206f776e65722063616e207472616e73666572206f776e65604482015264072736869760dc1b6064820152608401610182565b5f80546001600160a01b0319166001600160a01b038316908117825560405190917f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616391a250565b80356001600160a01b0381168114610411575f5ffd5b919050565b5f5f60408385031215610427575f5ffd5b82359150610437602084016103fb565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f60608486031215610466575f5ffd5b83359250602084013567ffffffffffffffff811115610483575f5ffd5b8401601f81018613610493575f5ffd5b803567ffffffffffffffff8111156104ad576104ad610440565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156104dc576104dc610440565b6040528181528282016020018810156104f3575f5ffd5b816020840160208301375f9181016020019190915293969395505050506040919091013590565b5f5f6040838503121561052b575f5ffd5b610534836103fb565b946020939093013593505050565b5f60208284031215610552575f5ffd5b61055b826103fb565b9392505050565b604081525f83518060408401525f5b8181101561058e5760208187018101516060868401015201610571565b505f606082850101526060601f19601f830116840101915050826020830152939250505056fea26469706673582212208bad14eb679878d08fc5e036699d95b64ae8211f99449ca8140d08a30f6f4aac64736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610060575f3560e01c80634d89084b1461006457806384921f73146100795780638da5cb5b1461008c578063de11892b146100bb578063e50c7a8f146100f8578063f2fde38b1461010b575b5f5ffd5b610077610072366004610416565b61011e565b005b610077610087366004610454565b6101e5565b5f5461009e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e86100c936600461051a565b600160209081525f928352604080842090915290825290205460ff1681565b60405190151581526020016100b2565b610077610106366004610416565b61028e565b610077610119366004610542565b61034d565b5f546001600160a01b0316331461018b5760405162461bcd60e51b815260206004820152602660248201527f4f6e6c7920746865206f776e65722063616e20617574686f72697a652061646460448201526572657373657360d01b60648201526084015b60405180910390fd5b6001600160a01b0381165f818152600160208181526040808420878552909152808320805460ff1916909217909155518492917ff07876d0785a459b0f9410464818c9911adb4b27c05260aa301a13529e32270591a35050565b335f90815260016020908152604080832086845290915290205460ff166102455760405162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a6564206164647265737360601b6044820152606401610182565b82336001600160a01b03167fa751d5fc8246910008783a026d97c9df1c194346b52fa5bbb0d2c846583a93228484604051610281929190610562565b60405180910390a3505050565b5f546001600160a01b031633146102f75760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865206f776e65722063616e2072656d6f766520617574686f7260448201526634bd30ba34b7b760c91b6064820152608401610182565b6001600160a01b0381165f818152600160209081526040808320868452909152808220805460ff19169055518492917f257d2a0d66145c3f0ceaabbde2dc9639c6bd0027c301635c8f5127b26c8e40f591a35050565b5f546001600160a01b031633146103b45760405162461bcd60e51b815260206004820152602560248201527f4f6e6c7920746865206f776e65722063616e207472616e73666572206f776e65604482015264072736869760dc1b6064820152608401610182565b5f80546001600160a01b0319166001600160a01b038316908117825560405190917f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616391a250565b80356001600160a01b0381168114610411575f5ffd5b919050565b5f5f60408385031215610427575f5ffd5b82359150610437602084016103fb565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f60608486031215610466575f5ffd5b83359250602084013567ffffffffffffffff811115610483575f5ffd5b8401601f81018613610493575f5ffd5b803567ffffffffffffffff8111156104ad576104ad610440565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156104dc576104dc610440565b6040528181528282016020018810156104f3575f5ffd5b816020840160208301375f9181016020019190915293969395505050506040919091013590565b5f5f6040838503121561052b575f5ffd5b610534836103fb565b946020939093013593505050565b5f60208284031215610552575f5ffd5b61055b826103fb565b9392505050565b604081525f83518060408401525f5b8181101561058e5760208187018101516060868401015201610571565b505f606082850101526060601f19601f830116840101915050826020830152939250505056fea26469706673582212208bad14eb679878d08fc5e036699d95b64ae8211f99449ca8140d08a30f6f4aac64736f6c634300081c0033
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.