Mumbai Testnet

Contract

0xdE94Ed876B46B86FcAafadcf1a926b6E30B1F6D5

Overview

MATIC Balance

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Buy Coffee314367052023-01-26 16:44:45503 days ago1674751485IN
0xdE94Ed87...E30B1F6D5
0.01 MATIC0.00018291.50000001
Withdraw Tips314363532023-01-26 16:32:15504 days ago1674750735IN
0xdE94Ed87...E30B1F6D5
0 MATIC0.000050821.55248501
Buy Coffee314358922023-01-26 16:15:53504 days ago1674749753IN
0xdE94Ed87...E30B1F6D5
0.001 MATIC0.000208481.50000001
0x60806040314358192023-01-26 16:13:17504 days ago1674749597IN
 Contract Creation
0 MATIC0.005175368

Latest 1 internal transaction

Parent Transaction Hash Block From To Value
314363532023-01-26 16:32:15504 days ago1674750735
0xdE94Ed87...E30B1F6D5
0.001 MATIC
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xD9eA50f5...a846212d5
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
BuyMeCoffee

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : BuyMeCoffee.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract BuyMeCoffee {
    // Event to emit when a Memo is created
    event NewMemo(
        address from,
        uint256 timestamp,
        string name,
        string message
    );

    // Memo struct
    struct Memo {
        address from;
        uint256 timestamp;
        string name;
        string message;
    }

    // List of all memos recieved by friends
    Memo[] memos;

    // Address of contract deployer
    address payable owner;

    // Deploy logic
    constructor() {
        owner = payable(msg.sender); 
    }
    
    /**
    * @dev buy a coffee for contract owner
    * @param _name name of the coffee buyer
    * @param _message a nice message from the coffee buyer 
    */
    function buyCoffee(string memory _name, string memory _message) public payable {
        require(msg.value > 0, "Can't buy coffee with 0 MATIC.");
        
        // Add the memo to storage
        memos.push(Memo(
            msg.sender,
            block.timestamp,
            _name,
            _message
        ));

        // Emit log event when new memo is created
        emit NewMemo(
            msg.sender,
            block.timestamp,
            _name,
            _message
        );
    }

    /**
    * @dev send the entire balance stored in this contract to the owner
    */
    function withdrawTips() public {
        require(owner.send(address(this).balance));
    }

    /**
    * @dev retrieve all the memos recieved and stored on the blockchain
    */
    function getMemos() public view returns(Memo[] memory){
        return memos;
    }    
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"NewMemo","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_message","type":"string"}],"name":"buyCoffee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getMemos","outputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"message","type":"string"}],"internalType":"struct BuyMeCoffee.Memo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawTips","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x6080604052600436106100345760003560e01c8063204206e1146100395780633aaa74b214610055578063865c51721461006c575b600080fd5b610053600480360381019061004e919061055a565b610097565b005b34801561006157600080fd5b5061006a61020a565b005b34801561007857600080fd5b5061008161026c565b60405161008e91906107fa565b60405180910390f35b600034116100da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d19061081c565b60405180910390fd5b600060405180608001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200142815260200184815260200183815250908060018154018082558091505060019003906000526020600020906004020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906101a992919061044f565b5060608201518160030190805190602001906101c692919061044f565b5050507fc56140e05f516509ae28110e0f72e17558a7561630dad2647c3ae87d986e365c334284846040516101fe94939291906107a7565b60405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505061026a57600080fd5b565b60606000805480602002602001604051908101604052809291908181526020016000905b8282101561044657838290600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201805461032390610981565b80601f016020809104026020016040519081016040528092919081815260200182805461034f90610981565b801561039c5780601f106103715761010080835404028352916020019161039c565b820191906000526020600020905b81548152906001019060200180831161037f57829003601f168201915b505050505081526020016003820180546103b590610981565b80601f01602080910402602001604051908101604052809291908181526020018280546103e190610981565b801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b50505050508152505081526020019060010190610290565b50505050905090565b82805461045b90610981565b90600052602060002090601f01602090048101928261047d57600085556104c4565b82601f1061049657805160ff19168380011785556104c4565b828001600101855582156104c4579182015b828111156104c35782518255916020019190600101906104a8565b5b5090506104d191906104d5565b5090565b5b808211156104ee5760008160009055506001016104d6565b5090565b60006105056105008461086d565b61083c565b90508281526020810184848401111561051d57600080fd5b61052884828561093f565b509392505050565b600082601f83011261054157600080fd5b81356105518482602086016104f2565b91505092915050565b6000806040838503121561056d57600080fd5b600083013567ffffffffffffffff81111561058757600080fd5b61059385828601610530565b925050602083013567ffffffffffffffff8111156105b057600080fd5b6105bc85828601610530565b9150509250929050565b60006105d2838361071f565b905092915050565b6105e381610903565b82525050565b6105f281610903565b82525050565b6000610603826108ad565b61060d81856108d0565b93508360208202850161061f8561089d565b8060005b8581101561065b578484038952815161063c85826105c6565b9450610647836108c3565b925060208a01995050600181019050610623565b50829750879550505050505092915050565b6000610678826108b8565b61068281856108e1565b935061069281856020860161094e565b61069b81610a11565b840191505092915050565b60006106b1826108b8565b6106bb81856108f2565b93506106cb81856020860161094e565b6106d481610a11565b840191505092915050565b60006106ec601e836108f2565b91507f43616e27742062757920636f6666656520776974682030204d415449432e00006000830152602082019050919050565b600060808301600083015161073760008601826105da565b50602083015161074a6020860182610789565b5060408301518482036040860152610762828261066d565b9150506060830151848203606086015261077c828261066d565b9150508091505092915050565b61079281610935565b82525050565b6107a181610935565b82525050565b60006080820190506107bc60008301876105e9565b6107c96020830186610798565b81810360408301526107db81856106a6565b905081810360608301526107ef81846106a6565b905095945050505050565b6000602082019050818103600083015261081481846105f8565b905092915050565b60006020820190508181036000830152610835816106df565b9050919050565b6000604051905081810181811067ffffffffffffffff82111715610863576108626109e2565b5b8060405250919050565b600067ffffffffffffffff821115610888576108876109e2565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061090e82610915565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561096c578082015181840152602081019050610951565b8381111561097b576000848401525b50505050565b6000600282049050600182168061099957607f821691505b602082108114156109ad576109ac6109b3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f830116905091905056fea2646970667358221220cf4abc57da39f82bf27f7e83477f452f3cc00f29718d97dcad9a03ceb828ba7064736f6c63430008000033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.