Blockchain Lab SOHAM KORE Exp 3
Blockchain Lab SOHAM KORE Exp 3
Aim: To study Deployment and publish smart contracts on Ethereum test network.
Theory: A brief description of all contents used for developing smart contract
Smart contracts :
Smart contracts are blocks of code that reside on the blockchain. It is like an Ethereum account but
there is a critical difference between an external account and a smart contract. Unlike a smart
contract, an external account can connect to multiple Ethereum networks (Goerlitestnet, mainnet,
etc.) whereas a smart contract is only specific to one individual network (the network it is deployed
on). When a smart contract is deployed, it creates an instance (contract account) on the network.
One can create multiple instances of a smart contract on the network or multiple networks.
Deployment of a smart contract is done by sending a transaction to the network with bytecode.
Select Remix VM (London) for the ENVIRONMENT. It has ten (10) accounts with 100 dummy
ethers each that you may use for test purposes. Then click the Deploy button:
Now when you scroll to the bottom, you will find the Blockchain contract under Deployed
Contracts. Click the arrow by the deployed contract name to see the functions of the contract that
you can interact with.
There are three (3) functions in the image above that match the three (3) functions we defined in our
smart contract. Remix automatically creates a UI for you to test your contracts as soon as you
deploy them.
How to Test the Smart Contract
We will now test the functions we created to see how they respond.
Click the get Chain button to reveal the blocks in the chain so far:
It returns a tuple, which is a kind of array. Recall that chain is supposed to be an array containing a
list of blocks.
And just as we defined it, it returns a unit. There is just one item in the chain for now, but as you
keep adding more blocks, the number will increase.
Conclusion: Hence, we have successfully Deployed and publish smart contracts on Ethereum test
network.