People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
block.number may not reflect proper timing on other chains. On Arbitrum, this represents the Layer 1 block number and is updated once per minute. This means it can jump from 1000 to 1004. In some cases, calculations can be wrong, especially when using this as a time reference.opcodes. Some chains may have an older version of EVM, such as not having PUSH0 or difficulty being removed in the proof of stake update being changed. tx.origin and msg.sender on the L2 have slightly different meanings. precompiles can be different as well.opcodes. Some chains may have an older version of EVM, such as not having PUSH0 or difficulty being removed in the proof of stake update being changed. tx.origin and msg.sender on the L2 have slightly different meanings. precompiles can be different as well.sendFrom() appeared to be custom. This was used for allowing a user to transfer funds on behalf of another user. Essentially, it was a transferFrom() for cross-chain calls. from address. However, this was NOT used for the verification; only the use. Instead, the allowance check was performed on the sender for the mapping twice! allowances[msg.sender][msg.sender] ended up being performed, after removing from abstraction. So, by allowing yourself, you can steal tokens from another user. Yikes!ret, then the program crashes.alloca() or user controlled increases of the stack frame in other ways. LR register) at the top of the stack frame (highest address), it saves it near the bottom of the frame. This allows for local variables to not be a problem when overwriting vars. Hurray!LR register and other items on the stack. withdraw or deposit assets. The method of keeping track of this is Atokens, which act similar to collateral tokens (cTokens) on other protocols. e-mode (efficiency mode) is an asset that is consistent in price with a pegged value, like USDC. When getting the price of user assets, the program will check to see if the price should be gotten from the default location or the e-mode location. This is done by passing in the collateralPriceSource and debtPriceSource variables.debtPriceSource should be the price source for the e-mode category. This is imposed by the restriction that if a user is in e-mode, they should only be able to borrow assets that belong to this users e-mode. Can this be violated? premium. The user asks for a specific amount, then a percentage is added on top of this for what they are required to pay back. Aave calls a callback function in the users smart contract for this. approval price. Some of the funds will not be sent in this case, resulting in leftover funds that Aave could spend. If a hack occurred of Aave, this would be a bad avenue for exploitation. Additionally, this logs a wrong event.reverts, sadly. This issue is present in the standard template for flashloans on Aave, which makes it more interesting of an issue. tx.data, we need to see if our transaction will go through first or not. If it won't then will "fold" our previous transaction sent to minimize the loss, which is done by checking profitability at run time. We could also raise our gas price to see to try to get the transaction executed first.