@@ -51,47 +51,51 @@ Example
51
51
52
52
.. code-block :: javascript
53
53
54
+ pragma solidity ^ 0.8 .4 ;
54
55
contract Test {
55
56
uint a;
56
- address d = 0x12345678901234567890123456789012 ;
57
+ address d = 0xdCad3a6d3569DF655070DEd06cb7A1b2Ccd1D3AF ;
57
58
58
- function Test (uint testInt ) { a = testInt;}
59
+ constructor (uint testInt ) { a = testInt;}
59
60
60
61
event Event (uint indexed b, bytes32 c);
61
62
62
63
event Event2 (uint indexed b, bytes32 c);
63
64
64
- function foo (uint b , bytes32 c ) returns(address) {
65
- Event (b, c);
65
+ function foo (uint b , bytes32 c ) public returns(address) {
66
+ emit Event (b, c);
66
67
return d;
67
68
}
68
69
}
69
70
71
+
70
72
// would result in the JSON:
71
- [{
72
- " type" : " constructor" ,
73
- " payable" : false ,
74
- " stateMutability" : " nonpayable"
75
- " inputs" : [{" name" : " testInt" ," type" : " uint256" }],
76
- },{
77
- " type" : " function" ,
78
- " name" : " foo" ,
79
- " constant" : false ,
80
- " payable" : false ,
81
- " stateMutability" : " nonpayable" ,
82
- " inputs" : [{" name" : " b" ," type" : " uint256" }, {" name" : " c" ," type" : " bytes32" }],
83
- " outputs" : [{" name" : " " ," type" : " address" }]
84
- },{
85
- " type" : " event" ,
86
- " name" : " Event" ,
87
- " inputs" : [{" indexed" : true ," name" : " b" ," type" : " uint256" }, {" indexed" : false ," name" : " c" ," type" : " bytes32" }],
88
- " anonymous" : false
89
- },{
90
- " type" : " event" ,
91
- " name" : " Event2" ,
92
- " inputs" : [{" indexed" : true ," name" : " b" ," type" : " uint256" },{" indexed" : false ," name" : " c" ," type" : " bytes32" }],
93
- " anonymous" : false
94
- }]
73
+ [
74
+ {
75
+ " type" : " constructor"
76
+ " stateMutability" : " nonpayable" ,
77
+ " inputs" : [{" internalType" : " uint256" ," name" : " testInt" ," type" : " uint256" }],
78
+ },
79
+ {
80
+ " type" : " event"
81
+ " name" : " Event" ,
82
+ " inputs" : [{" indexed" : true ," internalType" : " uint256" ," name" : " b" ," type" : " uint256" },{" indexed" : false ," internalType" : " bytes32" ," name" : " c" ," type" : " bytes32" }],
83
+ " anonymous" : false ,
84
+ },
85
+ {
86
+ " type" : " event"
87
+ " name" : " Event2" ,
88
+ " inputs" : [{" indexed" : true ," internalType" : " uint256" ," name" : " b" ," type" : " uint256" },{" indexed" : false ," internalType" : " bytes32" ," name" : " c" ," type" : " bytes32" }],
89
+ " anonymous" : false ,
90
+ },
91
+ {
92
+ " type" : " function"
93
+ " name" : " foo" ,
94
+ " stateMutability" : " nonpayable" ,
95
+ " inputs" : [{" internalType" : " uint256" ," name" : " b" ," type" : " uint256" },{" internalType" : " bytes32" ," name" : " c" ," type" : " bytes32" }],
96
+ " outputs" : [{" internalType" : " address" ," name" : " " ," type" : " address" }],
97
+ }
98
+ ]
95
99
96
100
97
101
------------------------------------------------------------------------------
0 commit comments