Skip to content
Verified contractExactMIT

SignalRegistry

Address0x43015b15d8ed1bbbfe2f2172c34cc2ecda6cf817
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.30

 

Same code

1 more contract

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,402,849
Creation transaction
0xe16bb24abe…61cf74bedc

contracts/SignalRegistry.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;

contract SignalRegistry {
    uint256 public constant MAX_MESSAGE_LENGTH = 280;

    uint256 public totalSignals;
    mapping(address account => uint256) public signalsByAccount;

    event SignalSent(address indexed sender, uint256 indexed index, string message);

    error EmptyMessage();
    error MessageTooLong(uint256 length);

    function signal(string calldata message) external {
        uint256 length = bytes(message).length;
        if (length == 0) revert EmptyMessage();
        if (length > MAX_MESSAGE_LENGTH) revert MessageTooLong(length);

        uint256 index = signalsByAccount[msg.sender] + 1;
        signalsByAccount[msg.sender] = index;
        totalSignals += 1;

        emit SignalSent(msg.sender, index, message);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.