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
fix(erc20): adjust ERC20 allowance behavior #2066
Conversation
Addressing failing tests now |
I'm not sure this change is in alignment with the default ERC20 behaviour. It seems the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2066 +/- ##
==========================================
- Coverage 70.16% 70.16% -0.01%
==========================================
Files 340 340
Lines 25453 25455 +2
==========================================
+ Hits 17860 17861 +1
- Misses 6675 6676 +1
Partials 918 918
|
@Vvaradinov agreed, that was the point I was raising in our sync yesterday. The decision we will have to make is between us wanting to allow smart contracts to be able to be used for updating allowances for a granter/grantee combination which would align with our other precompiles or if we want to have the usage of |
After further discussion and research with @Vvaradinov the changes regarding using the transaction origin will be reverted, since that behavior is just like that on the actual OpenZeppelin ERC20 implementations. We must note however, that the resulting behavior on the ERC20 precompile is different from our other precompiles, that include approvals. Here, when calling a smart contract, that in turn calls the |
This reverts commit 06c3c17.
Description
This PR adjusts some characteristics of the ERC20 EVM extension to align with the standard ERC20 smart contracts. The changes were motivated by the results of testing in #2044:
Instead of using thecontract.CallerAddress
for creating and adjusting approvals, we pass thetx.Origin
in order to create the correct approvals between the users. Currently, the approvals are instead created between a calling smart contract and the grantee, instead of the desired granter to grantee.