Closed PoCk3T-SPAI closed 1 year ago
Answering to myself thanks to the help of the dev team on Discord:
LzApp has 2 functions for setting trusted remote - setTrustedRemote and setTrustedRemoteAddress. They are interchangeable. Please refer to the contract code. When calling setTrustedRemote you need to supply the pathway (encodePacked(remoteAddress,localAddress)), but when calling setTrustedRemoteAddress you need to supply a remote address. The pathway encoding will be performed in the contract function.
Using setTrustedRemote
ended up working for me.
In Python with ApeX/ape library, it translates into:
from eth_abi.packed import encode_packed
remoteEndpoint = encode_packed(['address', 'address'], [remote_contract_addr, base_contract_deployed.address])
base_contract_deployed.setTrustedRemote(_remote_chain_id, _remoteEndpoint, sender=account)
Hello LayerZero team & community,
Small technical challenge I'm facing here with LZ OFTv2, appreciate any insights or feedbacks anyone would be able to share with me :)
Context:
setTrustedRemoteAddress
function on the base Polygon contract to point to the Optimism remote contract (transaction here)Problem:
sendFrom
on the base contract yields aFail with error 'LayerZero: incorrect remote address size'
error (example in this failed transaction)Question:
sendFrom
, and more precisely, how to format my value for "_toAddress" so it's accepted by LayerZero BaseOFTV2 ?sendFrom
transactions as part of ApeX/ape which is using the underlying eth-abi Python library