![]() ![]() This allows anybody to remove any amount of tokens from the pool without checking the x*y ≥ k. Anyone could call this function to swap 100 token A to 100 token B, and could send only 1 token A and receive back 100 token B. The code marked in the yellow box is what BurgerSwap is missing from its swap() function. The swap() function checks for the x*y ≥ k condition which verifies if the correct amount of tokens were received to do the swap. Problem: BurgerSwap swapping function had a missing require statement which could let anyone remove any amounts from a pool on the protocol. Public Disclosures of Ethereum Clients Bugs: #ethereum #bugs #attacks Smart Contract Security Level Specification: Smart Contract Security Verification Standard: Smart Contract Security Best Practices: Public Registry of Known Bugs & Attacks: Vulnerable Smart Contract Patterns Registry: List of Known Attacks and Common Anti-Patterns: Must-have guides on how not to write smart contracts (no specific order). #blockchain #innovation #learning #programming #language #solidity #klay #blockchaindevelopmentĪ collection of insightful resources with vulnerabilities, bugs, and attacks retrospective. And if you have any questions or feedback, feel free to reach out to me anytime. If you are interested in learning more about solidity interaction with other contracts, check out my post and let me know what you think in the comments. You will learn how to access the kitty data from their smart contract and use it in your own contract. I will use the example of CryptoKitties, a popular game where you can collect and breed digital cats on the blockchain. In this post, I will show you how to interact with external smart contracts in solidity using interfaces, contract addresses and function calls. ![]() But did you know that you can also interact with other smart contracts from your solidity code? This can open up many possibilities for composability, interoperability and innovation in the decentralized space. Solidity is a powerful programming language for smart contracts on Ethereum. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |