Fix the docs

This commit is contained in:
radrow 2022-04-19 19:39:12 +02:00
parent 19d8f63131
commit 247aeb6346
4 changed files with 6 additions and 25 deletions

View File

@ -62,15 +62,6 @@ Type = term()
``` ```
Check a call in contract through the `__call` function. Check a call in contract through the `__call` function.
#### sophia_type_to_typerep(String) -> TypeRep
Types
``` erlang
{ok,TypeRep} | {error, badtype}
```
Get the type representation of a type declaration.
#### version() -> {ok, Version} | {error, term()} #### version() -> {ok, Version} | {error, term()}
Types Types

View File

@ -225,9 +225,6 @@ payable stateful entrypoint buy(to : address) =
abort("Value too low") abort("Value too low")
``` ```
Note: In the æternity VM (AEVM) contracts and entrypoints were by default
payable until the Lima release.
## Namespaces ## Namespaces
Code can be split into libraries using the `namespace` construct. Namespaces Code can be split into libraries using the `namespace` construct. Namespaces
@ -405,7 +402,7 @@ Sophia has the following types:
## Arithmetic ## Arithmetic
Sophia integers (`int`) are represented by 256-bit (AEVM) or arbitrary-sized (FATE) signed words and supports the following Sophia integers (`int`) are represented by arbitrary-sized signed words and support the following
arithmetic operations: arithmetic operations:
- addition (`x + y`) - addition (`x + y`)
- subtraction (`x - y`) - subtraction (`x - y`)
@ -414,22 +411,16 @@ arithmetic operations:
- remainder (`x mod y`), satisfying `y * (x / y) + x mod y == x` for non-zero `y` - remainder (`x mod y`), satisfying `y * (x / y) + x mod y == x` for non-zero `y`
- exponentiation (`x ^ y`) - exponentiation (`x ^ y`)
All operations are *safe* with respect to overflow and underflow. On AEVM they behave as the corresponding All operations are *safe* with respect to overflow and underflow.
operations on arbitrary-size integers and fail with `arithmetic_error` if the The division and modulo operations throw an arithmetic error if the
result cannot be represented by a 256-bit signed word. For example, `2 ^ 255` right-hand operand is zero.
fails rather than wrapping around to -2²⁵⁵.
The division and modulo operations also throw an arithmetic error if the
second argument is zero.
## Bit fields ## Bit fields
Sophia integers do not support bit arithmetic. Instead there is a separate Sophia integers do not support bit arithmetic. Instead there is a separate
type `bits`. See the standard library [documentation](sophia_stdlib.md#bits). type `bits`. See the standard library [documentation](sophia_stdlib.md#bits).
On the AEVM a bit field is represented by a 256-bit word and reading or writing A bit field can be of arbitrary size (but it is still represented by the
a bit outside the 0..255 range fails with an `arithmetic_error`. On FATE a bit
field can be of arbitrary size (but it is still represented by the
corresponding integer, so setting very high bits can be expensive). corresponding integer, so setting very high bits can be expensive).
## Type aliases ## Type aliases

View File

@ -1,5 +1,4 @@
contract UnappliedNamedArgBuiltin = contract UnappliedNamedArgBuiltin =
// Allowed in FATE, but not AEVM
stateful entrypoint main_fun(s) = stateful entrypoint main_fun(s) =
let reg = Oracle.register let reg = Oracle.register
reg(signature = s, Contract.address, 100, RelativeTTL(100)) : oracle(int, int) reg(signature = s, Contract.address, 100, RelativeTTL(100)) : oracle(int, int)

View File

@ -1,4 +1,4 @@
// Builtins without named arguments can appear unapplied in both AEVM and FATE. // Builtins without named arguments can appear unapplied.
// Named argument builtins are: // Named argument builtins are:
// Oracle.register // Oracle.register
// Oracle.respond // Oracle.respond