You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

simple-novc.sol 854B

12345678910111213141516171819202122232425262728293031323334
  1. pragma solidity ^0.4.0;
  2. contract Simple {
  3. address private verifier;
  4. event Event(int32 a);
  5. event Event2(int32 a, int32 b);
  6. function Simple(address _verifier) {
  7. verifier = _verifier;
  8. }
  9. function simple(int32[4] arr, bool swap) private returns (int32[2] ret) {
  10. if(swap) {
  11. ret[0] = arr[0] + arr[1];
  12. ret[1] = arr[2] + arr[3];
  13. } else {
  14. ret[0] = arr[0] + arr[3];
  15. ret[1] = arr[2] + arr[1];
  16. }
  17. return ret;
  18. }
  19. function intermediate(int32 a, int32 b) private verifying returns (int32[2]) {
  20. Event(a);
  21. return simple([int32(1), 2, 3, 4], true);
  22. }
  23. function entry(int32 a, int32 b) public verifying returns (int32[2]) {
  24. int32[2] memory r = intermediate(a, b);
  25. Event2(a + b, r[0]);
  26. return r;
  27. }
  28. }