Advertisement
Guest User

Untitled

a guest
Sep 24th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // compiled with version Version: 0.1.2-5c3bfd4b*/.-/clang/int
  2. // https://chriseth.github.io/browser-solidity/
  3.  
  4. contract EventTest {
  5.     enum TestEnum { Enum1, Enum2, Enum3}
  6.     struct TestStruct {
  7.         uint s1;
  8.         int s2;
  9.     }
  10.    
  11.     event BooleanTestEvent(bool input);
  12.     event IntTestEvent(int signedInput, uint unsignedInput);
  13.     event Int8TestEvent(int8 signedInput, uint8 unsignedInput);
  14.     event Int32TestEvent(int32 signedInput, uint32 unsignedInput);
  15.     event Int40TestEvent(int40 signedInput, uint40 unsignedInput);
  16.     event AddressTestEvent(address input);
  17.     event Bytes1TestEvent(bytes1 input);
  18.     event Bytes2TestEvent(bytes2 input);
  19.     event Bytes32TestEvent(bytes32 input);
  20.     event BytesTestEvent(bytes input);
  21.     event StringTestEvent(string input);
  22.     event EnumTestEvent(TestEnum input);
  23.     //event StructTestEvent(StructTest str); //  Type error: Internal type is not allowed as event parameter type.
  24.     //event MappingTestEvent1(mapping(uint => uint));  // Type error: Type is required to live outside storage.
  25.    
  26.     event BooleanArrayTestEvent(bool[] input);
  27.     event IntArrayTestEvent(int[] signedInput, uint[] unsignedInput);
  28.     event Int8ArrayTestEvent(int8[] signedInput, uint8[] unsignedInput);
  29.     event Int32ArrayTestEvent(int32[] signedInput, uint32[] unsignedInput);
  30.     event Int40ArrayTestEvent(int40[] signedInput, uint40[] unsignedInput);
  31.     event AddressArrayTestEvent(address[] input);
  32.     event Bytes1ArrayTestEvent(bytes1[] input);
  33.     event Bytes2ArrayTestEvent(bytes2[] input);
  34.     event Bytes32ArrayTestEvent(bytes32[] input);
  35.     //event BytesArrayTestEvent(bytes[] byt); // Type error: Internal type is not allowed as event parameter type.
  36.     //event StringArrayTestEvent(string[] str); // Type error: Internal type is not allowed as event parameter type.
  37.     event EnumArrayTestEvent(TestEnum[] input);
  38.     //event StructArrayTestEvent(StructTest[] arr); // Type error: Internal type is not allowed as event parameter type.
  39.     //event MappingArrayTestEvent1(mapping(uint => uint)[]); // Type error: Type is required to live outside storage.
  40.    
  41.     function booleanTest(bool test) {
  42.         BooleanTestEvent(test);
  43.     }
  44.    
  45.     function intTest(int signedInput, uint unsignedInput) {
  46.         IntTestEvent(signedInput, unsignedInput);
  47.     }
  48.    
  49.     function Int8Test(int8 signedInput, uint8 unsignedInput) {
  50.         Int8TestEvent(signedInput, unsignedInput);
  51.     }
  52.    
  53.     function Int32Test(int32 signedInput, uint32 unsignedInput) {
  54.         Int32TestEvent(signedInput, unsignedInput);
  55.     }
  56.    
  57.     function Int40Test(int40 signedInput, uint40 unsignedInput) {
  58.         Int40TestEvent(signedInput, unsignedInput);
  59.     }
  60.    
  61.     function AddressTest(address addr) {
  62.         AddressTestEvent(addr);
  63.     }
  64.    
  65.     function Bytes1Test(bytes1 byt) {
  66.         Bytes1TestEvent(byt);
  67.     }
  68.    
  69.     function Bytes2Test(bytes2 byt) {
  70.         Bytes2TestEvent(byt);
  71.     }
  72.    
  73.     function Bytes32Test(bytes32 byt) {
  74.         Bytes32TestEvent(byt);
  75.     }
  76.    
  77.     function BytesTest(bytes byt) {
  78.         BytesTestEvent(byt);
  79.     }
  80.    
  81.     function StringTest(string str) {
  82.         StringTestEvent(str);
  83.     }
  84.    
  85.     function EnumTest(TestEnum enu) {
  86.         EnumTestEvent(enu);
  87.     }
  88.    
  89.    
  90.     function BooleanArrayTest(bool[] input) {
  91.         BooleanArrayTestEvent(input);
  92.     }
  93.    
  94.     function IntArrayTest(int[] signedInput, uint[] unsignedInput) {
  95.         IntArrayTestEvent(signedInput, unsignedInput);
  96.     }
  97.     function Int8ArrayTest(int8[] signedInput, uint8[] unsignedInput) {
  98.         Int8ArrayTestEvent(signedInput, unsignedInput);
  99.     }
  100.     function Int32ArrayTest(int32[] signedInput, uint32[] unsignedInput) {
  101.         Int32ArrayTestEvent(signedInput, unsignedInput);
  102.     }
  103.     function Int40ArrayTest(int40[] signedInput, uint40[] unsignedInput) {
  104.         Int40ArrayTestEvent(signedInput, unsignedInput);
  105.     }
  106.     function AddressArrayTest(address[] addr) {
  107.         AddressArrayTestEvent(addr);
  108.     }
  109.     function Bytes1ArrayTest(bytes1[] byt) {
  110.         Bytes1ArrayTestEvent(byt);
  111.     }
  112.     function Bytes2ArrayTest(bytes2[] byt) {
  113.         Bytes2ArrayTestEvent(byt);
  114.     }
  115.     function Bytes32ArrayTest(bytes32[] byt) {
  116.         Bytes32ArrayTestEvent(byt);
  117.     }
  118.     function EnumArrayTest(TestEnum[] arr) {
  119.         EnumArrayTestEvent(arr);
  120.     }
  121.  
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement