Skip to content

Commit

Permalink
Merge pull request #279 from Cyfrin/justin/upd-1092-fix-broken-images…
Browse files Browse the repository at this point in the history
…-on-updraft

Image paths updates
  • Loading branch information
Equious authored Dec 20, 2024
2 parents 3d2694f + aa81ad2 commit a25c4c1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Let's run it!
forge test --mt testBobBalance
```

::image{src='/foundry-erc20s/5-erc20-ai-tests-and-recap/erc20-ai-tests-and-recap1.png' style='width: 100%; height: auto;'}
::image{src='/foundry-erc20s/5-erc20-ai-tests-and-recap/erc20-ai-tests-and-recap1.PNG' style='width: 100%; height: auto;'}

Easy pass. Let's write a couple more tests and then we'll see what AI can do to help us.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ In the above function, we are constraining the amount minted to be greater than
Lo and behold, let's run the functional mint DSC and observe the result.
::image{src='/foundry-defi/21-defi-handler-minting-dsc/defi-handler-minting-dsc1.PNG' style='width: 100%; height: auto;'}
::image{src='/foundry-defi/22-defi-handler-mint-dsc/defi-handler-mint-dsc1.png' style='width: 100%; height: auto;'}
You should notice that we've performed multiple calls without any reverts, and that's exactly what success looks like! Your mint function is now up and running and ready to increase the supply of DSC.
Stay tuned for our next adventure! We hope you are now more comfortable with testing the mechanism used for injecting tokens into the DSC ecosystem.
::image{src='/foundry-defi/21-defi-handler-minting-dsc/defi-handler-minting-dsc2.PNG' style='width: 100%; height: auto;'}
::image{src='/foundry-defi/22-defi-handler-mint-dsc/defi-handler-mint-dsc2.png' style='width: 100%; height: auto;'}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function _revertIfHealthFactorIsBroken(address user){}

`Health Factor` is a concept borrowed from Aave.

::image{src='/foundry-defi/7-defi-mint-dsc/defi-mint-dsc1.png' style='width: 100%; height: auto;'}
::image{src='/foundry-defi/7-defi-mint-dsc/defi-mint-dsc1.PNG' style='width: 100%; height: auto;'}

In addition to the above, we'll need a function which checks an account's `Health Factor`. Let's write that now.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In addition to these, accessing data in `storage` is _much_ more expensive than

I'll draw your attention to the SSTORE and MSTORE

::image{src='/formal-verification-1/10-memory-and-storage/memory-and-storage-2.png' style='width: 75%; height: auto;'}
::image{src='/formal-verification-1/10-memory-and-storage/memory-and-storage-1.png' style='width: 75%; height: auto;'}

We can see clearly to what extent I mean _"more expensive"_. The difference in gas when accessing data in `storage` is **massive.**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ forge snapshot

This is going to run all of our tests, but keep a record of gas costs in a local file named `.gas-snapshot`.

::image{src='/70-huff-yul-and-solidity-gas-comparison/huff-yul-and-solidity-gas-comparison1.png' style='width: 100%; height: auto;'}
::image{src='/formal-verification-1/70-huff-yul-and-solidity-gas-comparison/huff-yul-and-solidity-gas-comparison1.png' style='width: 100%; height: auto;'}

This output file lets us compare the gas costs of each test performed for each of our implementations. We can see things like:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Let's write a `fuzz test` to check if in fact addresses other than the owner are

Foundry will pass this function random addresses to see if the assert holds, based on the number of runs we've configured.

::image{src='/security-section-3/20-missing-access-controls-proof-of-code/access-control1.png' style='width: 100%; height: auto;'}
::image{src='/security-section-3/20-access-control-poc/access-control1.png' style='width: 100%; height: auto;'}

We can see that through 256 runs, our fuzz test passed! So indeed any address was able to call our `setPassword` function!.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Secondly, we need to convert our `findings.md` - a markdown file - into a profes

Let's get started with `determining a finding's severity`.

::image{src='/security-section-3/23-quick-primer/primer1.png' style='width: 100%; height: auto;'}
::image{src='/security-section-3/21-quick-primer/primer1.png' style='width: 100%; height: auto;'}

0 comments on commit a25c4c1

Please sign in to comment.