Contracts Wizard
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide provides step-by-step instructions to deploy any smart contract on the BlockDAG blockchain. You’ll learn how to set up your development environment, write and compile the contract, and deploy it using the BlockDAG IDE Pro.
Wizard Link:
Before you start, ensure you have:
Basic knowledge of Solidity and smart contracts.
An EVM-compatible wallet such as metamask with the BlockDAG network.
Open Metamask: Launch the Metamask extension
Access Network Settings
Click on the Network Selector dropdown at the top of the Metamask interface (usually showing "Ethereum Mainnet" by default).
Select "Add Network" or "Add a Network Manually".
Add a Custom RPC Network: In the "Add a network" screen, click "Add a network manually" to input the custom details.
Fill in Network Details Enter the required blockchain network information:
Network Name: BlockDag.
Chain ID: The unique ID for the BlockDAG blockchain (1043).
Currency Symbol: The native token symbol (BDAG).
Tools: BlockDAG IDE Pro.
To add the BlockDAG network to the metamask, there are 2 options:
Method 1: To add the network with a single click
Connect MetaMask to BlockDAG Network
Open the BlockDAG Explorer.
Click on "Add BlockDAG Network" to automatically connect your wallet to the BlockDAG blockchain.
Method 2: Manually Adding Network
Alternatively, if you want to add the network manually, ensure your MetaMask is upgraded to version 12.9.2 or higher. Enter the following details in MetaMask:
Network Name: BlockDag
Chain ID: 1043
Currency Symbol: BDAG
Confirm Connection: Once the network is added, your MetaMask wallet will connect to the BlockDAG blockchain. Ensure you can see your wallet address and balance.
Open BlockDAG IDE Pro
Visit BlockDAG IDE Pro, link:
To open the File Explorer module, click on the Workspace option in the left-side menu. The File Explorer helps you manage your workspaces and files easily.
You can also right-click on any file or folder to see a menu with quick options for different actions.
Select Contract Navigation Panel
Located on the left-hand side, this panel provides quick navigation between the following key actions:
ERC20: For creating fungible tokens.
ERC721: For creating non-fungible tokens (NFTs).
ERC1155: For multi-token standards.
Stablecoin: For creating pegged assets.
Real-World Asset: For tokenizing tangible assets.
Governor: For building governance contracts.
Settings Panel
Located on the left side of the workspace, this section allows you to customize your smart contract with various options:
Name and Symbol: Specify the token's name and symbol (e.g., "My Token," "MTK").
Pre-mint: Define the initial supply of tokens to be minted upon contract creation.
Features:
Mintable: Enables token minting after deployment.
Burnable: Allows token holders to burn (destroy) tokens.
Pausable: Adds the ability to pause contract functionality in certain scenarios.
Permit: Enables gasless approvals using EIP-2612.
Flash Minting: Supports flash loans with immediate repayment.
Voting Options:
Block Number: Voting based on blockchain block numbers.
Timestamp: Voting based on timestamps.
Access Control:
Ownable: Grants ownership-based access control.
Roles: Enables role-based permissions for contract management.
Managed: Allows for advanced management of contract functionalities.
Upgradeability: Adds support for upgradable contracts.
Code Editor
The central area displays the generated Solidity code based on the selected options in the settings panel.
Users can preview, edit, or copy the code for further modifications.
The editor includes comments and import statements for necessary libraries like ERC20
and ERC20Permit
.
Download Button
Located in the top-right corner, the "Download" button lets you export the generated Solidity code file for external use.
Copy Button
Located in the top-right corner, the "Copy" button lets you copy the code easily.
Choose a Contract Type
Select the desired contract type (e.g., ERC20) from the tabs at the top.
Configure Contract Settings
Enter the Name and Symbol for your token.
Adjust additional settings like pre-minting, mintability, burnability, and more, depending on your use case.
Customize Access Control
Enable access control mechanisms such as ownership or roles.
Configure voting mechanisms based on block numbers or timestamps if applicable.
Preview and Edit the Code
Review the generated Solidity code in the editor.
Make manual changes if necessary to meet advanced or unique requirements.
Download the Code
Once satisfied with the contract, click the "Download" button to save the Solidity file for further compilation or deployment.
The Compile Tab is designed to simplify the compilation process for smart contracts. It ensures compatibility with different Solidity versions and EVM configurations, giving developers flexibility and control.
Select Contract Type
At the top, you will find options for different contract types such as ERC20, ERC721, ERC1155, Stablecoin, Real-World Asset, Governor, and Custom.
Click on the desired contract type to load the associated code template.
Configure Solidity Compiler
Compiler Dropdown:
Choose the Solidity compiler version compatible with your contract requirements (e.g., 0.8.22
or 0.8.19
).
The dropdown allows you to select the compiler version for compatibility with various blockchain networks.
EVM Version Dropdown:
Select the EVM version (e.g., London, Istanbul) to ensure the contract complies with the target blockchain specifications.
View and Edit Code
The main editor displays the Solidity code for your selected contract template.
You can modify the code directly in the editor to customize parameters such as:
Token Name
Symbol
Premint Amount
Compile the Contract
Once you have configured the settings and edited the code:
Click the Compile button to generate the bytecode and ABI (Application Binary Interface).
Comment
A progress indicator will show the compilation status.
Successful Compilation:
If the contract compiles successfully, the interface will display the output.
Comment
Errors or warnings will be highlighted in the editor for easy debugging.
The Deploy Tab simplifies the deployment process for smart contracts, making it user-friendly and efficient. Here's how to navigate and use this section:
Step 1: Connect MetaMask Establishes a secure connection between your MetaMask wallet and BlockDAG IDE Pro for seamless deployment. Click the "Connect With MetaMask" button to link your wallet. Ensure that MetaMask is installed in your browser and you are logged in.
Step 2: Compile Your Contract
Ensure your contract is error-free and compiled successfully in the Compile Tab before proceeding to deployment.
Step 3: Deploy the Contract
Once connected to MetaMask, click the "Deploy" button. Confirm the transaction in MetaMask to initiate deployment.
Wait for the deployment process to complete. A transaction hash will be generated, and the Contract Address field will populate with the address.
Note: Ensure that your MetaMask wallet has sufficient funds for gas fees.
The "Deployed" screen confirms that the contract has been successfully deployed. Once deployment is complete, the contract address will appear in the left-side contract address field, where you can easily copy it for future use.
Step 1: Verify & Publish
Click the Verify & Publish button after deployment. This action validates your contract’s source code and publishes it within BlockDAG IDE Pro, and users don't need to verify the contract on BlockDAG Explorer, allowing users to interact with and review the contract within BlockDAG IDE Pro.
Step 2: Verified
Once the contract is successfully verified and published, the status will update to "Verified". Users can then copy the contract address and search for it on BDAG Scan to check its status in the Contract List screen.
Additionally, users can verify the contract directly on BDAG Scan by clicking the block icon next to the copy button. This will take them to a page where they can generate a flattened file, copy the contract code, and proceed with verification on the BDAG Scan Contract Verification screen.
RPC URL: The endpoint URL for the blockchain for Testnet: ""
Default RPC URL: