algorand-royalty-fees icon indicating copy to clipboard operation
algorand-royalty-fees copied to clipboard

Error compiling pyTeal smartcontract

Open Vytek opened this issue 2 years ago • 0 comments

This is the version of pyTEAL:

Collecting pyteal Downloading pyteal-0.13.0-py3-none-any.whl (183 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 183.6/183.6 kB 27.9 MB/s eta 0:00:00 Collecting py-algorand-sdk Downloading py_algorand_sdk-1.13.1-py3-none-any.whl (159 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 159.0/159.0 kB 38.1 MB/s eta 0:00:00 Collecting pycryptodomex<4,>=3.6.0 Downloading pycryptodomex-3.14.1-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 67.2 MB/s eta 0:00:00 Collecting msgpack<2,>=1.0.0 Downloading msgpack-1.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 323.7/323.7 kB 54.0 MB/s eta 0:00:00 Collecting pynacl<2,>=1.4.0 Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 68.9 MB/s eta 0:00:00 Collecting cffi>=1.4.1 Downloading cffi-1.15.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446.3/446.3 kB 54.9 MB/s eta 0:00:00 Collecting pycparser Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Installing collected packages: msgpack, pycryptodomex, pycparser, cffi, pynacl, py-algorand-sdk, pyteal Successfully installed cffi-1.15.0 msgpack-1.0.3 py-algorand-sdk-1.13.1 pycparser-2.21 pycryptodomex-3.14.1 pynacl-1.5.0 pyteal-0.13.0

Compile error:

python3 src/smart_contract.py src/approval.teal src/clear.teal Traceback (most recent call last): File "/root/algorand-royalty-fees/src/smart_contract.py", line 25, in def defaultTransactionChecks(txnId: Int) -> TealType.none: File "/usr/local/lib/python3.10/dist-packages/pyteal/ast/subroutine.py", line 356, in call return SubroutineFnWrapper( File "/usr/local/lib/python3.10/dist-packages/pyteal/ast/subroutine.py", line 302, in init self.subroutine = SubroutineDefinition( File "/usr/local/lib/python3.10/dist-packages/pyteal/ast/subroutine.py", line 46, in init impl_params, anns, arg_types, byrefs = self._validate() File "/usr/local/lib/python3.10/dist-packages/pyteal/ast/subroutine.py", line 82, in _validate raise TealInputError( pyteal.TealInputError: Function has return of disallowed type TealType.none. Only Expr is allowed

Python Version:

python3 --version Python 3.10.4

Vytek avatar May 25 '22 15:05 Vytek