tezos-academy
tezos-academy copied to clipboard
Critical bug in FA1.2 impl
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...)
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...