Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : BasicAhhContract
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; contract BasicAhhContract { address payable public owner; string public message; event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); event FundsWithdrawn(address indexed owner, uint256 amount); event FundsReceived(address indexed sender, uint256 amount); event StringUpdated(string newString); constructor() { owner = payable(msg.sender); } function setMessage(string memory _newString) public { require(msg.sender == owner, "Only owner can set message"); message = _newString; emit StringUpdated(_newString); } function shrimpHash(string memory _string) public pure returns(bytes32) { return keccak256(abi.encodePacked(_string)); } function transferOwnership(address payable newOwner) public { require(msg.sender == owner, "Only owner can transfer ownership"); require(newOwner != address(0), "New owner cannot be the zero address"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function withdrawFunds() public { require(msg.sender == owner, "Only owner can withdraw funds, smh"); uint256 amount = address(this).balance; emit FundsWithdrawn(owner, amount); owner.transfer(amount); } receive() external payable { emit FundsReceived(msg.sender, msg.value); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.