Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add permit support for stETH #440

Closed
TheDZhon opened this issue Jun 27, 2022 · 4 comments · Fixed by #482
Closed

Add permit support for stETH #440

TheDZhon opened this issue Jun 27, 2022 · 4 comments · Fixed by #482
Labels
next-upgrade Things to pickup for the next protocol upgrade

Comments

@TheDZhon
Copy link
Contributor

TheDZhon commented Jun 27, 2022

stETH, as an ERC-20 conformant token, has support for allowances management (approve and transferFrom).
wstETH, as a wrapper token for stETH, also has support for EIP-2612 (aka permit).

For the sake of better composability and design consistency, it's better to implement permit also for stETH itself.

@TheDZhon
Copy link
Contributor Author

TheDZhon commented Jan 11, 2023

The implementation is tricky for the current (0.4.24) solidity version of stETH.

Technical background
To correctly implement the ERC-2612 standard, one needs to access the CHAINID opcode which was introduced as an assembly function since 0.5.x. Therefore, the possible implementation should be dependent on the externally compiled code (as a library or an external contract, for example) with a more recent solidity version.

@TheDZhon TheDZhon linked a pull request Jan 31, 2023 that will close this issue
@ujenjt ujenjt added the next-upgrade Things to pickup for the next protocol upgrade label Jan 31, 2023
@TheDZhon
Copy link
Contributor Author

The issue has been resolved in Lido V2 (see #482). Apart from this, ERC-1271 is also available for stETH.permit.

@TheDZhon
Copy link
Contributor Author

TheDZhon commented Apr 6, 2023

Decided to re-open because V2 isn't deployed on mainnet yet.

@TheDZhon TheDZhon reopened this Apr 6, 2023
@TheDZhon
Copy link
Contributor Author

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
next-upgrade Things to pickup for the next protocol upgrade
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@TheDZhon @ujenjt and others