Git Product home page Git Product logo

security-and-auditing-full-course-s23's People

Contributors

aayush-gupta-coder avatar ae-0h avatar allwin199 avatar alymurtazamemon avatar anaarsonist avatar benleb avatar cromewar avatar equious avatar eversmile12 avatar patrickalphac avatar srihar5ha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

security-and-auditing-full-course-s23's Issues

Small errors in Section1: Review

Lesson

Lesson 1

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://youtu.be/pUWmJ86X_do?si=MzOuDD8K-r8NJu7h&t=5507

Describe the bug

image

In the section 1 of Security and Auditing course after the 12th topic in which Patrick says we'll look at some upgradeable contracts examples in the next video there is no clip of upgradeable contracts in the next video and instead it jumps to selfdestruct and the next video number 14 which is fork test is included in the 13. selfdestruct video only so there is repetition of that on the updraft while on YouTube everything is fine.

SmallProxy.sol does not compile in Remix without adding a Receive function or using 'hide warnings'.

Lesson

Lesson 1

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://youtu.be/pUWmJ86X_do?si=xRf3iXmIybjkJTFL&t=6165

Operating System

Windows

Describe the bug

At this part of the video, the student is encouraged to play with SmallProxy.sol from:
https://github.com/Cyfrin/foundry-upgrades-f23/blob/main/src/sublesson/SmallProxy.sol

  • A link to this repo could be a good value add, instead of the user searching for it.
  • Upon pasting into Remix, contract will not compile until 'hide warnings' is ticked. It may be worth a small comment to inform the user: '// if pasting into Remix, you might need to tick 'hide warnings'

Great course!

Image missing in written lesson

Lesson

Lesson 3

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://updraft.cyfrin.io/courses/security/first-audit/exploit-public-data?lesson_format=transcript

Operating System

Windows

Describe the bug

In section 3 lesson 10, there may be a mistake in the code. In written lessons on the website, there should be images of the code instead, it is displaying the HTML code which should not be happening. When I inspected the code I saw the img tag was in double quotes, may be that is the reason.

image

In Section 7, Lesson 22 jumps back to repeat Lesson 8

Lesson

Lesson 7

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

No response

Describe the bug

In section 7, lesson 22 jumps back to repeat lesson 8 and then proceeds to Lesson 9 instead of Lesson 23.

image image

1.4. Installing Libraries video not found

Video repeated twice

Lesson

Other (please describe)

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://www.youtube.com/watch?v=rjaLKCmQf7g

Describe the bug

The same video (Augmented report with AI) got uploaded for the video titled "Quick primer on what we are learning next" at section 3 lesson 22.

Minor bug: Command line "forge anvil" used instead of "anvil" Lesson 16

Lesson

Other (please describe)

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

No response

Operating System

Windows

Describe the bug


Screenshot (60)
In the written section of Lesson 16 command line "forge anvil" was written which throws error unrecognized sub-command on terminal. The correct command is "anvil," as accurately demonstrated in the corresponding video section.

Boss Bridge Feedback

Describe the enhancement

Arbitrary List:

  • The high level coverage of signatures is fine for the purposes of the content, but it leaves quite a few unanswered questions such as the actual definitions and derivations of the v, r and s values. Expanding with content focused on signatures would be good!

  • MOAR Remix/Vulnerability examples. Seeing the bug in action is awesome.

Order of videos is not matching with the video tiltles

Lesson

Lesson 1

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://updraft.cyfrin.io/courses/security/review/upgradeable-contracts

Describe the bug

In section 1: Review

Instead of upgradeable contracts topic video, it contains video explaining encoding function

Instead of small proxy topic video, it contains video explaining upgradeable contracts

Instead of self destruct topic video, it contains video explaining small proxy

In the section 1, lesson 14 video, it contains video explaining self destruct and fork tests

Suggestion

Describe the bug

It is kinda complicated to work with cyfrin updraft website`s video on half screen mode. You can compare it with Yt - as an opposite i can properly see video in Yt in a same mode. I know i can click the link and open it on Yt as well, but i believe it will be better to do something with UI of website. P.S. Patrick you awesome lecturer <3

In Section 4 Lesson 15, there is an error in the suggested code for detecting duplicate users during the repair process

Discussed in #198

Originally posted by kildren-coder June 18, 2024
At the end of the video, we need to provide suggestions for detecting duplicate users. The approach in the video is correct, but the code provided contains errors.

The code is as follows:

+    mapping(address => uint256) public addressToRaffleId;
+    uint256 public raffleId = 0;
    .
    .
    .
    function enterRaffle(address[] memory newPlayers) public payable {
        require(msg.value == entranceFee * newPlayers.length, "PuppyRaffle: Must send enough to enter raffle");
        for (uint256 i = 0; i < newPlayers.length; i++) {
            players.push(newPlayers[i]);
+            addressToRaffleId[newPlayers[i]] = raffleId;            
        }

-        // Check for duplicates
+       // Check for duplicates only from the new players
+       for (uint256 i = 0; i < newPlayers.length; i++) {
+          require(addressToRaffleId[newPlayers[i]] != raffleId, "PuppyRaffle: Duplicate player");
+       }    
-        for (uint256 i = 0; i < players.length; i++) {
-            for (uint256 j = i + 1; j < players.length; j++) {
-                require(players[i] != players[j], "PuppyRaffle: Duplicate player");
-            }
-        }
        emit RaffleEnter(newPlayers);
    }
.
.
.
    function selectWinner() external {
+       raffleId = raffleId + 1;
        require(block.timestamp >= raffleStartTime + raffleDuration, "PuppyRaffle: Raffle not over");

According to the given code, all players are checked after being added to the array and addressToRaffleId[newPlayers[i]] = raffleId is set. Then, checking require(addressToRaffleId[newPlayers[i]] != raffleId, "PuppyRaffle: Duplicate player") obviously leads to a situation where the require check cannot pass.

We expect that before a player is added to the queue, their raffleId should be checked to see if it matches the raffleId of the current round. If it matches, it means they have already joined this round of the raffle and should not be added again.

Considering the impact of default values, the correct code should be as follows:

+    mapping(address => uint256) public addressToRaffleId;
+    uint256 public raffleId = 1; // raffleId = 0 will lead to fail to add new player
    .
    .
    .
    function enterRaffle(address[] memory newPlayers) public payable {
        require(msg.value == entranceFee * newPlayers.length, "PuppyRaffle: Must send enough to enter raffle");
        for (uint256 i = 0; i < newPlayers.length; i++) {
+            require(addressToRaffleId[newPlayers[i]] != raffleId, "PuppyRaffle: Duplicate player");            
               players.push(newPlayers[i]);
+            addressToRaffleId[newPlayers[i]] = raffleId;            
        }

-        // Check for duplicates
-        for (uint256 i = 0; i < players.length; i++) {
-            for (uint256 j = i + 1; j < players.length; j++) {
-                require(players[i] != players[j], "PuppyRaffle: Duplicate player");
-            }
-        }
        emit RaffleEnter(newPlayers);
    }
.
.
.
    function selectWinner() external {
+       raffleId = raffleId + 1;
        require(block.timestamp >= raffleStartTime + raffleDuration, "PuppyRaffle: Raffle not over");
```</div>

Section 2: broken link into the readme.md file

Describe the enhancement

In the security-and-auditing-full-course-s23 repo:

  • readme.md file
  • Section 2: What is a smart contract audit
  • Smart Contract Development Life Cycle
  • Is this just one step? This returns a 404 page to me.

Alternative way to create PDF Reports

Discussed in #126

Originally posted by allwin199 February 20, 2024
Vs code Extension: Markdown PDF

To create a page with a logo and titles

<!DOCTYPE html>
<html>
<head>
<style>
    .full-page {
        width:  100%;
        height:  100vh; /* This will make the div take up the full viewport height */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .full-page img {
        max-width:  200;
        max-height:  200;
        margin-bottom: 5rem;
    }
    .full-page div{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
</style>
</head>
<body>

<div class="full-page">
    <img src="./logo.svg" alt="Logo">
    <div>
    <h1>Puppy Raffle Protocol Audit Report</h1>
    <h3>Prepared by: Prince Allwin</h3>
    </div>
</div>

</body>
</html>

<!-- Your report starts here! -->
.
.
.

Example of a Report created using this extension

Example of a Markdown file

@PatrickAlphaC Is there any downside to this method?

If there is no downside, we can add this to audit-report-templating and link it in the security-and-auditing-full-course-s23 Readme.

PuppyRaffle - Integer Overflow - selfdestruct mistake?

Lesson

Lesson 4

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://youtu.be/pUWmJ86X_do?t=30463

Describe the bug

PuppyRaffle Audit -> H-3 Integer Overflow -> Proof of Concept -> 4th point:

  1. You will now not be able to withdraw, due to this line in PuppyRaffle::withdrawFees:
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");

Although you could use selfdestruct to send ETH to this contract in order for the values to match and withdraw the fees, this is clearly not what the protocol is intended to do.

I think that last line is a mistake.

As far as I understand selfdestruct can increase a contract's balance. But, address(PuppyRaffle).balance > totalFees after the integer overflow. It makes no sense to increase address(PuppyRaffle).balance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.