There's more...

In addition to the previously mentioned functions, ERC20 also implements some events for logging:

event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);

These events can be listened to from your application to provide a seamless UI for the user. This can help notify the users of tokens received or approved:

tokenContract.events.Transfer({
filter: { },
fromBlock: 0
})
.on('data', function(event){
// ...
})
.on('changed', function(event){
// ...
})
.on('error',function(event){
// ...
});
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.27.72