This document explains the solution to the BigenLayer challenge presented in the Challenge.sol
contract.
The vulnerability in this challenge lies in owner's address, which is derived from 1337 as private key.
The solution involves the following steps:
- Discover that the owner's address is derived from the number 1337.
- Call the
adminRequestWithdrawal
function as the owner to withdraw Tim Cook's staked tokens. - Wait for the required 12 seconds.
- Finalize the withdrawal to transfer the tokens to the player's address.
-
The owner's address is generated using:
address owner = vm.addr(uint256(1337));
-
Use this private key to sign transactions as the owner.
-
Call
adminRequestWithdrawal
to request a withdrawal of Tim Cook's staked tokens:bigen.adminRequestWithdrawal(TIM_COOK, 16 * 10**18, PLAYER);
-
Wait for 12 seconds (as required by the contract).
-
Call
finalizeWithdrawal
to complete the transfer:bigen.finalizeWithdrawal(TIM_COOK);
By following these steps, the player can obtain the required tokens and solve the challenge.