A newsletter meant to inspire the next generation of readers on AI, Blockchain, and Cyber Security.
A newsletter meant to inspire the next generation of readers on AI, Blockchain, and Cyber Security.

Subscribe to DeadLock

Subscribe to DeadLock
Share Dialog
Share Dialog


<100 subscribers
<100 subscribers
This is a quick tutorial to deploy your already developed smart contract that is on EVM to Mantle Network. In this tutorial Metamask is used for wallet, Hardhat is used for framework and Typescript is used for developing the logic. Don't worry if you are not using these tools because it's pretty similar on other tools too.
Here are the step by step tutorial to deploy your existing Ethereum contract on Mantle Network.
Add mental network to your wallet.
If you are using Metamask then you can automatically add Mantle to your wallet with one click by navigating to this Chainlist page, connecting you wallet to the app, and then clicking on the 'Add to Metamask' button that shows up.
if you are on different wallet then add network manually.
Launch your wallet and login to your wallet
The default network setting for the wallet is generally 'Ethereum Mainnet'. Click settings and find option for adding network.
Click on 'Add Network' . This will take you the 'Add a network' page.
Click on 'Add a network manually' to bring up a form
Fill in the following info and click 'Save' to finish. The 'Mantle Testnet' option will appear in the network setting dropdown menu once you're done.
Field Input Value
Network name Mantle Testnet
New RPC URL https://rpc.testnet.mantle.xyz/
Chain ID 5001
Currency symbol BIT
Block explorer URL https://explorer.testnet.mantle.xyz/
Acquiring Test $BIT Token
Mantle uses $BIT as its native token. You can request for tokens at $BIT faucet which is on ETH Goerli. This faucet is an ERC-20 implementation of $BIT, with the addition of a faucet method that can mint tokens for the caller. This token acts as the native token on Mantle.
Edit your existing “hardhat.config.ts” file.
Add the following code snippet in the “network“ section of your “hardhat.config.ts“ file.
"mantle-testnet": {
url: "https://rpc.testnet.mantle.xyz/",
accounts: [process.env.PRIV_KEY]
}Assuming you use hardhat and typescript for development. your final code will be like something like this.
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config()
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
networks: {
"mantle-testnet": {
url: "https://rpc.testnet.mantle.xyz/",
// Uses the private key from the .env file
accounts: [process.env.PRIV_KEY]
}
}
};Deploy your project using mantle network tag.
npx hardhat run scripts/deploy.js --network mantle-testnetThis is a quick tutorial to deploy your already developed smart contract that is on EVM to Mantle Network. In this tutorial Metamask is used for wallet, Hardhat is used for framework and Typescript is used for developing the logic. Don't worry if you are not using these tools because it's pretty similar on other tools too.
Here are the step by step tutorial to deploy your existing Ethereum contract on Mantle Network.
Add mental network to your wallet.
If you are using Metamask then you can automatically add Mantle to your wallet with one click by navigating to this Chainlist page, connecting you wallet to the app, and then clicking on the 'Add to Metamask' button that shows up.
if you are on different wallet then add network manually.
Launch your wallet and login to your wallet
The default network setting for the wallet is generally 'Ethereum Mainnet'. Click settings and find option for adding network.
Click on 'Add Network' . This will take you the 'Add a network' page.
Click on 'Add a network manually' to bring up a form
Fill in the following info and click 'Save' to finish. The 'Mantle Testnet' option will appear in the network setting dropdown menu once you're done.
Field Input Value
Network name Mantle Testnet
New RPC URL https://rpc.testnet.mantle.xyz/
Chain ID 5001
Currency symbol BIT
Block explorer URL https://explorer.testnet.mantle.xyz/
Acquiring Test $BIT Token
Mantle uses $BIT as its native token. You can request for tokens at $BIT faucet which is on ETH Goerli. This faucet is an ERC-20 implementation of $BIT, with the addition of a faucet method that can mint tokens for the caller. This token acts as the native token on Mantle.
Edit your existing “hardhat.config.ts” file.
Add the following code snippet in the “network“ section of your “hardhat.config.ts“ file.
"mantle-testnet": {
url: "https://rpc.testnet.mantle.xyz/",
accounts: [process.env.PRIV_KEY]
}Assuming you use hardhat and typescript for development. your final code will be like something like this.
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config()
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
networks: {
"mantle-testnet": {
url: "https://rpc.testnet.mantle.xyz/",
// Uses the private key from the .env file
accounts: [process.env.PRIV_KEY]
}
}
};Deploy your project using mantle network tag.
npx hardhat run scripts/deploy.js --network mantle-testnet
No activity yet