MENU

Gatekeeper 2

When I first saw the modifier in the picture below, I was in despair.“Ethereum is not something I can do.”If you know how to solve this problem, you are already an expert. I was able to solve this problem only after reading the Ethereum yellow paper.By solving this problem, you will learn about the contract creation process in Ethereum. Sometimes even gates that appear to be highly secure can be passed with the right tools. I share my second “Gatekeeper” game solution. https://github.com/maAPPsDEV/gatekeeper-attack-two
Read More ›

Gatekeeper 1

Function modifier is a good gatekeeper that can protect your function from unexpected behavior.But you should know a few things about function modifiers. Function modifiers can be inefficient.When you add a function modifier, the code of that function is picked up and put in the function modifier in place of the _ symbol. This can also be understood as ‘The function modifiers are inlined”. In normal programming languages, inlining small code is more efficient without any real drawback but Solidity is no ordinary language. In Solidity, the maximum size of a contract is restricted to 24 KB by EIP 170. If the same code is inlined multiple times, it adds up in size and that size limit can be hit easily. Internal functions, on the other hand, are not inlined but called as separate functions. This means they are very slightly more expensive in run time but save a lot of redundant bytecode in deployment. Internal functions can also help avoid the dreaded “Stack too deep Error” as variables created in an internal function don’t share the same restricted stack with the original function, but the variables created in modifiers share the same stack limit. I managed to reduce the […]
Read More ›

Decentralized Public Ledger and Privacy Problem

“Decentralized Public Ledger”, we call it blockchain!The name implies that everything is public, which means again that “private”, “privacy” – those are not the concepts in that world.When you think the data you keep in smart contracts is private, hackers are stealing your precious privacy. I made a Solidity game that will show you how to steal.As long as you know the way hackers use, you can keep your privacy at least in hash. ⚠️ Don’t try it on mainnet. https://github.com/maAPPsDEV/privacy-attack
Read More ›

Bring the elevator up to the top!

Contract Interface specifies the WHAT but not the HOW. Interfaces allow different contract classes to talk to each other.Think of interfaces as an ABI (or API) declaration that forces contracts to all communicate in the same language/data structure.But interfaces do not prescribe the logic inside the functions, leaving the developer to implement his own business layer. Interfaces do not guarantee contract security. Remember that just because another contract uses the same interface, doesn’t mean it will behave as intended! Be careful when inheriting contracts that extend from interfaces. Each layer of abstraction introduces security issues through information obscurity. This makes each generation of the contract less and less secure than the previous. I made a game that shows security risks through interface.In the game, seemly the elevator won’t let you reach the top of your building.But if you understand the interface as described above, you can bring the elevator up to the top. “Too much! Just show me the code?” https://github.com/maAPPsDEV/elevator-attack
Read More ›

Alien Codex

https://github.com/maAPPsDEV/alien-codex-attack
Read More ›

Game of Thrones, Session 9 is open on Ethereum

Game of Thrones Season 9 is open on Ethereum in my github. ???I made a very simple Solidity game: whoever sends it an amount of ether that is larger than the current prize becomes the new king. On such an event, the overthrown king gets paid the new prize, making a bit of ether in the process! As ponzi as it gets ? Such a fun game. Your goal is to become a permanent king. Ready to be a permanent king? ?https://github.com/maAPPsDEV/king-attack
Read More ›

Everything about Solidity Dynamic Array

https://github.com/maAPPsDEV/DynamicArray
Read More ›

Take the money, cat!

Let’s assume that there is a cat (a girl but it’s a smart contract) on the ethereum blockchain.You want to give a tip to her for being together always while you are coding. ???But she doesn’t understand your word.How will you force her to have that money (ETH)? In ethereum world, not only stealing someone else’s money but also giving money to others is not possible always. I made a Solidity game you can play with.Through it, you can learn about a special way to send ETH to a contract, even if the receiving contract has no payable function. Ready?Let’s go: https://github.com/maAPPsDEV/force-attack
Read More ›

delegatecall vs call in Solidity

https://github.com/maAPPsDEV/delegation-attack
Read More ›

In order to prevent Overflow/Underflow

https://github.com/maAPPsDEV/token-attack
Read More ›