-
Notifications
You must be signed in to change notification settings - Fork 2
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
e737e4b
commit 31d2879
Showing
8 changed files
with
4,691 additions
and
4,151 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
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
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,38 @@ | ||
#import "shared.mligo" "Shared" | ||
|
||
type storage = { | ||
batcher_address: address; | ||
tokens: (string,Shared.market_token) big_map; | ||
} | ||
|
||
|
||
|
||
[@inline] | ||
let no_op (s : storage) : result = (([] : operation list), s) | ||
|
||
type entrypoint = | ||
| Mint of Shared.mint_burn_request | ||
| Tick of Shared.mint_burn_request | ||
|
||
|
||
[@inline] | ||
let mint | ||
(mint_request: mint_burn_request) | ||
(storage: storage) : result = | ||
no_op storage | ||
|
||
|
||
[@view] | ||
let getCurrentCirculation (asset, storage : string * storage) = | ||
match Big_map.find_opt asset storage with | ||
| None -> failwith "No rate available" | ||
| Some r -> (r.timestamp, r.value) | ||
|
||
|
||
let main | ||
(action, storage : entrypoint * storage) : operation list * storage = | ||
match action with | ||
| Mint req -> mint req storage | ||
| Burn -> burn storage | ||
|
||
|
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
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,18 @@ | ||
type mint_burn_request = { | ||
name: string; | ||
amount: nat; | ||
} | ||
|
||
type token = [@layout:comb] { | ||
token_id: nat; | ||
name : string; | ||
address : address option; | ||
decimals : nat; | ||
standard : string option; | ||
} | ||
|
||
type market_token = { | ||
circulation: nat; | ||
token: token; | ||
|
||
} |
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
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