You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue involves a poor implementation of the allowance function in the Token SEP-041 interface. While the approve function in SEP-041 allows passing an expiration_ledger:
This can lead to implementations that compile but do not account for expiration_ledger. For example:
fnallowance(e:Env,from:Address,spender:Address) -> i128{let result = storage::get_allowance(&e,&from,&spender);
result.amount}
Proposal
If the TokenInterface is implemented (this could be verified by checking if the trait is imported and implemented), ensure that allowance includes something like:
fnallowance(e:Env,from:Address,spender:Address) -> i128{let result = storage::get_allowance(&e,&from,&spender);if e.ledger().sequence() > result.expiration_ledger{0}else{
result.amount}}
The text was updated successfully, but these errors were encountered:
This issue involves a poor implementation of the allowance function in the Token SEP-041 interface. While the
approve
function in SEP-041 allows passing anexpiration_ledger
:The allowance function only returns the amount:
This can lead to implementations that compile but do not account for expiration_ledger. For example:
Proposal
If the TokenInterface is implemented (this could be verified by checking if the trait is imported and implemented), ensure that allowance includes something like:
The text was updated successfully, but these errors were encountered: