Created
June 16, 2020 13:53
-
-
Save mariano-aguero/bbc21c2d0365562cc1f50c37cd58cc30 to your computer and use it in GitHub Desktop.
Proxy example
This file contains hidden or 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
type action is | |
| Increment of (int) | |
| Decrement of (int) | |
| Reset of (unit) | |
type store is unit | |
type return is list (operation) * store | |
const dest : address = ("KT1ExEhdgHTzotFdPsp4mhNC6rqK4h6EKUQu" : address) | |
function main (const action : action; const store : store): return is | |
block { | |
const counter : contract (action) = | |
case (Tezos.get_contract_opt (dest) : option (contract (action))) of | |
Some (contract) -> contract | |
| None -> (failwith ("Contract not found.") : contract (action)) | |
end; | |
const operationProxy : operation = Tezos.transaction (action, 0tez, counter); | |
const operations : list (operation) = list [operationProxy] | |
} with (operations, store) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment