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

Critical bug in FA1.2 impl #68

Open
tomjack opened this issue Mar 9, 2021 · 1 comment
Open

Critical bug in FA1.2 impl #68

tomjack opened this issue Mar 9, 2021 · 1 comment

Comments

@tomjack
Copy link

tomjack commented Mar 9, 2021

Hello, I noticed a critical bug in the Pascaligo FA1.2 example contract:

unction isAllowed ( const src : address ; const value : amt ; var s : contract_storage) : bool is
  begin
    var allowed: bool := False;
    if sender =/= source then block {
      const src: account = get_force(src, s.ledger);
      const allowanceAmount: amt = get_force(sender, src.allowances);
      allowed := allowanceAmount >= value;
    };
    else allowed := True;
  end with allowed

The code sender =/= source should read sender =/= src.

(I will attempt to get LIGO to finally remove the terrible source operator...)

@tomjack
Copy link
Author

tomjack commented Mar 10, 2021

I just noticed that this example comes from the LIGO repository! Sorry!

I guess maybe it used to be exposed in the "try LIGO" website?

I will delete the example from the LIGO repository...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant