I see js programmers compile and call solidity contract without actually deploying it using hardhat and/or similar tools. Do they really can use the contract without deploying on the chain(like swap on uni-swap for real) or it's just test(not real transaction) on local machine. Sorry for my question I'm new to Ethereum dev and i don't know js at all.
1 Answer
In fact, it is not possible to communicate with UniSwap on the main network without deployment on the main network, because we have access to the information and functions on the chain in the smart contract.We cannot, for example, deploy the contract on Polygon and expect to communicate with Ethereum network smart contracts, what you have seen was probably a test on the local network.
-
1
-
hello brother one more question..... 1inch api end "quote", provides best price using different dexs. How to only fetch prices from polygone network? because I planned to deploy my contract on polygone chain because it is very cheap for beginner to practice. Commented Sep 20, 2023 at 9:55
-
You must use the Polygon Chain ID, which is 137, for example, for Ethereum, if you used this link: api.1inch.exchange/v3.0/1/quote, replace 137 instead of one. Commented Sep 20, 2023 at 10:58
-
api.1inch.exchange/v3.0/137/quote ... like this right? Commented Sep 20, 2023 at 11:01
-
1