hello everyone pls i've been trying to write some solidity code for flash loans , im kind of new to it , i would like to know after testing and deploying your smart contract with a test net without doing arbitrage, and the smart contract is deployed successfully how do you deploy it to a main net and would you still pay a little fee in real tokens to deploy in a main net lets say polygon BSC etc pls would someone help me out with some idea ?
4 Answers
This tutorial shows you how to deploy a smart contract to receive and use a flashloan from Aave V3.
This one is a step-by-step guide on how to develop and deploy the smart contract using HardHat. It is based on the Avalanche Fuji testnet, but it can be configured for any chain supported by Aave.
You should definitely always develop it on a testnet before using in on mainnet!
The best approach would be to deploy it to a public testnet like goerli first and try it out there. If it works well then you do exactly the same, maybe changing the contract addresses for the mainnet you'll use before. And yes, you always need to pay gas for the deploy transactions and for the calls you execute to your contract on any network, testnet or mainnet. The only difference is that on testnet the gas coins are fake, but in mainnet the coins are real. Hope this helps.
The easy way to deploy smart contract in EVM based blockchains (like ethereum, binance smart chain, polygon, avax etc) is using remix ide. You can deploy the smart contract in testnet for testing purpose. You have to pay some gas fees for the deployment because miners take fee to verify your contract creation transaction. You can get test BNB in smart chain testnet faucet
I would advice you to try hardhat development environment: https://hardhat.org/
You can use forking feature to fork any of the mainnet networks (like ethereum, polygon, bsc etc) and test your exact implementation with mainnet contracts without needing to pay for gas fees! All you need is archive node, I'm using free alchemy archive nodes: https://www.alchemy.com/
Here is link to forking with hardhat documentation (its rly easy): https://hardhat.org/hardhat-network/docs/guides/forking-other-networks#mainnet-forking
Give it a try, it will change your life :)
-
i tried installing hardhat it says " module not found" after the create a javascript .........." is it from my system or from my command node or the hardhat service– RichMondCommented Jan 27, 2023 at 15:47
-
-
its all here, under getting started: hardhat.org/hardhat-runner/docs/getting-started#overview Commented Jan 30, 2023 at 6:39