Smart Contracts: Safe floating point maths + automatic amount conversion to 10^8 #973
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.
Description
This PR is based on #967. To be rebased as soon as it is merged.
Contract.add_uco_transfer to: "...", amount: 1
to transfer 1 UCO (before he/she had to specify amount: 100000000 to send 1 UCO. Makes the language friendlier.String.from_number/1
andString.to_number/1
instead ofString.from_float/1
,String.from_int/1
,String.to_float/1
,String.to_int/1
.Fixes #893
ps: I suggest to ignore
test/archethic/contracts/interpreter/condition_interpreter_test.exs
when reviewing. This is just tests adaption due to the function being stricter than before (it is a good thing).Type of change
How Has This Been Tested?
Unit tests ✔️
Manual tests: ❔
Checklist: