Transform an address in a bytes32 or uint256 in Solidity
April 30, 2023
1 min

Table Of Contents

Transform address into uint256
Transform address into bytes32
Why is it useful?

Knowing how to alter the value of Solidity’s variable is helpful as an audit contractor or hacker. It allows you to pass data into a specific attribute that triggers unexpected behavior. And as a hacker, this is what you are looking for. Changing those using Foundry allows you to test multiple cases and see where it can break.

Transform address into uint256


Transform address into bytes32


Why is it useful?

Sometimes, you can send an address and store it into a variable that is not supposed to be that. With a proxy implementation, you can trigger unexpected behavior. You can check that on level 16 of Ethernaut, where you can delegatecall to an attacker address using this method.



Related Posts

The best Web3 browser wallet extensions
October 26, 2022
2 min
© 2023, All Rights Reserved.

Quick Links

Contact Us

Social Media