55 Commits

Author SHA1 Message Date
Ulf Norell
30de1db163 More code errors 2019-09-03 14:35:13 +02:00
Ulf Norell
0533ab27e1 Check that there are no maps in map keys already in type checker 2019-09-03 14:35:13 +02:00
Ulf Norell
510935d945 Framework and tests for code generation (icode/fcode) errors 2019-09-03 14:35:13 +02:00
sennui
83d06977f9 add extra argument to claim for bidding 2019-09-01 10:58:49 +02:00
Ulf Norell
062309e578 Type variables mentioned in local functions should not be flexible
(cc #112)
2019-08-30 14:22:31 +02:00
Ulf Norell
6fd39d4cb1 Add checks for polymorphic/higher order oracles and higher order entrypoints (AEVM) 2019-08-30 11:18:20 +02:00
Ulf Norell
850221aaf3 Remove no_implicit_stdlib option 2019-08-27 14:10:40 +02:00
Ulf Norell
3f1c23ace3 Use .. in list comprehension test 2019-08-27 14:00:23 +02:00
Hans Svensson
ebdd38c505 Change ecverify into verify_sig and then add an actual ecverify 2019-08-21 09:29:40 +02:00
Hans Svensson
e9505e240f Add Address.is_payable(address) 2019-08-19 08:57:31 +02:00
Hans Svensson
f27d37d624 Add payable modifier for contracts and entrypoints 2019-08-19 08:57:31 +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
Hans Svensson
4478fee6e6 Add ACI calldata test 2019-08-05 14:33:53 +02:00
Ulf Norell
46a996ead8 Update test case 2019-08-05 09:20:09 +02:00
Ulf Norell
5ff7aa5821
Merge pull request #109 from radrow/tuple-type
Change tuple typing syntax
2019-08-05 09:13:30 +02:00
Radosław Rowicki
045df292be Fixed pretty printing and pattern split (#111) 2019-07-29 14:27:01 +03:00
radrow
5ff983b0b3 Updated tests 2019-07-22 13:56:45 +02:00
Tobias Lindahl
6f873e45b8 Use a name string rather than a name hash in transfer and revoke 2019-07-01 07:42:08 +02:00
Ulf Norell
6a59e455ce Update tests for entrypoints 2019-06-28 09:42:28 +02:00
Hans Svensson
a617a6469d Change Chain.block_hash to return option(hash) 2019-06-27 14:19:39 +02:00
Ulf Norell
259bae1720 Test case for another name space bug 2019-06-27 09:15:27 +02:00
Tobias Lindahl
c26ace6c2c Implement aens instructions for fate 2019-06-26 13:24:48 +02:00
Ulf Norell
3c8d9561a0 More thorough test for different event types 2019-06-25 19:58:14 +02:00
Ulf Norell
6612c29758 Type check Bytes.to_X builtins 2019-06-24 11:44:07 +02:00
Ulf Norell
7fa98892a8 Fix compiler crash on missing let body 2019-06-21 14:16:26 +02:00
Ulf Norell
d38367e023 Fix bug in type checker 2019-06-20 16:02:19 +02:00
Thomas Arts
ff11943576 Add test contract 2019-06-20 13:10:08 +02:00
Thomas Arts
95c41b8eee Avoid hash collisions in calldata creation 2019-06-14 12:41:21 +02:00
Ulf Norell
17a1fd8095 Add require builtin 2019-06-14 10:27:07 +02:00
Hans Svensson
5c98317a5a Make 'indexed' keyword optional 2019-05-28 11:08:36 +02:00
Ulf Norell
96547ea2ec Test for record field parse error 2019-05-27 12:04:38 +02:00
Ulf Norell
d8dd6b900f Remove unused test contract 2019-05-13 17:51:56 +02:00
Ulf Norell
74d4048d9f Check that init doesn't read or write the state 2019-05-13 17:51:47 +02:00
Ulf Norell
5aed8b3ef5 Check stateful annotations
Functions must be annotated as `stateful` in order to
- Update the contract state (using `put`)
- Call `Chain.spend` or other primitive functions that cost tokens
- Call an Oracle or AENS function that requires a signature
- Make a remote call with a non-zero value
- Construct a lambda calling a stateful function

It does not need to be stateful to
- Read the contract state
- Call another contract with value=0, even when the remote function is stateful
2019-05-13 13:39:17 +02:00
Ulf Norell
e1a798aef4 Check for repeated argument names to functions
(PT-159592825)
2019-05-10 15:51:42 +02:00
Ulf Norell
23cc8e1132
Letrec and letfun (#65)
* Type check and compile letfuns

* Minor code simplification

* Remove let rec from Sophia
2019-05-10 13:27:57 +02:00
Hans Svensson
192ec207a7 Add Contract.creator and address checking primitives 2019-05-09 09:54:04 +02:00
Ulf Norell
8a381e5ef1 Support equality on bytes(N) 2019-04-25 16:06: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
Hans Svensson
d6a55e144e Test Auth.tx_hash compilation 2019-04-08 11:57:07 +02:00
Hans Svensson
7b474e439c Improve Events error message + more tests 2019-02-25 21:53:52 +01:00
Ulf Norell
0b86cdc318 Clean up test case 2019-02-08 14:16:06 +01:00
Hans Svensson
421bc01012 Add error messages for bad include and nested namespace 2019-02-08 14:16:06 +01:00
Hans Svensson
2b7490776e Add include directive
Add an include directive to include namespaces into a contract. Only allowed at the top level.

To allow includes, either call through aeso_compiler:file or set the option `allow_include` (and add `include_path`(s)).
2019-02-08 14:16:06 +01:00
Ulf Norell
e6f01481bf Bind state and event primitives only in contracts (and with the right types) 2019-02-08 14:16:06 +01:00
Ulf Norell
d9188d58a7 Proper checking of types 2019-02-08 14:16:06 +01:00
Ulf Norell
dfa286d43c Deadcode elimination (icode post pass) 2019-02-08 14:16:06 +01:00
Ulf Norell
478da2af33 Don't expose namespace functions as entrypoints 2019-02-08 14:16:06 +01:00
Ulf Norell
10be09fe30 Add checks on event constructor arguments to type checker 2019-02-08 14:16:06 +01:00
Ulf Norell
367f87b612 Implement namespaces
This includes a massive refactoring of the type checker, getting
rid of most of the ets tables and keeping a proper environment.
2019-02-08 14:16:06 +01:00