cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
17 stars 37 forks source link

ENS Libraries #261

Closed guidanoli closed 2 months ago

guidanoli commented 3 months ago

šŸ“š Context

Following the context of #260, users of applications that authenticate through their ENS names might want to withdraw assets from the execution layer to the base layer. To do so, there has to be some ENS name resolution logic running at output execution time.

āœ”ļø Solution

Through DELEGATECALL vouchers (#258), we can create libraries that perform very specific tasks in the context of the application contract. In our case, we'd like to withdraw assets to addresses identified by their ENS names. The supported assets are:

For each of these assets, there will be an associated library that takes the ENS name of the recipient and transfer function arguments (except the recipient address). The library will then resolve the ENS name to an Ethereum address, and perform the transfer safely (*).

(*) In the particular case of ERC-20 tokens, it will check whether transfer returns true.

They will be called: