Pierre E.blog.pedrojok.com·Apr 15, 2024Damn Vulnerable DeFi | 5 - The RewarderGoals In the The Rewarder challenge, we have to claim all the rewards from the next distribution round, despite having no DVT tokens. A hint points us at a new flashloan pool... See the contracts The Contracts // SPDX-License-Identifier: MIT pragma ...DiscussDamn Vulnerable DeFiethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 14, 2024Damn Vulnerable DeFi | 4 - Side EntranceGoals In the Side Entrance challenge, we have to steal all the ETH from the pool. Flashloans are free, and we start with 1 ETH. See the contracts The Contracts // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "solady/src/utils/SafeTra...DiscussDamn Vulnerable DeFiethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 13, 2024Damn Vulnerable DeFi | 3 - TrusterGoals In the Truster challenge, we have to drain 1 million DVT tokens from the flash loan pool. So pretty high stakes! Let's see how to achieve that. See the contracts The Contracts // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@o...DiscussDamn Vulnerable DeFiethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 12, 2024The Ethernaut CTF Solutions | 31 - StakeGoals The Contract // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Stake { uint256 public totalStaked; mapping(address => uint256) public UserStake; mapping(address => bool) public Stakers; address public WETH; ...DiscussThe Ethernautethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 12, 2024Damn Vulnerable DeFi | 2 - Naive ReceiverGoals In the Naive Receiver challenge, we have to drain the user's contract (the receiver address in hardhat) in a single transaction. Note that we do not need to drain the pool, just the 10 ether from the receiver. See the contracts The Contracts /...DiscussDamn Vulnerable DeFiethereum security
Pierre E.blog.pedrojok.com·Apr 11, 2024The Ethernaut CTF Solutions | 30 - Higher OrderGoals The Contract pragma solidity 0.6.12; contract HigherOrder { address public commander; uint256 public treasury; function registerTreasury(uint8) public { assembly { sstore(treasury_slot, calldataload(4)) ...DiscussThe Ethernautethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 11, 2024Damn Vulnerable DeFi | 1 - UnstoppableDamn Vulnerable DeFi challenges are a bit different from the Ethernaut challenges. They are focused on DeFi, as the name suggests, but they are also a bit more realistic as they involve a lot more contracts and inheritances, while their Ethernaut hom...DiscussDamn Vulnerable DeFiethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 10, 2024The Ethernaut CTF Solutions | 29 - SwitchGoals The Contract This one is a really fun one to finish this series with a super simple goal: Turn the switch on. Unlike the previous Gate Keeper Three, the Switch challenge is far from easy, especially if you are not familiar with calldata and me...DiscussThe Ethernautethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 9, 2024The Ethernaut CTF Solutions | 28 - Gate Keeper ThreeGoals The Contract // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract SimpleTrick { GatekeeperThree public target; address public trick; uint private password = block.timestamp; constructor(address payable _target) { ...DiscussThe Ethernautethereum smart contracts
Pierre E.blog.pedrojok.com·Apr 8, 2024The Ethernaut CTF Solutions | 27 - Good SamaritanGoals The Contract A really fun challenge, with a simple goal and a pretty recent vulnerability introduced that we will need to be aware of from now on! // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import {Address} from "../helpe...DiscussThe Ethernautethereum smart contracts