---
title: "Comment by Den on \"Building a Cross-Chain Swap with LayerZero\" | Hashnode"
description: "Very good tutorial. Couple of fixes to get it work today after some libraries updates^ Due to actual version of OpenZeppelin v5+ its necessary to use 0.8.20+ ve"
url: "https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b/comment/659fa1acd842226d80926512"
---

[Discussion](https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b)

Comment [Building a Cross-Chain Swap with LayerZero](https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b)

[Den](https://hashnode.com/@dnx2k2)

[Jan 11, 2024](https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b/comment/659fa1acd842226d80926512)

Very good tutorial. Couple of fixes to get it work today after some libraries updates^

1.  Due to actual version of OpenZeppelin v5+ its necessary to use 0.8.20+ version of Solidity. 0.8.23 works OK as of now.
    
2.  Because of the same OppenZeppelin major version change it's necessary to add Ownable super class initialization: in file lib/solidity-examples/contracts/lzApp/LzApp.sol change constructor to `constructor(address _endpoint) Ownable(_msgSender()) {      lzEndpoint = ILayerZeroEndpoint(_endpoint);  }`
    
3.  In the scripts section you have to change MyScript name to DeployMumbai and DeploySepolia.
    

[Priyank Gupta](https://hashnode.com/@Genesis0308)

[Jan 11, 2024](https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b/comment/659fa1acd842226d80926512#reply-659faa25f95d9a1afe06a6c6)

Hey thanks mate, you really went through the whole article it seems. I wrote this back when I was trying to seduce layerZero into giving me a job lol.

Also started a dedicated Solidity + Foundry book before I ultimately did not make it into LZ and finally just gave up on Solidity as a whole. Give this on LayerZero a read too:

[solidity-in-foundry.com/Applications/LayerZero/La…](https://www.solidity-in-foundry.com/Applications/LayerZero/LayerZero.html)

I will implement your suggestions as soon as I can.

[Den](https://hashnode.com/@dnx2k2)

[Jan 11, 2024](https://hashnode.com/posts/building-a-cross-chain-swap-with-layerzero/64e71c0ba22cd603433ce60b/comment/659fa1acd842226d80926512#reply-659fb39dd842226d8093609e)

[Priyank Gupta](https://hashnode.com/@Genesis0308) Thanks. Amazing tutorial!
