Last week the latest compiler version, the 3.2.0 has been released. It brings a few new built-in functions, squashes some bugs and it introduces an important change (from the changelog):
Public contract functions must now be declared as entrypoints
contract Example =
// Exported
entrypoint exported_fun(x) = local_fun(x)
// Not exported
function local_fun(x) = x
This welcomed change improves the security and readabiltiy of the contracts, but it will require a changes on the existing contracts source code.
This change will not impact the Js/Py/Go SDKs (and likely other SDK implementations) but you are affected if you are using the hosted compiler.
The good news is that the hosted compiler now supports multiple versions of the sophia compiler, that means that you can already test the changes to your sophia contract but by default the hosted compiler will still use the v3.1.0.
This will change though on 2019-07-17 where we will set the default compiler to v3.2.0unless there are objections and there is a request to postpone this update.
For more informations on how to use the compilers check the compiler page: compiler.aepps.com
It is mainly a safety thing, we want to avoid exposing functions by accident so you need to explicitly tag them with entrypoint. We could have kept private/public, but thought that entrypoint is more obvious what it means.
I can see that the require function has been added in 3.2.0 compiler version. Wouldn’t it better to recognize and reserve require as a potential keyword (to require modules or other stuff) and use assert instead?: