Links

Deploy Contracts

How to deploy contracts on Sonic builders testnet

At the software level, deploying to Sonic is the same as deploying to the current Opera mainnet or any other compatible networks out there. The only difference is to which network you connect. Use our open Web3 API balancer at https://rpc.sonic.fantom.network/ as the connection endpoint. The number of requests is limited, so please do not overload the connection.
You can use the Sonic builders testnet dashboard at https://public-sonic.fantom.network to obtain an initial amount of native FTM tokens to execute transactions on the network.
Here is an example configuration for Hardhat:
require("@nomicfoundation/hardhat-toolbox");
// Replace this private key with your Sonic account private key
const SONIC_PRIVATE_KEY = "YOUR SONIC TEST ACCOUNT PRIVATE KEY";
module.exports = {
solidity: "0.8.21",
networks: {
sonic: {
url: "https://rpc.sonic.fantom.network/",
accounts: [SONIC_PRIVATE_KEY]
}
}
};
Please make sure to use Solidity build target London (Solidity version 0.8.21 or lower).
To deploy, execute npx hardhat run scripts/deploy.js --network sonic
Please note that the Fantom Sonic builders testnet is a testing playground aimed to showcase the technology capabilities, which means the data stored on the network will be deleted eventually.
© 2024 Fantom Foundation