Deploying a Smart Contract Using EthersJs and Ganache
Introduction
As an aspiring blockchain developer in the web3 ecosystem, you likely come across new innovative, and cutting-edge technologies revolving around smart contracts, and blockchains.
In this tutorial you will create a dummy smart contract, y...
phensics.hashnode.dev10 min read
Hello, I wanted to thank you for your great help you made it as solid and simple as can be! Although there is in the people.sol a minor mistake. So here is the code by correcting this minor mistake. Really grateful for your help! I wish you a beautiful week!
" // SPDX-License-Identifier: MIT pragma solidity ^0.8.8;
// Initializing the contract contract PeopleProfile { uint256 age;
struct Person { uint256 age; string name; }
Person[] public people;
mapping(string => uint256) public nameToAge;
function store(uint256 _age) public { age = _age; }
function retrieve() public view returns (uint256) { return age; }
function addPerson(string memory _name, uint256 _age) public { people.push(Person(_age, _name)); nameToAge[_name] = _age; } }
"