Dero Virtual machines documentation.
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.

63 lines
2.0KB

  1. Support Functions are inbuilt functions which provide some functionality or expose internals for speed and technical reasons.
  2. LOAD(variable)
  3. ==============
  4. LOAD loads a variable which was previously stored in the blockchain using STORE function. Return type will be Uint64/String depending on what is stored.
  5. It will panic if the value does NOT exists
  6. Uint64 EXISTS(variable)
  7. =======================
  8. EXISTS return 1 if the variable is store in DB and 0 otherwise
  9. STORE(key variable, value variable)
  10. ===================================
  11. STORE stores key and value in the DB. All storage state of the SC is accessible only from the SC which created it.
  12. Uint64 RANDOM()
  13. Uint64 RANDOM(limit Uin64)
  14. ============================
  15. RANDOM returns a random using a PRNG seeded on BLID,SCID,TXID. First form gives a uint64, second form returns
  16. random number in the range 0 - (limit), 0 is inclusive, limit is exclusive
  17. String SCID()
  18. ==============
  19. Returns SMART CONTRACT ID which is currently running
  20. String BLID()
  21. ==============
  22. Returns current BLOCK ID which contains current execution-in-progress TXID
  23. String TXID()
  24. =============
  25. Returns current TXID which is execution-in-progress.
  26. Uint64 BLOCK_HEIGHT()
  27. =====================
  28. Returns current chain height of BLID()
  29. Uint64 BLOCK_TOPOHEIGHT()
  30. ===========================
  31. Returns current topoheight of BLID()
  32. String SIGNER()
  33. =================
  34. Returns address of who signed this transaction
  35. Uint64 IS_ADDRESS_VALID(p String)
  36. =================================
  37. Returns 1 is address is valid, 0 otherwise
  38. String ADDRESS_RAW(p String)
  39. ============================
  40. Returns address in RAW form as 64 byte keys, stripping away textual/presentation form. 2 address should always be compared in RAW form
  41. SEND_DERO_TO_ADDRESS(a String, amount Uint64)
  42. ==============================================
  43. Sends amount DERO from SC DERO balance to a address. address must in string form DERO/DETO form
  44. If the SC does not have enough balance, it will panic