Created
July 25, 2020 13:52
-
-
Save ilovelili/721fd9f9624ee5baec4dd2dd21d88e4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.10; | |
// Enables event logging of the format `console.log('descriptive string', variable)`, | |
// without having to worry about the variable type (as long as an event has been declared for that type in the | |
// Console contract. | |
contract Console { | |
event LogUint(string, uint); | |
function log(string s , uint x) { | |
LogUint(s, x); | |
} | |
event LogInt(string, int); | |
function log(string s , int x) { | |
LogInt(s, x); | |
} | |
event LogBytes(string, bytes); | |
function log(string s , bytes x) { | |
LogBytes(s, x); | |
} | |
event LogBytes32(string, bytes32); | |
function log(string s , bytes32 x) { | |
LogBytes32(s, x); | |
} | |
event LogAddress(string, address); | |
function log(string s , address x) { | |
LogAddress(s, x); | |
} | |
event LogBool(string, bool); | |
function log(string s , bool x) { | |
LogBool(s, x); | |
} | |
} | |
contract NeedsDebugging is Console { | |
function InspectMePlease(){ | |
log("name", uint(1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment