diff --git a/lang10/contracts/contract.yaml b/lang10/contracts/1.0.0/contract.yaml similarity index 100% rename from lang10/contracts/contract.yaml rename to lang10/contracts/1.0.0/contract.yaml diff --git a/lang10/contracts/hello.sympl b/lang10/contracts/1.0.0/hello.sympl similarity index 79% rename from lang10/contracts/hello.sympl rename to lang10/contracts/1.0.0/hello.sympl index 74ced9d..9de9803 100644 --- a/lang10/contracts/hello.sympl +++ b/lang10/contracts/1.0.0/hello.sympl @@ -2,6 +2,7 @@ import prelude version 1.0.0 as prelude import std version 1.0.0 as std import cvm_clientside version 1.0.0 as cvm_clientside +# Our first contract! Says "hello" to the world. @clientside def hello_world() -> str: return "Hello world!" diff --git a/lang10/contracts/1.0.1/contract.yaml b/lang10/contracts/1.0.1/contract.yaml new file mode 100644 index 0000000..2e11e11 --- /dev/null +++ b/lang10/contracts/1.0.1/contract.yaml @@ -0,0 +1,3 @@ +name: hello +version: "1.0.1" +language: 10 diff --git a/lang10/contracts/1.0.1/hello.sympl b/lang10/contracts/1.0.1/hello.sympl new file mode 100644 index 0000000..8cfa923 --- /dev/null +++ b/lang10/contracts/1.0.1/hello.sympl @@ -0,0 +1,15 @@ +import prelude version 1.0.0 as prelude +import std version 1.0.0 as std +import cvm_clientside version 1.0.0 as cvm_clientside + +# Additional imports +import unqualified globals version 1.0.0 +import cvm_executable version 1.0.0 as cvm_executable + +# Our first contract, modified again to show off a few more features. +@clientside +def hello_world(name: str='Alice') -> str: + message = f'Hello {name}!' + if name == "Count Rugen": + message = "Hello. My name is Inigo Montoya. You killed my father. Prepare to die." + return message