// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract DataStorage { mapping(address => string) public storedData; mapping(string => bool) private dataExists; event DataStored(address indexed _from, string _data); function setData(string memory _data) public { require(bytes(_data).length <= 9, "Data length exceeds 9 characters"); require(!dataExists[_data], "Data already exists"); storedData[msg.sender] = _data; dataExists[_data] = true; emit DataStored(msg.sender, _data); } function getData(address _address) public view returns (string memory) { return storedData[_address]; } }