aurora-is-near / aurora-engine

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

Feat(xcc): Open access for funding XCC sub-accounts #931

Closed birchmd closed 1 month ago

birchmd commented 1 month ago

Description

Quite a while ago we added the possibility to directly fund an XCC sub-account using a Near function call. The purpose of this function is to enable sponsoring XCC for an address without needing to use bridged wrapped $NEAR (which is somewhat inconvenient to work with).

To make this function work with Aurora Cloud instances, which may not bridge wNEAR at all, the args allow specifying the wNEAR account ID. But the field is optional because on the public Aurora Engine instances you do not need to specify it since the Engine can figure it out independently based on its own configuration.

Previously this XCC funding function was owner-only because if the wNEAR account ID is specified then it must be correct. However, this security restriction is only important if the optional field is actually specified since otherwise the Engine fills in the value itself. This PR makes XCC funding a public function if the wNEAR account ID is not specified.

Performance / NEAR gas cost considerations

N/A

Testing

Existing tests.