其他分享
首页 > 其他分享> > Soldity-event

Soldity-event

作者:互联网

Events allow logging to the Ethereum blockchain. Some use cases for events are:

 
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

contract Event {
    // Event declaration
    // Up to 3 parameters can be indexed.
    // Indexed parameters helps you filter the logs by the indexed parameter
    event Log(address indexed sender, string message);
    event AnotherLog();

    function test() public {
        emit Log(msg.sender, "Hello World!");
        emit Log(msg.sender, "Hello EVM!");
        emit AnotherLog();
    }
}

标签:sender,parameters,Soldity,event,indexed,emit,Log
来源: https://www.cnblogs.com/zaleswift/p/16538453.html