Task 1 Submission :
Neeraj Choubisa
Posted on June 16, 2023
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 :-
Download and create a Metamask account. Do not share the seed phrase with anyone.
Get some test ether on a dedicated faucet.
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);
}
}
Compile the file with the Solidity 0.8.19 compiler and optimization off.
Connect your metamask account to remix and choose polygon network.
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 ...
Posted on June 16, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.