Skip to content

solidity related question of lesson-9 #2312

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

You must be logged in to vote

@MasterofBlockchain there is little difference whatsoever if you initialize the variable with its value as a state variable compared to using the constructor to set the value. The slight difference comes with the little dynamic nature of setting the entranceFee value in our deploy script. Passing the value through the constructor make it slightly dynamic that we can easily change the value rather than tampering with the contract code any time there is a change.
However, it is also important to note that once the contract has been deployed we can't change anything even the entranceFee so it is just a matter of the developer's prefences. If you feel like you will set the fee to a specific v…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@TimeKeyRoll
Comment options

Comment options

You must be logged in to vote
4 replies
@TimeKeyRoll
Comment options

@othaime-en
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

Answer selected by TimeKeyRoll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants