instruction.rs 712 B

1234567891011121314151617181920212223242526272829303132333435
  1. use std::str;
  2. use steel::*;
  3. #[repr(u8)]
  4. #[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
  5. pub enum SteelInstruction {
  6. Create = 0,
  7. Mint = 1,
  8. Transfer = 2,
  9. }
  10. #[repr(C)]
  11. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  12. pub struct Create {
  13. pub token_name: [u8; 32],
  14. pub token_symbol: [u8; 8],
  15. pub token_uri: [u8; 64],
  16. pub token_decimals: u8,
  17. }
  18. #[repr(C)]
  19. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  20. pub struct Mint {
  21. pub quantity: [u8; 8],
  22. }
  23. #[repr(C)]
  24. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  25. pub struct Transfer {
  26. pub quantity: [u8; 8],
  27. }
  28. instruction!(SteelInstruction, Create);
  29. instruction!(SteelInstruction, Mint);
  30. instruction!(SteelInstruction, Transfer);