Skip to content

Solidity exercises challenges using using solidity and foundry

Notifications You must be signed in to change notification settings

ialmanzaj/solidity-exercises-solutions

Repository files navigation

Compilation of solutions solved using Solidit/Foundry

Welcome to ialmanzaj's solutions to the challenges using solidity and foundry⛳️.

Contents

  1. Piggy Bank
  2. Seven Eth
  3. King of Eth
  4. Hold
  5. Eth Wallet

00 - Piggy Bank

Anyone can send Ether to this contract. However only the owner can withdraw, upon which the contract will be deleted.

01 - Seven Eth

Become the 7th person to deposit 1 ETH to win 7 ETH. You can deposit 1 ETH at a time. Alice and Bob already has 1 ETH deposited.

02 - King of Eth

Deposit more than previous user to become the king.

03 - Hold

Hodl is a contract where users can deposit ETH but can only withdraw after a certain time has elapsed.

04 - Eth Wallet

05 - Constant Product AMM

Constant product AMM (automated market maker) is a decentralized exchange where 2 tokens are traded.

The price of the tokens are determined by a mathematical equation

06 - WETH Bank Hack

Alice has 10 WETH and deposited 1 WETH into ERC20Bank.

Thinking she might deposit more later, she has set inifinite approval on ERC20Bank.

In other words, ERC20Bank can spend unlimited amount of WETH owned by Alice.

Credits

Solution to challenges by smart-contract-engineer.

About

Solidity exercises challenges using using solidity and foundry

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published