algorandfoundation / puya

https://algorandfoundation.github.io/puya/
Other
91 stars 16 forks source link

auction contract example opt_in method doesn't have opt_in allow actions #307

Open iskysun96 opened 2 months ago

iskysun96 commented 2 months ago

Subject of the issue

https://github.com/algorandfoundation/puya/blob/26e66e7d2ec1945381a49205dcce1de844619c24/examples/auction/contract.py#L62 The opt_in method should have the allow_actions=['OptIn']. Without it, app caller won't be opted in to the contract.

Change code from:

@arc4.abimethod()
def opt_in(self) -> None:
    pass

to

    @arc4.abimethod(allow_actions=["OptIn"])
    def opt_in(self) -> None:
        pass
robdmoore commented 2 months ago

I suspect there's a number of problems with the auction example, it's been copied down from an original one (in beaker?) that was half baked across a few programming languages haha.

Feel free to submit a pull request to resolve this one.

iskysun96 commented 2 months ago

@robdmoore Could you review this PR? I also have a couple questions mentioned in the PR https://github.com/algorandfoundation/puya/pull/311