62 Commits

Author SHA1 Message Date
Hans Svensson
47b3b9bcca Correct error type + new aebytecode 2019-09-05 15:14:17 +02:00
Hans Svensson
5a1acd9d18 Make aeso_compiler errors structured as well 2019-09-05 14:20:40 +02:00
Hans Svensson
37a37a169d File not found error 2019-09-05 11:16:31 +02:00
Ulf Norell
510935d945 Framework and tests for code generation (icode/fcode) errors 2019-09-03 14:35:13 +02:00
Hans Svensson
249b61238e Structured parse_errors and type_errors 2019-09-03 14:35:13 +02:00
Ulf Norell
470970d937 Disallow calling init from inside the contract 2019-09-03 12:22:15 +02:00
Ulf Norell
850221aaf3 Remove no_implicit_stdlib option 2019-08-27 14:10:40 +02:00
Ulf Norell
02af75aa34 Move stdlib code to priv dir and don't do any implicit includes 2019-08-27 11:33:29 +02:00
Hans Svensson
2620aa64b4 Add some no_implicit_stdlib for now 2019-08-22 15:21:41 +02:00
Hans Svensson
f27d37d624 Add payable modifier for contracts and entrypoints 2019-08-19 08:57:31 +02:00
Tino Breddin
dd26649f7d [PT-167805291] Add opcode for ecrecover (#122)
* Add opcode for ecrecover

* Update aebytecode

* Extend signature bytes type used for ecrecover

* Add ecrecover to changelog

* Add some type specs

* Please dialyzer
2019-08-14 21:02:46 +02:00
Radosław Rowicki
b669d2df1e Added list comprehensions and standard List, Option, Func, Pair, and Triple library (#105)
* Added standard List library and list comprehensions

Added List library.

Flatmaps WIP

Fixed dependency in flat_map

fcode generation

Updated tests to use custom list lib

Added comprehension test

Added stdlib

sanity

Test

* Extended stdlib for lists. Added error message for redefinition of stdlibx

* Fixed type template

* Improved stdlib

* More functions

* Fixed cyclic includes

* Refixed imports and added few tests

* Added fail test

* Undelete removed type spec

* Remove typo

* Fix iter function

* Fixed typo

* Added if guards and let statements in list comp

* Added more fail tests

* Option stliv

* 2 and 3 tuple stdlib

* Updated stdlib to new syntax. Added recursor and changed all/any functions

* Fixed performance issues. Changed include management

* Fixed hash type
2019-08-14 13:53:58 +02:00
Thomas Arts
cecc977898 Compiler returns abi_version 2019-08-06 13:11:31 +02:00
Hans Svensson
d526e55c26 to_sophia_value should also use no_code option 2019-08-05 15:19:22 +02:00
Hans Svensson
3663b4e5d0 Add no_code option to aeso_compile (for encode/decode calldata) 2019-08-05 14:33:53 +02:00
Tobias Lindahl
c4660fe0cf Properly decode revert strings for fate as well 2019-07-09 16:24:56 +02:00
Ulf Norell
dc5fd74934 Fix include path not being added if giving explicit options 2019-06-28 10:28:16 +02:00
Ulf Norell
79137e058e Revamp private/public functions
Problem: having public as the default makes it very easy to accidentally
export local function by forgetting the `private` modifier.

Solution: functions are private by default and must be declared as `entrypoint`s
to be exported. So `entrypoint foo() = ...` instead of `function foo() = ...`.

We still accept the `private` modifier although it is redundant.
2019-06-28 09:36:07 +02:00
Hans Svensson
502a4e6464 Fix to_sophia_value for FATE backend 2019-06-27 10:42:31 +02:00
Thomas Arts
389e931674 Unit type instead of bool 2019-06-20 13:13:28 +02:00
Thomas Arts
d571993405 Fix type spec 2019-06-20 13:13:25 +02:00
Thomas Arts
66528c8a6a Move translate_vm to aeso_vm_decode 2019-06-20 13:10:08 +02:00
Thomas Arts
46c746da1c Refactor string_to_code 2019-06-20 13:10:08 +02:00
Thomas Arts
1c346af85e whitespaces 2019-06-20 13:10:08 +02:00
Thomas Arts
a34558412d Arguments are in the body of the call, use term_to_fate before serializing them 2019-06-14 12:41:21 +02:00
Thomas Arts
95c41b8eee Avoid hash collisions in calldata creation 2019-06-14 12:41:21 +02:00
Thomas Arts
46963a8326 Update aeso_compiler 2019-06-11 15:25:01 +02:00
Hans Svensson
3e2281a834 Make fate-backend also return a Map 2019-06-10 15:13:34 +02:00
Hans Svensson
bb4ef61a50 Allow negative literals in calldata and result 2019-06-03 09:08:53 +02:00
Hans Svensson
758fecbb9b
Merge pull request #75 from aeternity/fix_aci
Restructure and improve ACI
2019-05-31 11:33:07 +02:00
Ulf Norell
bea524635b Add backend argument (aevm | fate) to aeso_compiler options
and test fate backend on (most) compilable contracts
2019-05-28 16:40:54 +02:00
Hans Svensson
c60999edf0 Refactor aeso_aci with dont_unfold, etc. 2019-05-28 11:08:36 +02:00
Ulf Norell
389072fb12 Add stateful to __call 2019-05-14 09:32:52 +02:00
Hans Svensson
3255c62e0e Revert bytes(N) from icode/vm-types 2019-04-23 17:47:50 +02:00
Hans Svensson
4324bfd49e Add bytes(int), add address_literalsm add ecverify_secp25k1
hash -> bytes(32)
signature -> bytes(64)
address literals
2019-04-23 10:40:02 +02:00
Robert Virding
9f5f8d4444 Change function references from aeso_sophia to aeb_aevm_data 2019-04-02 16:00:10 +02:00
Robert Virding
0d8b7c7c79 First commit fixinng references from aeso_ to aeb_
Also remove local copies of modules moved to aebytecode.
2019-04-02 15:59:12 +02:00
Hans Svensson
a089af555f More better type specs 2019-03-13 19:57:27 +01:00
Hans Svensson
cd116b23d7 add aeso_compiler:decode_calldata/3 2019-03-13 16:15:48 +01:00
Hans Svensson
f266c5eed8 Add a VERSION file at the top level and go from there 2019-03-04 12:17:54 +01:00
Ulf Norell
c2a5ed28cf please dialyzer 2019-03-01 11:07:46 +01:00
Ulf Norell
56f70fea6c test oracle calldata fixes 2019-03-01 09:36:43 +01:00
Ulf Norell
9e908369ec check create_calldata contract without the __call function first 2019-03-01 09:21:56 +01:00
Hans Svensson
eb77a73d15 Correctly handle ArgTypes in create_calldata 2019-02-28 14:44:16 +01:00
Hans Svensson
6d6fff2612 Better error handling when init is present but wrong 2019-02-28 09:56:16 +01:00
Hans Svensson
95bf0d4b6c Fix handling of init in create_calldata 2019-02-27 20:42:42 +01:00
Hans Svensson
a263b09e57 Remove leftover io:format 2019-02-27 11:00:00 +01:00
Hans Svensson
5a3c8530b4 Dialyzer found an error 2019-02-26 21:03:52 +01:00
Ulf Norell
e0fff00e64 get rid of byte code argument to create_calldata
This means that there is less type checking at calldata creation time.
Make sure that we check that the function hash exists before calling
a contract!
2019-02-26 17:31:53 +01:00
Ulf Norell
5a4a84805f change create_calldata function to also take fun name and arguments 2019-02-26 15:01:27 +01:00