selectors-must-be-different.sol 876 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. abstract contract c {
  2. @selector([1])
  3. function f1() public {}
  4. // error: selector must be unique
  5. @selector([1])
  6. function f2() public {}
  7. // error: selector must be unique
  8. @selector([1])
  9. function f3() public {}
  10. }
  11. contract d {
  12. int public c;
  13. // error: selector is the same as c
  14. @selector([0x13, 0xfb, 0xd7, 0x25, 0xfe, 0xff, 0x6e, 0x10])
  15. function f1() public {}
  16. }
  17. contract e {
  18. // error: selector must be 8 bytes
  19. @selector([1])
  20. function f1() public {}
  21. }
  22. contract f {
  23. // error: selectors are the same
  24. @selector([0x41, 0x42, 0x43, 0x44, 0xca, 0xff, 0xee, 0x00])
  25. function f1() public {}
  26. @selector([0x41, 0x42, 0x43, 0x44, 0xca, 0xff, 0xee, 0x00])
  27. function f2() public {}
  28. function f3() public {}
  29. }
  30. contract g {
  31. function f1() public {}
  32. // error: selector for f3 matches f1
  33. @selector([0x1b, 0x49, 0x4c, 0xee, 0x9c, 0x54, 0x1e, 0x94])
  34. function f3() public {}
  35. }