Skip to content

Hardhat, function and variable are not showing the result #1611

Answered by othaime-en
shakilkhan12 asked this question in Q&A
Discussion options

You must be logged in to vote

There are several errors in your code:
Remove this line from your code: await simple.deployTransaction.wait(2); It causes an unnecessary wait.
Also, you cannot print out the variable store because it is not a number so just try hardcoding the value in your console.log("You have sent <value>") statement
Also you are trying to access a solidity array directly (which is a tricky affair) in an incorrect manner. checkout https://www.geeksforgeeks.org/solidity-arrays/ for more information on how to work with arrays.
I'd recommend using a different methodology/approach altogether to get the value stored.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@othaime-en
Comment options

@shakilkhan12
Comment options

@othaime-en
Comment options

@shakilkhan12
Comment options

@othaime-en
Comment options

Answer selected by shakilkhan12
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants