aurora-is-near / aurora-engine

⚙️ Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol.
https://doc.aurora.dev/develop/compat/evm
330 stars 82 forks source link

Unwrap NEAR on Aurora->NEAR transfers #750

Closed karim-en closed 1 year ago

karim-en commented 1 year ago

Description

NEAR instead of wNEAR on AuroraStoring native NEAR tokens on aurora account on NEAR - issues:

The solution:

Implementation: Modify the ExitToNear precompile:

Performance / NEAR gas cost considerations

The gas consumption increased a little bit due to a callback call.

Testing

Integration tests are added

How should this be reviewed

The reviewer should focus on the changed components that are described in the implementation section, and verify that the implementation is backward compatible and doesn't break any other components like XCC and refund logic.

joshuajbouw commented 1 year ago

Why treat WNEAR differently than every other ERC-20 bridged token?

sept-en commented 1 year ago

@joshuajbouw this is because $NEAR is a native token in NEAR, and not NEP-141. So this change could allow users to create and/or top-up NEAR accounts easier and in more convenient way (it doesn't require a separate NEAR transaction and thus NEAR gas to unwrap wNEAR from the user).

Also, on NEAR->Aurora transfers of $NEAR we automatically wrap them so users receive wNEAR on Aurora. This PR will allow unwrapping on the way back.

sept-en commented 1 year ago

@karim-en could you please merge the latest changes from the develop branch?

joshuajbouw commented 1 year ago

Looks like CI is still failing.

joshuajbouw commented 1 year ago

Can you resolve conflicts please? Thanks.