Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

event in solidity documentation

var options = {
    fromBlock: 0,
    address: web3.eth.defaultAccount,
    topics: ["0x0000000000000000000000000000000000000000000000000000000000000000", null, null]
};
web3.eth.subscribe('logs', options, function (error, result) {
    if (!error)
        console.log(result);
})
    .on("data", function (log) {
        console.log(log);
    })
    .on("changed", function (log) {
});
Comment

solidity events

// Solidity program to demonstrate
// creating an event
pragma solidity ^0.4.21;

// Creating a contract
contract eventExample {

	// Declaring state variables
	uint256 public value = 0;

	// Declaring an event
	event Increment(address owner);

	// Defining a function for logging event
	function getValue(uint _a, uint _b) public {
		emit Increment(msg.sender);
		value = _a + _b;
	}
}
Comment

event solidity

let options = {
    filter: {
        value: ['1000', '1337']    //Only get events where transfer value was 1000 or 1337
    },
    fromBlock: 0,                  //Number || "earliest" || "pending" || "latest"
    toBlock: 'latest'
};

myContract.getPastEvents('Transfer', options)
    .then(results => console.log(results))
    .catch(err => throw err);
Comment

PREVIOUS NEXT
Code Example
Javascript :: math.ceil node js 
Javascript :: comment field react 
Javascript :: 206. reverse linked list javascript 
Javascript :: call bind apply in javascript 
Javascript :: open json javascript 
Javascript :: fill array with array javascript 
Javascript :: nextjs apollo 
Javascript :: javascript json to excel 
Javascript :: animation js 
Javascript :: JavaScript (SMonkey 60.2.3) sample 
Javascript :: how to sort linesin javascript 
Javascript :: insertmany 
Javascript :: hex color js 
Javascript :: print blade value in js 
Javascript :: react props class based static proptypes 
Javascript :: Export Multiple Objects 
Javascript :: javascript for...of with Generators 
Javascript :: django debug toolbar javascript error 
Javascript :: find the missing number in js 
Javascript :: jquery v3.3.1 download 
Javascript :: Could not resolve "i18n-iso-countries" 
Javascript :: change rotation phaser 
Javascript :: phaser spread 
Javascript :: How to call the API when the search value changes 
Javascript :: npm deploy next js with tailwind 
Javascript :: javascript search an array of json for matching attribute 
Javascript :: moment js with nodejs 
Javascript :: graphql nested schema 
Javascript :: react router browser refresh 
Javascript :: kafkajs 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =