algorand / graviton

🧑‍🔬 verify your TEAL program by experiment and observation
MIT License
17 stars 8 forks source link

ABI Method / Routing / Contract functionality #21

Closed tzaffi closed 2 years ago

tzaffi commented 2 years ago

Graviton ABI-Router Functionality

Still working on more test cases but the core functionality for testing ABI Router / ARC-4 compliant programs is in place.

Changes

Issues addressed

Bugs Fixed

Python Support

New Functionality

ABI-Router Bugs? Catalog

Approval Program Routing

These (alleged) bugs were discovered for the approval ABI contract and program generated by PyTeal in compiler_test.py as _router_with_oc

  1. THIS IS NO LONGER CONSIDERED A BUG ~Apart from enforcing txn NumAppArgs > 0, there is no enforcement that the number of arguments provided to a method is the number expected. Strictly speaking, this is not specified in ARC-4 however one can read between the lines in methods and implementing a method and argue that this is the intent. in particular "Invoking a method involves creating an Application call transaction to specifically call that method." seems like it would imply providing exactly the arguments definied in a method's signature.~
    • ~when sub was provided arguments 2837233049, 2497150219, 2497150219 it PASSED instead of rejected (arg[3] was ignored, but should be disallowed IMO)~
    • ~all the other contract methods suffer the same problem. EG add~
    • ~similarly, when all_laid_args which can handle 16 non-selector args by converting the last 2 into a tuple was provided 17 non-selector args, it PASSED. I believe this is a separate issue from the first one which requires a different approach in PyTEAL than the first (i.e., you can't just enforce with txn NumAppArgs; int {NUMBER_OF_ACTUAL_ARGS}; ==; assert)~

Remaining Actions

Tasks

Questions

ARC-4

PyTEAL

Future Work - cf #22