Podcast
Questions and Answers
Which of the following is a recommended practice for Solidity contracts?
Which of the following is a recommended practice for Solidity contracts?
- Using different Solidity compiler versions across all contracts.
- Making state changes and external calls within modifiers.
- Using recent versions of Solidity for bug fixes and security checks. (correct)
- Allowing unprotected external/public function calls for easier fund withdrawals.
What is the purpose of locking pragma in Solidity contracts?
What is the purpose of locking pragma in Solidity contracts?
- To ensure contracts are deployed with different compiler versions/flags.
- To avoid mistaken/intentional killing of contract through unprotected selfdestruct calls.
- To prevent unauthorized fund withdrawals by users.
- To ensure contracts are deployed with the same compiler version/flags they were tested with. (correct)
Which of the following is a recommended practice for Solidity constructors?
Which of the following is a recommended practice for Solidity constructors?
- Making state changes and external calls within constructors.
- Checking if the constructor is implemented or removing the call if not. (correct)
- Not implementing constructors at all.
- Using improper naming conventions to avoid security issues.
Flashcards are hidden until you start studying
Study Notes
- Use recent versions of Solidity for bug fixes and security checks.
- Lock pragma to ensure contracts are deployed with the same compiler version/flags they were tested with.
- Use one Solidity compiler version across all contracts.
- Enforce appropriate access control for contract functions executing critical logic.
- Protect against unauthorized fund withdrawals by users through unprotected external/public function calls.
- Protect against mistaken/intentional killing of contract through unprotected selfdestruct calls.
- Modifiers should only implement checks and not make state changes and external calls.
- Make sure modifiers execute _ or revert to avoid unexpected behavior.
- Use proper constructor naming conventions to avoid security issues.
- Check if the constructor is implemented or remove call if not.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.