how shall I call a solidity function from the front of next.js and the function receive parameter from "prompt" window? #3121
Replies: 1 comment 3 replies
-
Every solidity function has an implied parameter and argument of "msg". From inside a function scope, we have access to msg.sender and msg.value. So assuming you are assigning a value to "entranceFee" correctly in your code, the solidity function "enterRaffle" can access it with msg.value. In this case, the "params" key should be an empty object. const { |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
as I know about this, we should define the function of solidity on the front of next.js, such as below:
and now we should pass parameters to "params" (here is {"a":1,"b":3})and then define the "button" as below:
now when we click on this button, the function "enterRaffle" would run. but how shall we do if I want to pass parameters by "prompt" window when we click on this button?
Beta Was this translation helpful? Give feedback.
All reactions