constructor_seeds.sol 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @program_id("@#$!")
  2. contract c1 {
  3. /**
  4. * Multiple seeds allowed, but bump must be after last seed.
  5. */
  6. @seed("feh")
  7. @seed(foo)
  8. @seed(bar)
  9. @bump(b)
  10. @seed(baz)
  11. @space(102 + a)
  12. constructor(bytes foo, string bar, bytes baz, uint8 b) {}
  13. }
  14. @program_id("102")
  15. contract c2 {
  16. /// Only one bump allowed.
  17. @seed(hex"41420044")
  18. @bump(b)
  19. @bump(5)
  20. @payer(address"Chi1doxDSNjrmbZ5sq3H2cXyTq3KNfGepmbhyHaxcr")
  21. @payer(bar)
  22. @space(1025 + 5)
  23. @space(4)
  24. constructor(bytes foo, address payable bar, bytes baz, uint8 b) {}
  25. }
  26. @program_id(foo)
  27. contract c3 {
  28. /** Only one bump allowed. */
  29. @seed(hex"41420044")
  30. @bump(b)
  31. @bump(5)
  32. @payer(address"Chi1doxDSNjrmbZ5sq3H2cXyTq3KNfGepmbhyHaxcr8")
  33. @payer(bar)
  34. @space(1025 + 5)
  35. @space(4)
  36. constructor(bytes foo, address payable bar, bytes baz, uint8 b) {}
  37. @seed("meh")
  38. @bump(1)
  39. @payer(address"Chi1doxDSNjrmbZ5sq3H2cXyTq3KNfGepmbhyHaxcr8")
  40. @space(5)
  41. function func() public {}
  42. }
  43. contract c4 {
  44. /** Payer is required */
  45. @seed(hex"41420044")
  46. @space(4)
  47. @bump(1)
  48. constructor() {}
  49. }