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
I've encountered an issue when working with the IncreaseAllowance and DecreaseAllowance message and updating expired allowances.
Currently, if I assign an allowance to a spender with an expiration(i.e, valid for 10 blocks), and the spender does not use up this allowance by the time it expires, the expired amount of tokens is still considered when I increase the allowance for the same spender later on. The same is true for decreasing the allowance of the spender with a valid expiration. This results in the spender having a higher amount of valid tokens than intended.
Illustrative example:
Owner A assigns an allowance of 100 tokens to Spender B, valid for 10 blocks.
Spender B does not use the allowance, and it expires.
Owner A then need to assign an additional allowance of 100 tokens to Spender B
Therefore, Owner A uses IncreaseAllowance message and assigns the second allowance of 100 tokens.
However, Spender B now has access to 200 tokens, not 100. The expired allowance has been effectively revived.
I understand that owner can query the actual allowance before increasing or decreasing it to decide the proper amount. However, from my opinion, it would be more logical and intuitive for the expired allowance to be discarded.
One possible solution might be having default allowance if the allowance is expired.
I would love to hear your thoughts on this. Would you consider this as a viable improvement for the CW20 contract?
The text was updated successfully, but these errors were encountered:
Hi Team,
I've encountered an issue when working with the
IncreaseAllowance
andDecreaseAllowance
message and updating expired allowances.Currently, if I assign an allowance to a spender with an expiration(i.e, valid for 10 blocks), and the spender does not use up this allowance by the time it expires, the expired amount of tokens is still considered when I increase the allowance for the same spender later on. The same is true for decreasing the allowance of the spender with a valid expiration. This results in the spender having a higher amount of valid tokens than intended.
Illustrative example:
I understand that owner can query the actual allowance before increasing or decreasing it to decide the proper amount. However, from my opinion, it would be more logical and intuitive for the expired allowance to be discarded.
One possible solution might be having default allowance if the allowance is expired.
I would love to hear your thoughts on this. Would you consider this as a viable improvement for the CW20 contract?
The text was updated successfully, but these errors were encountered: