------------------JAVASCRIPT CONSOLE.LOG()--------------------------------------------
PS D:\hardhat-lottery-fcc> npx hardhat console --network localhost Welcome to Node.js v16.6.2. Type ".help" for more information.
const contract = await ethers.getContract("lottery") undefined console.log(contract.address) 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 undefined
--------------------------------- SOLIDITY CONSOLE.LOG()----------------------------------
----------------------------HARDHAT AND LOCAL HOST-------------------------------------
Wther we deploy on hardhat
(npx hardhat deploy) on localhost
(npx hardhat deploy --network local host) we get the same acoounts in both.
on localhost
it works on nodes
and if we close node
it will be stopped and has to restart again while running the node
again.
the difference would be is in general we use hardhat
and for localhost
we use when we have a couplf of accounts to test
since its gives us 20
accounts.
-----------------------------00-mocks and 01-deploy-------------------------------
whenever we run 01-deploy
hardhat will automatically run 00-mock
first. it works in order like 00
and 01
..
01-deploy
use getContract
to fetch 00-mocks
into 01-deploy
so whenevr we deploy
it always use 01
wthere its for local or testnet or mainchain
.
------------------------------------solhint---------------------------------
-----------------------Javascript objects and variables----------------------------
let's say Car is a object
and its proprties
are
car.name = Fiat, car.model = 500, car.weight = 850kg, car.color = white,
and its methods
are -
car.start(), car.drive(), car.brake(), car.stop()
2- let car
= fiat
// car
is a variable name and fiat
is its value
3- const car = {type:"Fiat", model:"500", color:"white"};
//Objects are variables too. But objects can contain many values.
// car
is a here a object
and has contaning lot of values.
// The name:values pairs in JavaScript objects are called properties:
--------------------------wait.(1)-------------------------------
-----------------------------how contract is gonna work-----------------------------
--------------------DEPLOYED---------------------------------- https://goerli.etherscan.io/address/0x67d000Ab100Cee0224CbF9F71abafD6F45f3E804