Web3/The Ethernaut

// SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface Buyer { function price() external view returns (uint256);}contract Shop { uint256 public price = 100; bool public isSold; function buy() public { Buyer _buyer = Buyer(msg.sender); if (_buyer.price() >= price && !isSold) { isSold = true; price = _buyer.price(); } }} 얘도 문제를 애매하..
If you can deny the owner from withdrawing funds when they call withdraw() (whilst the contract still has funds, and the transaction is of 1M gas or less) you will win this level.// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract Denial { address public partner; // withdrawal partner - pay the gas, split the withdraw address public constant owner = address(0xA9E); uint256 ti..
// SPDX-License-Identifier: MITpragma solidity ^0.5.0;import "../helpers/Ownable-05.sol";contract AlienCodex is Ownable { bool public contact; bytes32[] public codex; modifier contacted() { assert(contact); _; } function makeContact() public { contact = true; } function record(bytes32 _content) public contacted { codex.push(_content); } func..
To solve this level, you only need to provide the Ethernaut with a Solver, a contract that responds to whatIsTheMeaningOfLife() with the right 32 byte number.Easy right? Well... there's a catch.The solver's code needs to be really tiny. Really reaaaaaallly tiny. Like freakin' really really itty-bitty tiny: 10 bytes at most.Hint: Perhaps its time to leave the comfort of the Solidity compiler mome..
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract Recovery { //generate tokens function generateToken(string memory _name, uint256 _initialSupply) public { new SimpleToken(_name, msg.sender, _initialSupply); }}contract SimpleToken { string public name; mapping(address => uint256) public balances; // constructor constructor(string memory _name, address _cr..
프레딕
'Web3/The Ethernaut' 카테고리의 글 목록