forked from argotorg/fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_notes.html
More file actions
1613 lines (1448 loc) · 78.2 KB
/
Copy pathrelease_notes.html
File metadata and controls
1613 lines (1448 loc) · 78.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<html lang="en" class="sidebar-visible no-js light">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>Release Notes - The Fe Guide</title>
<!-- Custom HTML head -->
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff" />
<link rel="icon" href="favicon.svg">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/chrome.css">
<link rel="stylesheet" href="css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">
<link rel="stylesheet" href="ayu-highlight.css">
<!-- Custom theme stylesheets -->
<link rel="stylesheet" href="theme/reference.css">
</head>
<body>
<!-- Provide site root to javascript -->
<script type="text/javascript">
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script type="text/javascript">
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script type="text/javascript">
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('no-js')
html.classList.remove('light')
html.classList.add(theme);
html.classList.add('js');
</script>
<!-- Hide / unhide sidebar before it is displayed -->
<script type="text/javascript">
var html = document.querySelector('html');
var sidebar = 'hidden';
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
}
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="index.html">Introduction</a></li><li class="chapter-item expanded "><a href="quickstart/index.html"><strong aria-hidden="true">1.</strong> Quickstart</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="quickstart/installation.html"><strong aria-hidden="true">1.1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="quickstart/first_contract.html"><strong aria-hidden="true">1.2.</strong> Write your first contract</a></li><li class="chapter-item expanded "><a href="quickstart/deploy_contract.html"><strong aria-hidden="true">1.3.</strong> Deploying a contract to a testnet</a></li></ol></li><li class="chapter-item expanded "><a href="development/index.html"><strong aria-hidden="true">2.</strong> Development</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="development/build.html"><strong aria-hidden="true">2.1.</strong> Build & Test</a></li><li class="chapter-item expanded "><a href="development/release.html"><strong aria-hidden="true">2.2.</strong> Release</a></li></ol></li><li class="chapter-item expanded "><a href="spec/index.html"><strong aria-hidden="true">3.</strong> Specification (WIP)</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/notation.html"><strong aria-hidden="true">3.1.</strong> Notation</a></li><li class="chapter-item expanded "><a href="spec/lexical_structure/index.html"><strong aria-hidden="true">3.2.</strong> Lexical Structure</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/lexical_structure/keywords.html"><strong aria-hidden="true">3.2.1.</strong> Keywords</a></li><li class="chapter-item expanded "><a href="spec/lexical_structure/identifiers.html"><strong aria-hidden="true">3.2.2.</strong> Identifiers</a></li><li class="chapter-item expanded "><a href="spec/lexical_structure/tokens.html"><strong aria-hidden="true">3.2.3.</strong> Tokens</a></li></ol></li><li class="chapter-item expanded "><a href="spec/comments.html"><strong aria-hidden="true">3.3.</strong> Comments</a></li><li class="chapter-item expanded "><a href="spec/items/index.html"><strong aria-hidden="true">3.4.</strong> Items</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/items/visibility_and_privacy.html"><strong aria-hidden="true">3.4.1.</strong> Visibility and Privacy</a></li><li class="chapter-item expanded "><a href="spec/items/functions.html"><strong aria-hidden="true">3.4.2.</strong> Functions</a></li><li class="chapter-item expanded "><a href="spec/items/structs.html"><strong aria-hidden="true">3.4.3.</strong> Structs</a></li><li class="chapter-item expanded "><a href="spec/items/events.html"><strong aria-hidden="true">3.4.4.</strong> Events</a></li><li class="chapter-item expanded "><a href="spec/items/enum.html"><strong aria-hidden="true">3.4.5.</strong> Enumeration</a></li><li class="chapter-item expanded "><a href="spec/items/type_aliases.html"><strong aria-hidden="true">3.4.6.</strong> Type Aliases</a></li><li class="chapter-item expanded "><a href="spec/items/contracts.html"><strong aria-hidden="true">3.4.7.</strong> Contracts</a></li></ol></li><li class="chapter-item expanded "><a href="spec/statements/index.html"><strong aria-hidden="true">3.5.</strong> Statements</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/statements/pragma.html"><strong aria-hidden="true">3.5.1.</strong> pragma Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/const.html"><strong aria-hidden="true">3.5.2.</strong> const Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/let.html"><strong aria-hidden="true">3.5.3.</strong> let Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/assign.html"><strong aria-hidden="true">3.5.4.</strong> Assignment Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/augassign.html"><strong aria-hidden="true">3.5.5.</strong> Augmenting Assignment Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/revert.html"><strong aria-hidden="true">3.5.6.</strong> revert Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/return.html"><strong aria-hidden="true">3.5.7.</strong> return Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/emit.html"><strong aria-hidden="true">3.5.8.</strong> emit Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/if.html"><strong aria-hidden="true">3.5.9.</strong> if Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/for.html"><strong aria-hidden="true">3.5.10.</strong> for Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/while.html"><strong aria-hidden="true">3.5.11.</strong> while Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/break.html"><strong aria-hidden="true">3.5.12.</strong> break Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/continue.html"><strong aria-hidden="true">3.5.13.</strong> continue Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/assert.html"><strong aria-hidden="true">3.5.14.</strong> assert Statement</a></li><li class="chapter-item expanded "><a href="spec/statements/pass.html"><strong aria-hidden="true">3.5.15.</strong> pass Statement</a></li></ol></li><li class="chapter-item expanded "><a href="spec/expressions/index.html"><strong aria-hidden="true">3.6.</strong> Expressions</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/expressions/call.html"><strong aria-hidden="true">3.6.1.</strong> Call expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/tuple.html"><strong aria-hidden="true">3.6.2.</strong> Tuple expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/list.html"><strong aria-hidden="true">3.6.3.</strong> List expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/struct.html"><strong aria-hidden="true">3.6.4.</strong> Struct expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/indexing.html"><strong aria-hidden="true">3.6.5.</strong> Index expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/attribute.html"><strong aria-hidden="true">3.6.6.</strong> Attribute expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/name.html"><strong aria-hidden="true">3.6.7.</strong> Name expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/literal.html"><strong aria-hidden="true">3.6.8.</strong> Literal expressions</a></li><li class="chapter-item expanded "><a href="spec/expressions/arithmetic_operators.html"><strong aria-hidden="true">3.6.9.</strong> Arithmetic Operators</a></li><li class="chapter-item expanded "><a href="spec/expressions/comparison_operators.html"><strong aria-hidden="true">3.6.10.</strong> Comparision Operators</a></li><li class="chapter-item expanded "><a href="spec/expressions/boolean_operators.html"><strong aria-hidden="true">3.6.11.</strong> Boolean Operators</a></li><li class="chapter-item expanded "><a href="spec/expressions/unary_operators.html"><strong aria-hidden="true">3.6.12.</strong> Unary Operators</a></li></ol></li><li class="chapter-item expanded "><a href="spec/type_system/index.html"><strong aria-hidden="true">3.7.</strong> Type System</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/type_system/types/index.html"><strong aria-hidden="true">3.7.1.</strong> Types</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/type_system/types/boolean.html"><strong aria-hidden="true">3.7.1.1.</strong> Boolean Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/contract.html"><strong aria-hidden="true">3.7.1.2.</strong> Contract Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/numeric.html"><strong aria-hidden="true">3.7.1.3.</strong> Numeric Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/tuple.html"><strong aria-hidden="true">3.7.1.4.</strong> Tuple Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/array.html"><strong aria-hidden="true">3.7.1.5.</strong> Array Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/struct.html"><strong aria-hidden="true">3.7.1.6.</strong> Struct Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/enum.html"><strong aria-hidden="true">3.7.1.7.</strong> Enumerated Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/address.html"><strong aria-hidden="true">3.7.1.8.</strong> Address Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/map.html"><strong aria-hidden="true">3.7.1.9.</strong> Map Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/string.html"><strong aria-hidden="true">3.7.1.10.</strong> String Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/unit.html"><strong aria-hidden="true">3.7.1.11.</strong> Unit Type</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/event.html"><strong aria-hidden="true">3.7.1.12.</strong> Event Types</a></li><li class="chapter-item expanded "><a href="spec/type_system/types/function.html"><strong aria-hidden="true">3.7.1.13.</strong> Function Type</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="spec/data_layout/index.html"><strong aria-hidden="true">3.8.</strong> Data Layout</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/data_layout/stack.html"><strong aria-hidden="true">3.8.1.</strong> Stack</a></li><li class="chapter-item expanded "><a href="spec/data_layout/storage/index.html"><strong aria-hidden="true">3.8.2.</strong> Storage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/data_layout/storage/constant_size_values_in_storage.html"><strong aria-hidden="true">3.8.2.1.</strong> Constant size values in storage</a></li><li class="chapter-item expanded "><a href="spec/data_layout/storage/maps_in_storage.html"><strong aria-hidden="true">3.8.2.2.</strong> Maps in storage</a></li><li class="chapter-item expanded "><a href="spec/data_layout/storage/to_mem_function.html"><strong aria-hidden="true">3.8.2.3.</strong> to_mem() function</a></li></ol></li><li class="chapter-item expanded "><a href="spec/data_layout/memory/index.html"><strong aria-hidden="true">3.8.3.</strong> Memory</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="spec/data_layout/memory/sequence_types_in_memory.html"><strong aria-hidden="true">3.8.3.1.</strong> Sequence types in memory</a></li><li class="chapter-item expanded "><a href="spec/data_layout/memory/clone_function.html"><strong aria-hidden="true">3.8.3.2.</strong> clone() function</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="spec/function_calls.html"><strong aria-hidden="true">3.9.</strong> Function calls</a></li></ol></li><li class="chapter-item expanded "><a href="release_notes.html" class="active"><strong aria-hidden="true">4.</strong> Release Notes</a></li><li class="chapter-item expanded "><a href="code_of_conduct.html"><strong aria-hidden="true">5.</strong> Code of Conduct</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky bordered">
<div class="left-buttons">
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</button>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">The Fe Guide</h1>
<div class="right-buttons">
<a href="print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script type="text/javascript">
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="release-notes"><a class="header" href="#release-notes">Release Notes</a></h1>
<p><a href="https://github.com/ethereum/fe/releases">🖥️ Download Binaries</a>
<a href="https://github.com/ethereum/fe/tree/master/spec">📄 Draft Spec</a>
<a href="https://github.com/ethereum/fe#getting-started">ℹ️ Getting Started</a></p>
<p>Fe is moving fast. Read up on all the latest improvements.</p>
<p><strong>WARNING: All Fe releases are alpha releases and only meant to share the development progress with developers and enthusiasts. It is NOT yet ready for production usage.</strong></p>
<h2 id="0130-alpha-2022-01-31-0130-alpha-2022-01-31"><a class="header" href="#0130-alpha-2022-01-31-0130-alpha-2022-01-31">0.13.0-alpha (2022-01-31)## 0.13.0-alpha (2022-01-31)</a></h2>
<h3 id="features"><a class="header" href="#features">Features</a></h3>
<ul>
<li>
<p>Support private fields on structs</p>
<p>Public fields now need to be declared with the <code>pub</code> modifier, otherwise they default to private fields.
If a struct contains private fields it can not be constructed directly except from within the
struct itself. The recommended way is to implement a method <code>new(...)</code> as demonstrated in the
following example.</p>
<pre><code>struct House:
pub price: u256
pub size: u256
vacant: bool
pub fn new(price: u256, size: u256) -> House
return House(price=price, size=size, vacant=true)
contract Manager:
house: House
pub fn create_house(price: u256, size: u256):
self.house = House::new(price, size)
let can_access_price: u256 = self.house.price
# can not access `self.house.vacant` because the field is private
``` ([#214](https://github.com/ethereum/fe/issues/214))
</code></pre>
</li>
<li>
<p>Support non-base type fields in structs</p>
<p>Support is currently limited in two ways:</p>
<ul>
<li>Structs with complex fields can not be returned from public functions</li>
<li>Structs with complex fields can not be stored in storage (<a href="https://github.com/ethereum/fe/issues/343">#343</a>)</li>
</ul>
</li>
<li>
<p>Addresses can now be explicitly cast to u256. For example:</p>
<pre><code>fn f(addr: address) -> u256:
return u256(addr)
``` ([#621](https://github.com/ethereum/fe/issues/621))
</code></pre>
</li>
<li>
<p>A special function named <code>__call__</code> can now be defined in contracts. </p>
<p>The body of this function will execute in place of the standard dispatcher when the contract is called.</p>
<p>example (with intrinsics):</p>
<pre><code>contract Foo:
pub fn __call__(self):
unsafe:
if __calldataload(0) == 1:
__revert(0, 0)
else:
__return(0, 0)
``` ([#622](https://github.com/ethereum/fe/issues/622))
</code></pre>
</li>
</ul>
<h3 id="bugfixes"><a class="header" href="#bugfixes">Bugfixes</a></h3>
<ul>
<li>
<p>Fixed a crash that happend when using a certain unprintable ASCII char (<a href="https://github.com/ethereum/fe/issues/551">#551</a>)</p>
</li>
<li>
<p>The argument to <code>revert</code> wasn't being lowered by the compiler,
meaning that some <code>revert</code> calls would cause a compiler panic
in later stages. For example:</p>
<pre><code>const BAD_MOJO: u256 = 0xdeaddead
struct Error:
code: u256
fn fail():
revert Error(code = BAD_MOJO)
``` ([#619](https://github.com/ethereum/fe/issues/619))
</code></pre>
</li>
<li>
<p>Fixed a regression where an empty list expression (<code>[]</code>) would lead to a compiler crash. (<a href="https://github.com/ethereum/fe/issues/623">#623</a>)</p>
</li>
<li>
<p>Fixed a bug where int array elements were not sign extended in their ABI encodings. (<a href="https://github.com/ethereum/fe/issues/633">#633</a>)</p>
</li>
</ul>
<h2 id="0120-alpha-2021-12-31-0120-alpha-2021-12-31"><a class="header" href="#0120-alpha-2021-12-31-0120-alpha-2021-12-31">0.12.0-alpha (2021-12-31)## 0.12.0-alpha (2021-12-31)</a></h2>
<h3 id="features-1"><a class="header" href="#features-1">Features</a></h3>
<ul>
<li>
<p>Added unsafe low-level "intrinsic" functions, that perform raw evm operations.
For example:</p>
<pre><code>fn foo():
unsafe:
__mtore(0, 5000)
assert __mload(0) == 5000
</code></pre>
<p>The functions available are exactly those defined in yul's "evm dialect":
https://docs.soliditylang.org/en/v0.8.11/yul.html#evm-dialect
but with a double-underscore prefix. Eg <code>selfdestruct</code> -> <code>__selfdestruct</code>.</p>
<p>These are intended to be used for implementing basic standard library functionality,
and shouldn't typically be needed in normal contract code.</p>
<p>Note: some intrinsic functions don't return a value (eg <code>__log0</code>); using these
functions in a context that assumes a return value of unit type (eg <code>let x: () = __log0(a, b)</code>)
will currently result in a compiler panic in the yul compilation phase. (<a href="https://github.com/ethereum/fe/issues/603">#603</a>)</p>
</li>
<li>
<p>Added an out of bounds check for accessing array items.
If an array index is retrieved at an index that is not within
the bounds of the array it now reverts with <code>Panic(0x32)</code>. (<a href="https://github.com/ethereum/fe/issues/606">#606</a>)</p>
</li>
</ul>
<h3 id="bugfixes-1"><a class="header" href="#bugfixes-1">Bugfixes</a></h3>
<ul>
<li>
<p>Ensure ternary expression short circuit.</p>
<p>Example:</p>
<pre><code>contract Foo:
pub fn bar(input: u256) -> u256:
return 1 if input > 5 else revert_me()
fn revert_me() -> u256:
revert
return 0
</code></pre>
<p>Previous to this change, the code above would <strong>always</strong> revert no matter
which branch of the ternary expressions it would resolve to. That is because
both sides were evaluated and then one side was discarded. With this change,
only the branch that doesn't get picked won't get evaluated at all.</p>
<p>The same is true for the boolean operations <code>and</code> and <code>or</code>. (<a href="https://github.com/ethereum/fe/issues/488">#488</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors"><a class="header" href="#internal-changes---for-fe-contributors">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>
<p>Added a globally available <em>dummy</em> std lib.</p>
<p>This library contains a single <code>get_42</code> function, which can be called using <code>std::get_42()</code>. Once
low-level intrinsics have been added to the language, we can delete <code>get_42</code> and start adding
useful code. (<a href="https://github.com/ethereum/fe/issues/601">#601</a>)</p>
</li>
</ul>
<h2 id="0110-alpha-karlite-2021-12-02"><a class="header" href="#0110-alpha-karlite-2021-12-02">0.11.0-alpha "Karlite" (2021-12-02)</a></h2>
<h3 id="features-2"><a class="header" href="#features-2">Features</a></h3>
<ul>
<li>
<p>Added support for multi-file inputs.</p>
<p><strong>Implementation details:</strong></p>
<p>Mostly copied Rust's crate system, but use the the term <em>ingot</em> instead of crate.</p>
<p>Below is an example of an ingot's file tree, as supported by the current implementation.</p>
<pre><code>`-- basic_ingot
`-- src
|-- bar
| `-- baz.fe
|-- bing.fe
|-- ding
| |-- dang.fe
| `-- dong.fe
`-- main.fe
</code></pre>
<p>There are still a few features that will be worked on over the coming months:</p>
<ul>
<li>source files accompanying each directory module (e.g. <code>my_mod.fe</code>)</li>
<li>configuration files and the ability to create library ingots</li>
<li>test directories</li>
<li>module-level <code>pub</code> modifier (all items in a module are public)</li>
<li><code>mod</code> statements (all fe files in the input tree are public modules)</li>
</ul>
<p>These things will be implemented in order of importance over the next few months. (<a href="https://github.com/ethereum/fe/issues/562">#562</a>)</p>
</li>
<li>
<p>The syntax for array types has changed to match other generic types.
For example, <code>u8[4]</code> is now written <code>Array<u8, 4></code>. (<a href="https://github.com/ethereum/fe/issues/571">#571</a>)</p>
</li>
<li>
<p>Functions can now be defined on struct types. Example:</p>
<pre><code>struct Point:
x: u64
y: u64
# Doesn't take `self`. Callable as `Point.origin()`.
# Note that the syntax for this will soon be changed to `Point::origin()`.
pub fn origin() -> Point:
return Point(x=0, y=0)
# Takes `self`. Callable on a value of type `Point`.
pub fn translate(self, x: u64, y: u64):
self.x += x
self.y += y
pub fn add(self, other: Point) -> Point:
let x: u64 = self.x + other.x
let y: u64 = self.y + other.y
return Point(x, y)
pub fn hash(self) -> u256:
return keccak256(self.abi_encode())
pub fn do_pointy_things():
let p1: Point = Point.origin()
p1.translate(5, 10)
let p2: Point = Point(x=1, y=2)
let p3: Point = p1.add(p2)
assert p3.x == 6 and p3.y == 12
``` ([#577](https://github.com/ethereum/fe/issues/577))
</code></pre>
</li>
</ul>
<h3 id="bugfixes-2"><a class="header" href="#bugfixes-2">Bugfixes</a></h3>
<ul>
<li>
<p>Fixed a rare compiler crash.</p>
<p>Example:</p>
<pre><code>let my_array: i256[1] = [-1 << 1]
</code></pre>
<p>Previous to this fix, the given example would lead to an ICE. (<a href="https://github.com/ethereum/fe/issues/550">#550</a>)</p>
</li>
<li>
<p>Contracts can now <code>create</code> an instance of a contract defined later in a file.
This issue was caused by a weakness in the way we generated yul. (<a href="https://github.com/ethereum/fe/issues/596">#596</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-1"><a class="header" href="#internal-changes---for-fe-contributors-1">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>
<p>File IDs are now attached to <code>Span</code>s. (<a href="https://github.com/ethereum/fe/issues/587">#587</a>)</p>
</li>
<li>
<p>The fe analyzer now builds a dependency graph of source code "items" (functions, contracts, structs, etc).
This is used in the yulgen phase to determine which items are needed in the yul (intermediate representation)
output. Note that the yul output is still cluttered with utility functions that may or may not be needed by
a given contract. These utility functions are defined in the yulgen phase and aren't tracked in the dependency
graph, so it's not yet possible to filter out the unused functions. We plan to move the definition of many
of these utility functions into fe; when this happens they'll become part of the dependency graph and will only
be included in the yul output when needed.</p>
<p>The dependency graph will also enable future analyzer warnings about unused code. (<a href="https://github.com/ethereum/fe/issues/596">#596</a>)</p>
</li>
</ul>
<h2 id="0100-alpha-2021-10-31"><a class="header" href="#0100-alpha-2021-10-31">0.10.0-alpha (2021-10-31)</a></h2>
<h3 id="features-3"><a class="header" href="#features-3">Features</a></h3>
<ul>
<li>
<p>Support for module level constants for base types</p>
<p>Example:</p>
<pre><code>const TEN = 10
contract
pub fn do_moon_math(self) -> u256:
return 4711 * TEN
</code></pre>
<p>The values of base type constants are always inlined. (<a href="https://github.com/ethereum/fe/issues/192">#192</a>)</p>
</li>
<li>
<p>Encode revert errors for ABI decoding as <code>Error(0x103)</code> not <code>Panic(0x99)</code> (<a href="https://github.com/ethereum/fe/issues/492">#492</a>)</p>
</li>
<li>
<p>Replaced <code>import</code> statements with <code>use</code> statements.</p>
<p>Example:</p>
<pre><code>use foo::{bar::*, baz as baz26}
</code></pre>
<p>Note: this only adds support for parsing <code>use</code> statements. (<a href="https://github.com/ethereum/fe/issues/547">#547</a>)</p>
</li>
<li>
<p>Functions can no be defined outside of contracts. Example:</p>
<pre><code>fn add_bonus(x: u256) -> u256:
return x + 10
contract PointTracker:
points: Map<address, u256>
pub fn add_points(self, user: address, val: u256):
self.points[user] += add_bonus(val)
``` ([#566](https://github.com/ethereum/fe/issues/566))
</code></pre>
</li>
<li>
<p>Implemented a <code>send_value(to: address, value_in_wei: u256)</code> function.</p>
<p>The function is similar to the <a href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/5b28259dacf47fc208e03611eb3ba8eeaed63cc0/contracts/utils/Address.sol#L54-L59"><code>sendValue</code> function by OpenZeppelin</a> with the differences being that:</p>
<ol>
<li>
<p>It reverts with <code>Error(0x100)</code> instead of <code>Error("Address: insufficient balance")</code> to
safe more gas.</p>
</li>
<li>
<p>It uses <code>selfbalance()</code> instead of <code>balance(address())</code> to safe more gas</p>
</li>
<li>
<p>It reverts with <code>Error(0x101)</code> instead of <code>Error("Address: unable to send value, recipient may have reverted")</code> also to safe more gas. (<a href="https://github.com/ethereum/fe/issues/567">#567</a>)</p>
</li>
</ol>
</li>
<li>
<p>Added support for <code>unsafe</code> functions and <code>unsafe</code> blocks within functions.
Note that there's currently no functionality within Fe that requires the use
of <code>unsafe</code>, but we plan to add built-in <code>unsafe</code> functions that perform raw
evm operations which will only callable within an <code>unsafe</code> block or function. (<a href="https://github.com/ethereum/fe/issues/569">#569</a>)</p>
</li>
<li>
<p>Added <code>balance()</code> and <code>balance_of(account: address)</code> methods. (<a href="https://github.com/ethereum/fe/issues/572">#572</a>)</p>
</li>
<li>
<p>Added support for explicit casting between numeric types.</p>
<p>Example:</p>
<pre><code>let a: i8 = i8(-1)
let a1: i16 = i16(a)
let a2: u16 = u16(a1)
assert a2 == u16(65535)
let b: i8 = i8(-1)
let b1: u8 = u8(b)
let b2: u16 = u16(b1)
assert b2 == u16(255)
</code></pre>
<p>Notice that Fe allows casting between any two numeric types but does not allow
to change both the sign and the size of the type in one step as that would leave
room for ambiguity as the example above demonstrates. (<a href="https://github.com/ethereum/fe/issues/576">#576</a>)</p>
</li>
</ul>
<h3 id="bugfixes-3"><a class="header" href="#bugfixes-3">Bugfixes</a></h3>
<ul>
<li>
<p>Adjust numeric values loaded from memory or storage</p>
<p>Previous to this fix numeric values that were loaded from either memory or storage
were not properly loaded on the stack which could result in numeric values not
treated as intended.</p>
<p>Example:</p>
<pre><code>contract Foo:
pub fn bar() -> i8:
let in_memory: i8[1] = [-3]
return in_memory[0]
</code></pre>
<p>In the example above <code>bar()</code> would not return <code>-3</code> but <code>253</code> instead. (<a href="https://github.com/ethereum/fe/issues/524">#524</a>)</p>
</li>
<li>
<p>Propagate reverts from external contract calls.</p>
<p>Before this fix the following code to <code>should_revert()</code> or <code>should_revert2()</code>
would succeed even though it clearly should not.</p>
<pre><code>contract A:
contract_b: B
pub fn __init__(contract_b: address):
self.contract_b = B(contract_b)
pub fn should_revert():
self.contract_b.fail()
pub fn should_revert2():
self.contract_b.fail_with_custom_error()
struct SomeError:
pass
contract B:
pub fn fail():
revert
pub fn fail_with_custom_error():
revert SomeError()
</code></pre>
<p>With this fix the revert errors are properly passed upwards the call hierachy. (<a href="https://github.com/ethereum/fe/issues/574">#574</a>)</p>
</li>
<li>
<p>Fixed bug in left shift operation.</p>
<p>Example:</p>
<p>Let's consider the value <code>1</code> as an <code>u8</code> which is represented as
the following 256 bit item on the EVM stack <code>00..|00000001|</code>.
A left shift of <code>8</code> bits (<code>val << 8</code>) turns that into <code>00..01|00000000|</code>.</p>
<p>Previous to this fix this resulted in the compiler taking <code>256</code> as the
value for the <code>u8</code> when clearly <code>256</code> is not even in the range of <code>u8</code>
anymore. With this fix the left shift operations was fixed to properly
"clean up" the result of the shift so that <code>00..01|00000000|</code> turns into
<code>00..00|00000000|</code>. (<a href="https://github.com/ethereum/fe/issues/575">#575</a>)</p>
</li>
<li>
<p>Ensure negation is checked and reverts with over/underflow if needed.</p>
<p>Example:</p>
<p>The minimum value for an <code>i8</code> is <code>-128</code> but the maximum value of an <code>i8</code>
is <code>127</code> which means that negating <code>-128</code> should lead to an overflow since
<code>128</code> does not fit into an <code>i8</code>. Before this fix, negation operations where
not checked for over/underflow resulting in returning the oversized value. (<a href="https://github.com/ethereum/fe/issues/578">#578</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-2"><a class="header" href="#internal-changes---for-fe-contributors-2">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>
<p>In the analysis stage, all name resolution (of variable names, function names,
type names, etc used in code) now happens via a single <code>resolve_name</code> pathway,
so we can catch more cases of name collisions and log more helpful error messages. (<a href="https://github.com/ethereum/fe/issues/555">#555</a>)</p>
</li>
<li>
<p>Added a new category of tests: differential contract testing.</p>
<p>Each of these tests is pased on a pair of contracts where one implementation
is written in Fe and the other one is written in Solidity. The implementations
should have the same public APIs and are assumed to always return identical
results given equal inputs. The inputs are randomly generated using <code>proptest</code>
and hence are expected to discover unknown bugs. (<a href="https://github.com/ethereum/fe/issues/578">#578</a>)</p>
</li>
</ul>
<h2 id="090-alpha-2021-09-29"><a class="header" href="#090-alpha-2021-09-29">0.9.0-alpha (2021-09-29)</a></h2>
<h3 id="features-4"><a class="header" href="#features-4">Features</a></h3>
<ul>
<li>
<p>The <code>self</code> variable is no longer implicitly defined in code blocks. It must now be declared
as the first parameter in a function signature.</p>
<p>Example:</p>
<pre><code>contract Foo:
my_stored_num: u256
pub fn bar(self, my_num: u256):
self.my_stored_num = my_num
pub fn baz(self):
self.bar(my_pure_func())
pub fn my_pure_func() -> u256:
return 42 + 26
``` ([#520](https://github.com/ethereum/fe/issues/520))
</code></pre>
</li>
<li>
<p>The analyzer now disallows defining a type, variable, or function whose
name conflicts with a built-in type, function, or object.</p>
<p>Example:</p>
<pre><code>error: type name conflicts with built-in type
┌─ compile_errors/shadow_builtin_type.fe:1:6
│
1 │ type u256 = u8
│ ^^^^ `u256` is a built-in type
``` ([#539](https://github.com/ethereum/fe/issues/539))
</code></pre>
</li>
</ul>
<h3 id="bugfixes-4"><a class="header" href="#bugfixes-4">Bugfixes</a></h3>
<ul>
<li>Fixed cases where the analyzer would correctly reject code, but would panic instead of logging an error message. (<a href="https://github.com/ethereum/fe/issues/534">#534</a>)</li>
<li>Non-fatal parser errors (eg missing parentheses when defining a function that takes no arguments: <code>fn foo:</code>)
are no longer ignored if the semantic analysis stage succeeds. (<a href="https://github.com/ethereum/fe/issues/535">#535</a>)</li>
<li>Fixed issue #531 by adding a <code>$</code> to the front of lowered tuple names. (<a href="https://github.com/ethereum/fe/issues/546">#546</a>)</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-3"><a class="header" href="#internal-changes---for-fe-contributors-3">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>Implemented pretty printing of Fe AST. (<a href="https://github.com/ethereum/fe/issues/540">#540</a>)</li>
</ul>
<h2 id="080-alpha-haxonite-2021-08-31"><a class="header" href="#080-alpha-haxonite-2021-08-31">0.8.0-alpha "Haxonite" (2021-08-31)</a></h2>
<h3 id="features-5"><a class="header" href="#features-5">Features</a></h3>
<ul>
<li>
<p>Support quotes, tabs and carriage returns in string literals and otherwise
restrict string literals to the printable subset of the ASCII table. (<a href="https://github.com/ethereum/fe/issues/329">#329</a>)</p>
</li>
<li>
<p>The analyzer now uses a query-based system, which fixes some shortcomings of the previous implementation.</p>
<ul>
<li>Types can now refer to other types defined later in the file.
Example:</li>
</ul>
<pre><code>type Posts = Map<PostId, PostBody>
type PostId = u256
type PostBody = String<140>
</code></pre>
<ul>
<li>Duplicate definition errors now show the location of the original definition.</li>
<li>The analysis of each function, type definition, etc happens independently, so an error in one
doesn't stop the analysis pass. This means fe can report more user errors in a single run of the compiler. (<a href="https://github.com/ethereum/fe/issues/468">#468</a>)</li>
</ul>
</li>
<li>
<p>Function definitions are now denoted with the keyword fn instead of def. (<a href="https://github.com/ethereum/fe/issues/496">#496</a>)</p>
</li>
<li>
<p>Variable declarations are now preceded by the <code>let</code> keyword. Example: <code>let x: u8 = 1</code>. (<a href="https://github.com/ethereum/fe/issues/509">#509</a>)</p>
</li>
<li>
<p>Implemented support for numeric unary invert operator (<code>~</code>) (<a href="https://github.com/ethereum/fe/issues/526">#526</a>)</p>
</li>
</ul>
<h3 id="bugfixes-5"><a class="header" href="#bugfixes-5">Bugfixes</a></h3>
<ul>
<li>
<p>Calling <code>self.__init__()</code> now results in a nice error instead of a panic in the yul compilation stage. (<a href="https://github.com/ethereum/fe/issues/468">#468</a>)</p>
</li>
<li>
<p>Fixed an issue where certain expressions were not being moved to the correct location. (<a href="https://github.com/ethereum/fe/issues/493">#493</a>)</p>
</li>
<li>
<p>Fixed an issue with a missing return statement not properly detected.</p>
<p>Previous to this fix, the following code compiles but it should not:</p>
<pre><code>contract Foo:
pub fn bar(val: u256) -> u256:
if val > 1:
return 5
</code></pre>
<p>With this change, the compiler rightfully detects that the code is missing
a <code>return</code> or <code>revert</code> statement after the <code>if</code> statement since it is not
guaranteed that the path of execution always follows the arm of the <code>if</code> statement. (<a href="https://github.com/ethereum/fe/issues/497">#497</a>)</p>
</li>
<li>
<p>Fixed a bug in the analyzer which allowed tuple item accessor names with a leading 0,
resulting in an internal compiler error in a later pass. Example: <code>my_tuple.item001</code>.
These are now rejected with an error message. (<a href="https://github.com/ethereum/fe/issues/510">#510</a>)</p>
</li>
<li>
<p>Check call argument labels for function calls.</p>
<p>Previously the compiler would not check any labels that were used
when making function calls on <code>self</code> or external contracts.</p>
<p>This can be especially problematic if gives developers the impression
that they could apply function arguments in any order as long as they
are named which is <strong>not</strong> the case. </p>
<pre><code>contract Foo:
pub fn baz():
self.bar(val2=1, doesnt_even_exist=2)
pub fn bar(val1: u256, val2: u256):
pass
</code></pre>
<p>Code as the one above is now rightfully rejected by the compiler. (<a href="https://github.com/ethereum/fe/issues/517">#517</a>)</p>
</li>
</ul>
<h3 id="improved-documentation"><a class="header" href="#improved-documentation">Improved Documentation</a></h3>
<ul>
<li>
<p>Various improvements and bug fixes to both the content and layout of the specification. (<a href="https://github.com/ethereum/fe/issues/489">#489</a>)</p>
</li>
<li>
<p>Document all remaining statements and expressions in the spec.</p>
<p>Also added a CI check to ensure code examples in the documentation
are validated against the latest compiler. (<a href="https://github.com/ethereum/fe/issues/514">#514</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-4"><a class="header" href="#internal-changes---for-fe-contributors-4">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>Separated Fe type traits between crates. (<a href="https://github.com/ethereum/fe/issues/485">#485</a>)</li>
</ul>
<h2 id="070-alpha-galaxite-2021-07-27"><a class="header" href="#070-alpha-galaxite-2021-07-27">0.7.0-alpha "Galaxite" (2021-07-27)</a></h2>
<h3 id="features-6"><a class="header" href="#features-6">Features</a></h3>
<ul>
<li>
<p>Enable the optimizer by default. The optimizer can still be disabled
by supplying <code>--optimize=false</code> as an argument. (<a href="https://github.com/ethereum/fe/issues/439">#439</a>)</p>
</li>
<li>
<p>The following checks are now performed while decoding data:</p>
<ul>
<li>The size of the encoded data fits within the size range known at compile-time.</li>
<li>Values are correctly padded.
<ul>
<li>unsigned integers, addresses, and bools are checked to have correct left zero padding</li>
<li>the size of signed integers are checked</li>
<li>bytes and strings are checked to have correct right padding</li>
</ul>
</li>
<li>Data section offsets are consistent with the size of preceding values in the data section.</li>
<li>The dynamic size of strings does not exceed their maximum size.</li>
<li>The dynamic size of byte arrays (<code>u8[n]</code>) is equal to the size of the array. (<a href="https://github.com/ethereum/fe/issues/440">#440</a>)</li>
</ul>
</li>
<li>
<p>Type aliases can now include tuples. Example:</p>
<pre><code>type InternetPoints = (address, u256)
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/459">#459</a>)</p>
</li>
<li>
<p>Revert with custom errors</p>
<p>Example:</p>
<pre><code>struct PlatformError:
code: u256
pub fn do_something():
revert PlatformError(code=4711)
</code></pre>
<p>Error encoding <a href="https://docs.soliditylang.org/en/v0.8.4/abi-spec.html#errors">follows Solidity</a> which is based on <a href="https://github.com/ethereum/EIPs/issues/838">EIP-838</a>. This means that custom errors returned from Fe are fully compatible with Solidity. (<a href="https://github.com/ethereum/fe/issues/464">#464</a>)</p>
</li>
<li>
<ul>
<li>The builtin value <code>msg.sig</code> now has type <code>u256</code>.</li>
<li>Removed the <code>bytes[n]</code> type. The type <code>u8[n]</code> can be used in its placed and will be encoded as a dynamically-sized, but checked, bytes component. (<a href="https://github.com/ethereum/fe/issues/472">#472</a>)</li>
</ul>
</li>
<li>
<p>Encode certain reverts as panics.</p>
<p>With this change, the following reverts are encoded as <code>Panic(uint256)</code> with
the following panic codes:</p>
<ul>
<li><code>0x01</code>: An assertion that failed and did not specify an error message</li>
<li><code>0x11</code>: An arithmetic expression resulted in an over- or underflow</li>
<li><code>0x12</code>: An arithmetic expression divided or modulo by zero</li>
</ul>
<p>The panic codes are aligned with <a href="https://docs.soliditylang.org/en/v0.8.4/control-structures.html?highlight=Panic#panic-via-assert-and-error-via-require">the panic codes that Solidity uses</a>. (<a href="https://github.com/ethereum/fe/issues/476">#476</a>)</p>
</li>
</ul>
<h3 id="bugfixes-6"><a class="header" href="#bugfixes-6">Bugfixes</a></h3>
<ul>
<li>
<p>Fixed a crash when trying to access an invalid attribute on a string.</p>
<p>Example:</p>
<pre><code>contract Foo:
pub fn foo():
"".does_not_exist
</code></pre>
<p>The above now yields a proper user error. (<a href="https://github.com/ethereum/fe/issues/444">#444</a>)</p>
</li>
<li>
<p>Ensure <code>String<N></code> type is capitalized in error messages (<a href="https://github.com/ethereum/fe/issues/445">#445</a>)</p>
</li>
<li>
<p>Fixed ICE when using a static string that spans over multiple lines.</p>
<p>Previous to this fix, the following code would lead to a compiler crash:</p>
<pre><code>contract Foo:
pub fn return_with_newline() -> String<16>:
return "foo
balu"
</code></pre>
<p>The above code now works as intended. (<a href="https://github.com/ethereum/fe/issues/448">#448</a>)</p>
</li>
<li>
<p>Fixed ICE when using a tuple declaration and specifying a non-tuple type.
Fixed a second ICE when using a tuple declaration where the number of
target items doesn't match the number of items in the declared type. (<a href="https://github.com/ethereum/fe/issues/469">#469</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-5"><a class="header" href="#internal-changes---for-fe-contributors-5">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>
<ul>
<li>Cleaned up ABI encoding internals.</li>
<li>Improved yulc panic formatting. (<a href="https://github.com/ethereum/fe/issues/472">#472</a>)</li>
</ul>
</li>
</ul>
<h2 id="060-alpha-feldspar-2021-06-10"><a class="header" href="#060-alpha-feldspar-2021-06-10">0.6.0-alpha "Feldspar" (2021-06-10)</a></h2>
<h3 id="features-7"><a class="header" href="#features-7">Features</a></h3>
<ul>
<li>
<p>Support for <code>pragma</code> statement</p>
<p>Example: <code>pragma ^0.1.0</code> (<a href="https://github.com/ethereum/fe/issues/361">#361</a>)</p>
</li>
<li>
<p>Add support for tuple destructuring</p>
<p>Example:</p>
<pre><code>my_tuple: (u256, bool) = (42, true)
(x, y): (u256, bool) = my_tuple
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/376">#376</a>)</p>
</li>
<li>
<ol>
<li>Call expression can now accept generic arguments</li>
<li>Replace <code>stringN</code> to <code>String<N></code></li>
</ol>
<p>Example:</p>
<pre><code>s: String<10> = String<10>("HI")
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/379">#379</a>)</p>
</li>
<li>
<ul>
<li>Many analyzer errors now include helpful messages and underlined code.</li>
<li>Event and struct constructor arguments must now be labeled and in the order specified in the definition.</li>
<li>The analyzer now verifies that the left-hand side of an assignment is actually assignable. (<a href="https://github.com/ethereum/fe/issues/398">#398</a>)</li>
</ul>
</li>
<li>
<p>Types of integer literal are now inferred, rather than defaulting to <code>u256</code>.</p>
<pre><code>contract C:
fn f(x: u8) -> u16:
y: u8 = 100 # had to use u8(100) before
z: i8 = -129 # "literal out of range" error
return 1000 # had to use `return u16(1000)` before
fn g():
self.f(50)
</code></pre>
<p>Similar inference is done for empty array literals. Previously, empty array
literals caused a compiler crash, because the array element type couldn't
be determined.</p>
<pre><code>contract C:
fn f(xs: u8[10]):
pass
fn g():
self.f([])
</code></pre>
<p>(Note that array length mismatch is still a type error, so this code won't
actually compile.) (<a href="https://github.com/ethereum/fe/issues/429">#429</a>)</p>
</li>
<li>
<p>The Map type name is now capitalized. Example:</p>
<pre><code>contract GuestBook:
guests: Map<address, String<100>>
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/431">#431</a>)</p>
</li>
<li>
<p>Convert all remaining errors to use the new advanced error reporting system (<a href="https://github.com/ethereum/fe/issues/432">#432</a>)</p>
</li>
<li>
<p>Analyzer throws an error if <code>__init__</code> is not public. (<a href="https://github.com/ethereum/fe/issues/435">#435</a>)</p>
</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-6"><a class="header" href="#internal-changes---for-fe-contributors-6">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>Refactored front-end "not implemented" errors into analyzer errors and removed questionable variants. Any panic is now considered to be a bug. (<a href="https://github.com/ethereum/fe/issues/437">#437</a>)</li>
</ul>
<h2 id="050-alpha-2021-05-27"><a class="header" href="#050-alpha-2021-05-27">0.5.0-alpha (2021-05-27)</a></h2>
<h3 id="features-8"><a class="header" href="#features-8">Features</a></h3>
<ul>
<li>
<p>Add support for hexadecimal/octal/binary numeric literals.</p>
<p>Example:</p>
<pre><code>value_hex: u256 = 0xff
value_octal: u256 = 0o77
value_binary: u256 = 0b11
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/333">#333</a>)</p>
</li>
<li>
<p>Added support for list expressions.</p>
<p>Example:</p>
<pre><code>values: u256[3] = [10, 20, 30]
# or anywhere else where expressions can be used such as in a call
sum: u256 = self.sum([10, 20, 30])
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/388">#388</a>)</p>
</li>
<li>
<p>Contracts, events, and structs can now be empty.</p>
<p>e.g.</p>
<pre><code>event MyEvent:
pass
...
contract MyContract:
pass
...
struct MyStruct:
pass
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/406">#406</a>)</p>
</li>
<li>
<p>External calls can now handle dynamically-sized return types. (<a href="https://github.com/ethereum/fe/issues/415">#415</a>)</p>
</li>
</ul>
<h3 id="bugfixes-7"><a class="header" href="#bugfixes-7">Bugfixes</a></h3>
<ul>
<li>The analyzer will return an error if a tuple attribute is not of the form <code>item<index></code>. (<a href="https://github.com/ethereum/fe/issues/401">#401</a>)</li>
</ul>
<h3 id="improved-documentation-1"><a class="header" href="#improved-documentation-1">Improved Documentation</a></h3>
<ul>
<li>Created a landing page for Fe at https://fe-lang.org (<a href="https://github.com/ethereum/fe/issues/394">#394</a>)</li>
<li>Provide a Quickstart chapter in Fe Guide (<a href="https://github.com/ethereum/fe/issues/403">#403</a>)</li>
</ul>
<h3 id="internal-changes---for-fe-contributors-7"><a class="header" href="#internal-changes---for-fe-contributors-7">Internal Changes - for Fe Contributors</a></h3>
<ul>
<li>
<p>Using insta to validate Analyzer outputs. (<a href="https://github.com/ethereum/fe/issues/387">#387</a>)</p>
</li>
<li>
<p>Analyzer now disallows using <code>context.add_</code> methods to update attributes. (<a href="https://github.com/ethereum/fe/issues/392">#392</a>)</p>
</li>
<li>
<p><code>()</code> now represents a distinct type internally called the unit type, instead of an empty tuple.</p>
<p>The lowering pass now does the following: Valueless return statements are given a <code>()</code> value and
functions without a return value are given explicit <code>()</code> returns. (<a href="https://github.com/ethereum/fe/issues/406">#406</a>)</p>
</li>
<li>
<p>Add CI check to ensure fragment files always end with a new line (<a href="https://github.com/ethereum/fe/issues/4711">#4711</a>)</p>
</li>
</ul>
<h2 id="040-alpha-2021-04-28"><a class="header" href="#040-alpha-2021-04-28">0.4.0-alpha (2021-04-28)</a></h2>
<h3 id="features-9"><a class="header" href="#features-9">Features</a></h3>
<ul>
<li>
<p>Support for revert messages in assert statements</p>
<p>E.g</p>
<pre><code>assert a == b, "my revert statement"
</code></pre>
<p>The provided string is abi-encoded as if it were a call
to a function <code>Error(string)</code>. For example, the revert string <code>"Not enough Ether provided."</code> returns the following hexadecimal as error return data:</p>
<pre><code>0x08c379a0 // Function selector for Error(string)
0x0000000000000000000000000000000000000000000000000000000000000020 // Data offset
0x000000000000000000000000000000000000000000000000000000000000001a // String length
0x4e6f7420656e6f7567682045746865722070726f76696465642e000000000000 // String data
</code></pre>
<p>(<a href="https://github.com/ethereum/fe/issues/288">#288</a>)</p>
</li>
<li>
<p>Added support for augmented assignments.</p>
<p>e.g.</p>
<pre><code>contract Foo:
pub fn add(a: u256, b: u256) -> u256:
a += b
return a
pub fn sub(a: u256, b: u256) -> u256:
a -= b
return a
pub fn mul(a: u256, b: u256) -> u256:
a *= b
return a
pub fn div(a: u256, b: u256) -> u256:
a /= b
return a