Skip to content

Commit

Permalink
feat: simplify contract templates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Jan 31, 2024
1 parent 7822bef commit b5cadcb
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class CoolContract(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class HelloWorld(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class CoolContract(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class HelloWorld(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class CoolContract(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class HelloWorld(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class CoolContract(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from puyapy import ARC4Contract, Bytes
from puyapy.arc4 import String, abimethod
from puyapy import ARC4Contract, arc4


class HelloWorld(ARC4Contract):
@abimethod()
def hello(self, name: String) -> String:
return String.encode(Bytes(b"Hello, ") + name.decode())
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
return "Hello, " + name

0 comments on commit b5cadcb

Please sign in to comment.