I need to call an Ethereum solidity smart contract inside a Solana program. Is this possible? If not, is there any alternative to perform this?
-
You may want to checkout Neon (neon-labs.org). I don't believe it's a general-purpose messaging bridge like the one you're looking for (either Wormhole or LayerZero may be able to help you there), but it does allow you to deploy Solidity contracts to Solana.– Nick GarfieldCommented Jan 12, 2023 at 16:02
2 Answers
Depending on the outcome that you want to achieve, using Wormhole's generic messaging layer might be a solution. If you want to chat & explore possibilities, head over to our Discord, get the "builders" role and ask your question in "dev-support".
Disclaimer: I work as a CM at Wormhole :-)
No, it's not possible to call Ethereum solidity smart contract directly inside a Solana program. Solana programs can only access data that lives in the Solana blockchain exclusively.
This is why we use oracles to access off-chain data.
Resources for building/launching a Solana Oracle
Solana programs have no idea about Ethereum smart contracts.
Some solutions involve implementing and deploying the Ethereum smart contract in Solana (e.g. anchor). You can then do a Cross Program Invocation (CPI) into that program from your original Solana program.
CPI from Program A to B via a Rust crate?
Hope this helps!
-
1Thank you! And do you know if there is any solution like the one used in bridges?– cris.solCommented Jan 11, 2023 at 21:15
-
Please create a new post for that question. Thank you. In the meantime, if your question is answered please mark it as answered. solana.stackexchange.com/help/someone-answers– vicyynCommented Jan 11, 2023 at 21:33
-
1I will keep the question open for a few days in case someone provides a solution. If no one provides any solution, I will mark this as answered.– cris.solCommented Jan 11, 2023 at 23:14