-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fe7150
commit 40f93b6
Showing
11 changed files
with
489 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type t = nat; | ||
|
||
export const add = (a: t, b: t): t => a + b; | ||
|
||
export const one: t = 1n; | ||
export const two: t = 2n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type t = nat | ||
|
||
let add (a, b : t * t) : t = a + b | ||
|
||
let one : t = 1n | ||
let two : t = 2n |
9 changes: 9 additions & 0 deletions
9
gitlab-pages/docs/compiling/src/preprocessor/euro_namespace_public.jsligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This file is gitlab-pages/docs/preprocessor/src/import/euro_namespace_public.jsligo | ||
|
||
@public | ||
namespace Euro { | ||
export type t = nat; | ||
export const add = (a: t, b: t) : t => a + b; | ||
export const one: t = 1n; | ||
export const two: t = 2n; | ||
}; |
6 changes: 6 additions & 0 deletions
6
gitlab-pages/docs/compiling/src/preprocessor/import_euro_public.jsligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import "gitlab-pages/docs/compiling/src/preprocessor/euro_namespace_public.jsligo" "Euro_import" | ||
|
||
type euro_balance = Euro_import.Euro.t; | ||
|
||
const add_tip = (s: euro_balance): euro_balance => | ||
Euro_import.Euro.add(s, Euro_import.Euro.one); |
12 changes: 12 additions & 0 deletions
12
gitlab-pages/docs/compiling/src/preprocessor/includereset.jsligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export namespace MyContract { | ||
export type storage = int; | ||
export type result = [list<operation>, storage]; | ||
|
||
@entry const increment = (delta : int, storage : storage) : result => [[], storage + delta]; | ||
|
||
@entry const decrement = (delta : int, storage : storage) : result => [[], storage - delta]; | ||
|
||
#if INCLUDE_RESET | ||
@entry const reset = (_u : unit, _storage : storage) : result => [[], 0]; | ||
#endif | ||
} |
12 changes: 12 additions & 0 deletions
12
gitlab-pages/docs/compiling/src/preprocessor/includereset.mligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module MyContract = struct | ||
type storage = int | ||
type result = operation list * storage | ||
|
||
[@entry] let increment (delta : int) (storage : storage) : result = [],storage + delta | ||
|
||
[@entry] let decrement (delta : int) (storage : storage) : result = [],storage - delta | ||
|
||
#if INCLUDE_RESET | ||
[@entry] let reset () (_storage : storage) : result = [], 0 | ||
#endif | ||
end |
6 changes: 6 additions & 0 deletions
6
gitlab-pages/docs/compiling/src/preprocessor/main_importer.jsligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import "gitlab-pages/docs/compiling/src/preprocessor/euro.jsligo" "Euro" | ||
|
||
type storage = Euro.t; | ||
|
||
const tip = (s : storage) : storage => | ||
Euro.add (s, Euro.one); |
5 changes: 5 additions & 0 deletions
5
gitlab-pages/docs/compiling/src/preprocessor/main_importer.mligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import "gitlab-pages/docs/compiling/src/preprocessor/euro.mligo" "Euro" | ||
|
||
type storage = Euro.t | ||
|
||
let tip (s : storage) : storage = Euro.add (s, Euro.one) |
14 changes: 14 additions & 0 deletions
14
gitlab-pages/docs/compiling/src/preprocessor/ungrouped.mligo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
type storage = | ||
[@layout:comb] | ||
{ tokenPool : nat ; | ||
xtzPool : tez ; | ||
lqtTotal : nat ; | ||
selfIsUpdatingTokenPool : bool ; | ||
freezeBaker : bool ; | ||
manager : address ; | ||
tokenAddress : address ; | ||
#if FA2 | ||
tokenId : nat ; | ||
#endif | ||
lqtAddress : address ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters