Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic payment smart signature can be used multiple times within the same block #143

Closed
jordan-public opened this issue Dec 7, 2021 · 2 comments
Labels
new-bug Bug report that needs triage Team Scytale

Comments

@jordan-public
Copy link

Subject of the issue

The example smart signature https://github.com/algorand/pyteal/blob/master/examples/signature/periodic_payment.py can be called twice in the same block, thus double-paying the intended amount.

Your environment

Same as the example.

Steps to reproduce

  1. When calling from the client using "acl.send_transaction(lstx)", repeat this twice.
  2. In the block where Txn.first_valid() % tmpl_period == Int(0), this transaction gets executed twice.

Expected behaviour

Single paying (some code should prevent the transaction from running twice within a block).
This could be an assertion that last succesful transaction was more than a block ago.

Actual behaviour

Double-paying within the same period.

@jordan-public jordan-public added the new-bug Bug report that needs triage label Dec 7, 2021
@jasonpaulos
Copy link
Member

@jordan-public the lease field prevents the second transaction from being accepted by the network. See this article for more info: https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/

@jordan-public
Copy link
Author

jordan-public commented Dec 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-bug Bug report that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

4 participants