We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While implementing the weight charging for the token allowance pallet, I noticed that the approve behavior isn't consistent with OpenZeppelin's one.
approve
See Docs: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#IERC20-approve-address-uint256-
Current behavior: https://github.com/pendulum-chain/pendulum/blob/0f6cbb5289d03bd85ab664e7724aba691fea8d81/pallets/orml-currencies-allowance-extension/src/lib.rs#L208C3-L208C3
Expected behavior: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/21bb89ef5bfc789b9333eb05e3ba2b7b284ac77c/contracts/token/ERC20/ERC20.sol#L345 Fixing this should also result in a lower gas cost when regenerating the weights. (no longer need to read before writing)
transfer_from
See Docs: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20-approve-address-uint256-
The text was updated successfully, but these errors were encountered:
Hey team! Please add your planning poker estimate with Zenhub @ashneverdawn @TorstenStueber
Sorry, something went wrong.
ashneverdawn
Successfully merging a pull request may close this issue.
While implementing the weight charging for the token allowance pallet, I noticed that the
approve
behavior isn't consistent with OpenZeppelin's one.1) The current behavior increments the approval, whereas it should overwrite.
See Docs: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#IERC20-approve-address-uint256-
Current behavior: https://github.com/pendulum-chain/pendulum/blob/0f6cbb5289d03bd85ab664e7724aba691fea8d81/pallets/orml-currencies-allowance-extension/src/lib.rs#L208C3-L208C3
Expected behavior: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/21bb89ef5bfc789b9333eb05e3ba2b7b284ac77c/contracts/token/ERC20/ERC20.sol#L345
Fixing this should also result in a lower gas cost when regenerating the weights. (no longer need to read before writing)
2) When approved for the max possible amount,
transfer_from
should treat it as infinity and not decrement it.See Docs: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20-approve-address-uint256-
The text was updated successfully, but these errors were encountered: