storedNumber
is a public state variable of type uint256
.userData
is a public mapping from an Ethereum (or peaq EVM) address to a string.setNumber()
- to update the stored number.setUserData()
- to write user-specific data into the userData
mapping.setNumber
is called, it changes the storedNumber
variable.setUserData
is called, it sets or updates the string in the mapping for the calling address (msg.sender
).hardhat.config.js
(or truffle-config.js
for Truffle) to point to a peaq EVM endpoint (e.g. https://quicknode.peaq.xyz )npx hardhat run scripts/deploy.js --network yourPeaqNetworkConfig
truffle migrate --network yourPeaqNetworkConfig
_initialNumber
.setNumber
function with a new number. For example, setNumber(42)
.setUserData
function with a string. For example, setUserData("Hello, peaq!")
.structs
or storage packing.