DEV Community

Neeraj Choubisa
Neeraj Choubisa

Posted on

Task 1 Submission :


Will have to deploy and verify a “Hello world” smart contract on Any Network .
We have to verify and deploy the code .

Building Steps Contract :-

  1. Download and create a Metamask account. Do not share the seed phrase with anyone.

  2. Get some test ether on a dedicated faucet.

  3. Go to remix, create a new file, and paste the following code:

pragma solidity 0.8.19;

contract HelloWorld {
   string public greet;

   constructor(string memory name) {
       require(bytes(name).length > 0, "name can't be empty");

       greet = string.concat("Hello world, my name is ", name);
   }
}

Enter fullscreen mode Exit fullscreen mode
  1. Compile the file with the Solidity 0.8.19 compiler and optimization off.

  2. Connect your metamask account to remix and choose polygon network.

  3. Deploy the contract to Polygon and provide your name to the smart contract constructor.

Follow the instructions there and verify the contract:

  • Compiler Type is "Solidity (Single file)".
  • License Type is "No License".
  • Constructor arguments ABI-encoded can be obtained here. Use the “string” constructor argument to get the encoding.

Follow the instructions in remix and verify the contract. The hex encoding can be obtained here. Use the “string” constructor argument to get the encoding.

Open your contract page again. "Contract" -> "Read contract" -> call the method "greet". You should now get a greeting string with the name you specified when you deployed the contract.

This is how we can Compile , Deploy and Verify The Contract .
Happy Coding ...

Top comments (0)