Posts
avatar

While building @Uniswap V1 from scratch, i found something about how contract balance behaves when you send ETH with a function call. Let's say contract have 10 ETH. You call a payable function with 1 ETH. Inside the function, address(this).balance returns 11 ETH, not 10. The EVM adds any incoming ETH to the balance before it runs any line of the function's code.

This content is for informational and educational purposes only. It may include third-party insights, sponsored content, or promotional material for which the creator may receive compensation. Nothing in this feed constitutes investment advice or a guarantee of returns. You are solely responsible for your own investment decisions. Always conduct your own research and exercise caution before trading. We do not guarantee the accuracy of third-party information and are not liable for any losses incurred. Past performance is not indicative of future results. Please refer to our Community Terms and Risk Disclosure Statement for details.

avatarPost your reply

Comment