Links

Creating your Smart Contract

This documentation demonstrates the deployment of smart contract on DeXit Network, using Solidity. @openzeppelin/contracts is used for the demo Solidity script. Remix, Truffle and Hardhat are included in this documentation, feel free to choose one of them. To Deploys as DRC20 smart contract with front-end. You can interact with the smart contract easily! This tutorial is intended to be followed using the online IDE available at
Remix
Setting up Remix IDE for your smart contract Remix IDE is an open source web and desktop application. It fosters a fast development cycle and has a rich set of plugins with intuitive GUIs. Remix is used for the entire journey of contract development as well as act as a playground for learning and teaching EVM base blockchain.
In order to deploy smart contract on Remix IDE
Modify “name”, “symbol”, “decimals” and “totalSupply” according to your requirements
pragma solidity >=0.4.25 <0.6.0;
contract HelloBlockchain
{
//Set of States
enum StateType { Request, Respond}
//List of properties
StateType public State;
address public Requestor;
address public Responder;
string public RequestMessage;
string public ResponseMessage;
// constructor function
constructor(string memory message) public
{
Requestor = msg.sender;
RequestMessage = message;
State = StateType.Request;
}
// call this function to send a request
function SendRequest(string memory requestMessage) public
{
if (Requestor != msg.sender)
{
revert();
}
RequestMessage = requestMessage;
State = StateType.Request;
}
// call this function to send a response
function SendResponse(string memory responseMessage) public
{
Responder = msg.sender;
// call ContractUpdated() to record this action
ResponseMessage = responseMessage;
State = StateType.Respond;
}
}
Above We have sample contract, to deploy smart contract on DeXit Network. By using web3 environment, wallet used Metamask, We will be using Metamask. Please follow this tutorial to setup a Metamask Account.