Using Truffle
Setting up and launching anDRC20 Token Smart Contract on the Deelance Testnet using Truffle.
Using Truffle
What is Truffle ?
Truffle is a development framework and suite of tools primarily used for building, deploying, and managing smart contracts and decentralized applications (DApps) on blockchain platforms. It provides developers with a set of utilities and commands to streamline the development process and make it easier to work with blockchain technologies.
Configuring the Development Workspace
Before we dive in, ensure you have the following essentials installed: Requirements:
Windows, Linux or Mac OS X
Installing Truffle
After we've set up those tools, we just need a single command to get Truffle:
npm install -g truffleLet's ensure Truffle is correctly installed. Open your terminal and type truffle version. If some error shows up, make sure your computer knows where to find the npm modules.
Create a Project
Our first task is to set up a Truffle project. We'll use TokenDeelance.sol as our guide, demonstrating how to create a token that can be shared between accounts:
Create a new directory for your Truffle project
Initialize your project:
After completing this step, you'll have a project organized with these folders:
contracts/: Directory for Solidity contracts
migrations/: Directory for scriptable deployment files
test/: Directory for test files for testing your application and contracts
truffle-config.js: Truffle configuration file
Create Contract
Create a
PepeDeelance.solfile within thecontracts/:directory.Copy the below code and place it into the
PepeDeelance.solfile:
Create a
1_deploy_contracts.jsfile within themigrations/:directory and insert the following code:
Next, paste the following code into your
truffle-config.jsfile:
To compile your Truffle project, execute the following command:
Deploying DRC20 Contract on Deelance Network
Execute the given command at the base of the project folder:
The contract will deploy on the Deelance Testnet and will appear in your terminal as follows:
Keep in mind that your address, transaction_hash, and other details will vary. The information above is simply to give you a sense of the format.
Well done! You've successfully launched the DRC20 Smart Contract on Deelance Network. You can now engage with the Smart Contract.
Last updated