LayerZero-Labs / LayerZero-v2

Other
492 stars 312 forks source link

`Executor` contract doesn't support `ReceiveUln302` #58

Closed abhi3700 closed 15 hours ago

abhi3700 commented 2 months ago

In Executor.sol, the initialize function doesn't have _receiveUln302 param, but _receiveUln301.

Code: https://github.com/LayerZero-Labs/LayerZero-v2/blob/1fde89479fdc68b1a54cda7f19efa84483fcacc4/messagelib/contracts/Executor.sol#L28-L42

Is this expected?

Now, during setup (as in deploying Executor), I found this code in the tests: https://github.com/LayerZero-Labs/LayerZero-v2/blob/1fde89479fdc68b1a54cda7f19efa84483fcacc4/messagelib/test/util/Setup.sol#L287-L292

Here, can I include receiveUln302 in the libs?

Moreover, I can see some of the functions like onUpgrade, nativeDropAndExecute301, execute301 are dependent on receiveUln301. So, it's clear that receiveUln301 has to be set in initializer function.

I also found another file - LzExecutor.sol which seems to be a replacement for Executor.sol as it considers receiveUln302 all over. But, then it doesn't have functions - assignJob, getFee.

Can anyone clear my doubts?

bholcomb8 commented 15 hours ago

Those functions are in https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/messagelib/contracts/ExecutorFeeLib.sol