Add Uint256 variable support to DVM and SCEXISTS(), SCLOAD(), TOLOWER(), TOUPPER(), SUBFIELD() functions#71
Open
deroholic wants to merge 13 commits intoderoproject:mainfrom
Open
Add Uint256 variable support to DVM and SCEXISTS(), SCLOAD(), TOLOWER(), TOUPPER(), SUBFIELD() functions#71deroholic wants to merge 13 commits intoderoproject:mainfrom
deroholic wants to merge 13 commits intoderoproject:mainfrom
Conversation
|
neat! |
added 6 commits
July 22, 2022 11:21
…) can work correctly with Uint256 type
…will give an indication of reason for failure. Also allow SC entrypoint functions to return String so that a descriptive error is available. An empty string indicates no error. Ex: 100 RETURN "asset ratio invalid" Produces: DERO.GetGasEstimate error: [-32098] Discarded knowingly [asset ratio invalid]
LIBRARY CONTRACT (8916824bb9a392841213b152cc0f7c4809ed4df9bfec7f8071b4524a12e62b99):
Function Add(a Uint64, b Uint64) Uint64
10 RETURN a + b
End Function
CLIENT CONTRACT:
Function Test(x, Uint64, y Uin64) Uint64
10 IMPORT lib FROM HEXDECODE("8916824bb9a392841213b152cc0f7c4809ed4df9bfec7f8071b4524a12e62b99")
20 DIM v1, v2 AS Uint64
30 LET v1 = lib.Add(x, y)
40 LET v2 = x + y
50 IF v1 != v2 THEN GOTO 90
// success
60 RETURN 0
// failure
90 RETURN 1
End Function
added 4 commits
July 28, 2022 12:28
… user had transfereed a native asset value
Contributor
|
Looks good to me, more tests would be great and also to limit functions call from a SC to another to "exported functions" only (those who start with a upper case), that would let private functions for Smart Contract and reduce security risks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New DVM functions, please review