JSON_test.sol 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. contract JSON_Test {
  2. event Log0(uint value) ;
  3. event Log0Anonym (uint value) anonymous;
  4. event Log1(bool indexed aBool, uint value);
  5. event Log1Anonym(bool indexed aBool, uint value) anonymous;
  6. event Log2(bool indexed aBool, address indexed aAddress, uint value);
  7. event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) anonymous;
  8. event Log3(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value);
  9. event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) anonymous;
  10. event Log4(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value);
  11. event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) anonymous;
  12. function JSON_Test() {
  13. }
  14. function setBool(bool _bool) {
  15. myBool = _bool;
  16. }
  17. function setInt8(int8 _int8) {
  18. myInt8 = _int8;
  19. }
  20. function setUint8(uint8 _uint8) {
  21. myUint8 = _uint8;
  22. }
  23. function setInt256(int256 _int256) {
  24. myInt256 = _int256;
  25. }
  26. function setUint256(uint256 _uint256) {
  27. myUint256 = _uint256;
  28. }
  29. function setAddress(address _address) {
  30. myAddress = _address;
  31. }
  32. function setBytes32(bytes32 _bytes32) {
  33. myBytes32 = _bytes32;
  34. }
  35. function getBool() returns (bool ret) {
  36. return myBool;
  37. }
  38. function getInt8() returns (int8 ret) {
  39. return myInt8;
  40. }
  41. function getUint8() returns (uint8 ret) {
  42. return myUint8;
  43. }
  44. function getInt256() returns (int256 ret) {
  45. return myInt256;
  46. }
  47. function getUint256() returns (uint256 ret) {
  48. return myUint256;
  49. }
  50. function getAddress() returns (address ret) {
  51. return myAddress;
  52. }
  53. function getBytes32() returns (bytes32 ret) {
  54. return myBytes32;
  55. }
  56. function fireEventLog0() {
  57. Log0(42);
  58. }
  59. function fireEventLog0Anonym() {
  60. Log0Anonym(42);
  61. }
  62. function fireEventLog1() {
  63. Log1(true, 42);
  64. }
  65. function fireEventLog1Anonym() {
  66. Log1Anonym(true, 42);
  67. }
  68. function fireEventLog2() {
  69. Log2(true, msg.sender, 42);
  70. }
  71. function fireEventLog2Anonym() {
  72. Log2Anonym(true, msg.sender, 42);
  73. }
  74. function fireEventLog3() {
  75. Log3(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42);
  76. }
  77. function fireEventLog3Anonym() {
  78. Log3Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42);
  79. }
  80. function fireEventLog4() {
  81. Log4(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42);
  82. }
  83. function fireEventLog4Anonym() {
  84. Log4Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42);
  85. }
  86. bool myBool;
  87. int8 myInt8;
  88. uint8 myUint8;
  89. int256 myInt256;
  90. uint256 myUint256;
  91. address myAddress;
  92. bytes32 myBytes32;
  93. }