Replies: 2 comments
-
Another option to check if a function is available: if type(bignum.ispositive) == "function" then
...
end But it only works for functions on existing modules. This will fail if the if type(name_service.resolve) == "function" then
...
end
This method checks for the module and for the function: if name_service ~= nil and type(name_service.resolve) == "function" then
...
end |
Beta Was this translation helpful? Give feedback.
0 replies
-
For implementation, check #270 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What about letting the smart contracts retrieve which hardfork version the underlying blockchain is running on?
It could be accessed using a function like:
system.version()
It is useful for contracts to know which functions and modules are available
As functions can be added to modules without a hardfork (after V4), the above function can return 2 values:
If the contract is interested only on the first, the it can use just the first value:
But this should be possible too:
Or return a float in which the integral part is the hardfork version and the decimal part is the minor version, like this:
3.0
4.0
4.1
5.0
...Beta Was this translation helpful? Give feedback.
All reactions