Coder Social home page Coder Social logo

foundry-full-course-f23's People

Contributors

0xjarix avatar 0xosiris avatar aayush-gupta-coder avatar allwin199 avatar anaarsonist avatar asobiesk avatar chefaharoni avatar cromewar avatar devblixt avatar devswayam avatar egeaybars123 avatar ethanol48 avatar eversmile12 avatar f3d0ss avatar finessevanes avatar harshh18 avatar lostintime101 avatar osneue avatar pacelliv avatar palmcivet7 avatar patrickalphac avatar robocrypter avatar shikhar229169 avatar sunnystefi avatar thejus-m avatar usmanfarooq91 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  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

foundry-full-course-f23's Issues

OpenZeppelin's Ownable contract updated its constructor

The following question was raised in discussions:

Discussed in #286

Originally posted by Glow-in-the-dark July 8, 2023
in DecentralisedStableCoin.sol, it inherits the 1) ERC20Burnable, which inherits the ERC20, and also the 2) Ownable contract.
However, the constructor of the DecentralizedStableCoin contract, only seems to initiate the constructor of the ERC20() , but not the Ownable() contract, which also have a constructor.

contract DecentralizedStableCoin is ERC20Burnable, Ownable {
    error DecentralizedStableCoin__MustBeMoreThanZero();
    error DecentralizedStableCoin__BurnAmountExceedsBalance();
    error DecentralizedStableCoin__NotZeroAddress();

    constructor () ERC20 ("DecentralizedStableCoin","DSC") {
    }

why is it not something like:

constructor () ERC20("DecentralizedStableCoin","DSC") Ownable(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266){
    }

since under "Ownable.sol", there is a constructor, which is:

    constructor(address initialOwner) {
        _transferOwnership(initialOwner);
    }

My underrstanding is that the child contract inheriting the parent contract, will need to also include the parent's constructor.

Whis is the example:
https://github.com/Cyfrin/foundry-defi-stablecoin-f23/blob/main/src/DecentralizedStableCoin.sol

it inherits both parents, but only instantiate the ERC20 token, and does not include the Ownable's constructor.


There was an update to OpenZeppelin's code two months ago that changed from the code that's used in the course, to what's shown above.
Since the update, address of the owner must be entered manually through the constructor parameter.

I suggest noting this change on YouTube, and I'll also note this in the Decentralized coin repo.

image

why "emit RaffleEnter(PLAYER)" from test?

Lesson

Lesson 9

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/sas02qSFZ74?t=18743

Operating System

Windows

Describe the bug

I am in Lesson 9. In the following test, I don't get why the test need to "emit RaffleEnter(PLAYER)"?

in test/unit/RaffleTest.s.sol

function testEmitsEventOnEntrance() public {
        // Arrange
        vm.prank(PLAYER);

        // Act / Assert
        vm.expectEmit(true, false, false, false, address(raffle));
        
        emit RaffleEnter(PLAYER); // todo: shuoldn't the next call emit?
        raffle.enterRaffle{value: raffleEntranceFee}();
    }

I ask this because the next call "raffle.enterRaffle{value: raffleEntranceFee}()" will emit the event,
in src/Raffle.sol

    function enterRaffle() public payable {
        // require(msg.value >= i_entranceFee, "Not enough value sent");
        // require(s_raffleState == RaffleState.OPEN, "Raffle is not open");
        if (msg.value < i_entranceFee) {
            revert Raffle__SendMoreToEnterRaffle();
        }
        if (s_raffleState != RaffleState.OPEN) {
            revert Raffle__RaffleNotOpen();
        }
        s_players.push(payable(msg.sender));
        // Emit an event when we update a dynamic array or mapping
        // Named events with the function name reversed
        emit RaffleEnter(msg.sender);
    }

hi

hi i have issu whith this command in my terminal

forge create SimpleStorage --rpc-url http://127.0.0.1:7545
 --interactive

when i want to run this command i got this error:

forge create SimpleStorage --rpc-url http://127.0.0.1:7545
--interactive
[⠢] Compiling...
[⠆] Compiling 1 files with 0.8.19
[⠰] Solc 0.8.19 finished in 81.31ms
Compiler run successful!
Error: 
Error accessing local wallet. Did you set a private key, mnemonic or keystore?
Run `cast send --help` or `forge create --help` and use the corresponding CLI
flag to set your key via:
--private-key, --mnemonic-path, --aws, --interactive, --trezor or --ledger.
Alternatively, if you're using a local node with unlocked accounts,
use the --unlocked flag and either set the `ETH_FROM` environment variable to the address
of the unlocked account you want to use, or provide the --from flag with the address directly.
zsh: command not found: --interactive

how can i fix this? please help

FAIL. Reason: call did not revert as expected

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

Operating System

Windows

Describe the bug

i don't know why it's didn't revert!
here is part of test code:

contract FundMeTest is Test {
    // constructor() {

    // }
    FundMe fundMe;
    address SENDER = makeAddr("jaunepr");
    uint256 constant SEND_VALUE = 1 ether;
    uint256 constant SENDER_BALANCE = 10 ether;

    // uint256 constant FUNDERS_INDEX = 0;

    function setUp() external {
        DeployFundMe deployFundMe = new DeployFundMe();
        fundMe = deployFundMe.run();
        vm.deal(SENDER, SENDER_BALANCE);
    }
    modifier funded() {
        vm.prank(SENDER);
        fundMe.Fund{value: SEND_VALUE}();
        _;
    }

    function testOnlyOwnerCanWithdraw() public funded {
        vm.prank(SENDER);
        vm.expectRevert();
        fundMe.Withdraw();
    }

and i use forge test --match-test testOnlyOwnerCanWithdraw -vvv
then, here is ouput:

[FAIL. Reason: call did not revert as expected] testOnlyOwnerCanWithdraw() (gas: 108176)
Traces:
  [108176] FundMeTest::testOnlyOwnerCanWithdraw()
    ├─ [0] VM::prank(jaunepr: [0xD32aC66b047b3Ba085a452E26814BD4F20A99929])
    │   └─ ← ()
    ├─ [81354] FundMe::Fund{value: 1000000000000000000}()
    │   ├─ [8993] MockV3Aggregator::latestRoundData() [staticcall]
    │   │   └─ ← 1, 200000000000 [2e11], 1, 1, 1
    │   └─ ← ()
    ├─ [0] VM::prank(jaunepr: [0xD32aC66b047b3Ba085a452E26814BD4F20A99929])
    │   └─ ← ()
    ├─ [0] VM::expectRevert(custom error f4844814:)
    │   └─ ← ()
    ├─ [6788] FundMe::Withdraw()
    │   ├─ [0] jaunepr::fallback{value: 1000000000000000000}()
    │   │   └─ ← ()
    │   └─ ← ()
    └─ ← call did not revert as expected

Test result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 1.75ms
 
Ran 1 test suites: 0 tests passed, 1 failed, 0 skipped (1 total tests)

Failing tests:
Encountered 1 failing test in test/FundMeTest.t.sol:FundMeTest
[FAIL. Reason: call did not revert as expected] testOnlyOwnerCanWithdraw() (gas: 108176)

Encountered a total of 1 failing tests, 0 tests succeeded

source .env

I am trying to execute a command $ source .env. Also I am in the folder : foundry-simple-storage-f23.Unfortunately it shows: "bash: .env: No such file or directory"
I have checked twice that the .env in the in the Gitignore folder under #Dotenv file
I have saved the .env in the test folder.
May be someone else also have got the same problem? PLease help. Thank you.

lesson:11 Can't Mint with ```make``` after deploying

mint:
	@forge script script/Interactions.s.sol:MintBasicNft $(NETWORK_ARGS)

i was using this where

ifeq ($(findstring --network sepolia,$(ARGS)),--network sepolia)
NETWORK_ARGS := --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY) --broadcast --verify --etherscan-api-key $(ETHERSCAN_API_KEY) -vvvv
endif

but I was still getting an error
while running it maunally without using make mint in the terminal it succeeded don't know why it was not working with make

Originally posted by @highHumann in #402 (reply in thread)

could not install foundry.

Screenshot 2023-08-01 211005
I have tried most of the methods mentioned in the discussions tab. But at the end i got the same output. so i have to open the issue. if any one have a sloution then please discuss , it will be very helpful.

Error with running "forge script"

Hey guys,
I'm having difficulties with the last part of video 1; deploying "SimpleStorage.sol" in foundry; where there is a script to deploy the smart contract.
here is the script from the first video of the course:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

// import {Script} from "../lib/forge-std/src/Script.sol";
import {Script} from "forge-std/Script.sol";
import {SimpleStorage} from "../src/SimpleStorage.sol";

contract DeploySimpleStorage is Script {
    function run() external returns (SimpleStorage) {
        vm.startBroadcast();
        SimpleStorage simpleStorage = new SimpleStorage();
        vm.stopBroadcast();
        return simpleStorage;
    }
}

then when I run "forge script scr/SimpleStorage.sol" in the command line. I get the following error:

[⠊] Compiling...
[⠃] Compiling 22 files with 0.8.21
[⠰] Solc 0.8.21 finished in 4.80s
Compiler run successful!
Error: 
Function `run()` is not implemented in your script.

I have tried the command with other test files but the issue still persists!

anyone has any ideas as to why it keeps referring to "run() " function while it has been defined within the script!

Lesson 6 : Ganache URL not connecting while deploying SimpleStorage contract

Discussed in #1282

Originally posted by Meherabhossen January 4, 2024
im getting error on this

[⠊] Compiling...
No files changed, compilation skipped
Error: 
error sending request for url (http://127.0.0.1:7545/): error trying to connect: tcp connect error: Connection refused (os error 111)

Context:
- Error #0: error trying to connect: tcp connect error: Connection refused (os error 111)
- Error #1: tcp connect error: Connection refused (os error 111)
- Error #2: Connection refused (os error 111)

this is my command

forge create SimpleStorage --rpc-url http://127.0.0.1:7545 --interactive
```</div>

Trying to create a new project in foundry. Error 'init' is not a valid subcommand

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/umepbfKp5rI?t=25276

Operating System

macOS (Intel)

Describe the bug

Hi everyone,
I have ran forge init and I'm getting the following error message. Can't figure out how to get over this issue and would love help. Thanks.

jordanbishop@Jordans-MacBook-Pro foundry-simple-storage-f23 % forge init                    
──────────────
✖ 'init' is not a valid subcommand. See 'forge --help'
──────────────
ℹ Did you mean this?
  - forge join
  - forge asset
  - forge config
  - forge help
  - forge install
  - forge logs
  - forge ls
  - forge ps
  - forge start
  - forge stop
  - forge tx
  - forge use
  - forge web

I also ran forge which and got the following.

jordanbishop@Jordans-MacBook-Pro foundry-simple-storage-f23 % which forge
/usr/local/bin/forge

Modulo calculation examples are wrong

Lesson

Lesson 9

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=sas02qSFZ74&t=14654s

Describe the bug

In video, Lesson 9, Chapter Chainlink VRF Recap where you explain modulo (timestamp 4:04:27),

you mention some modulo calculations that are wrong:

2 % 3 = 1  // This is WRONG! Correct result is 2
2 % 6 = 0  // This is WRONG! Correct result is 2
2 % 7 = 1  // This is WRONG! Correct result is 2

I assume you wanted to say:

3 % 2 = 1
6 % 2 = 0
7 % 2 = 1

Lesson 6 Foundry installation error

"Seems like Windows and Ubuntu WSL have different opinions on 'forge --version'. On Windows, it's all 'I got this,' but in WSL, it's like 'What command?'. 🙄 Any tips for syncing up these two worlds or should I just stick to the 'normal' terminal in VS Code? 🤔

Add .srt subtitles

Describe the enhancement

I have a subtitles folder where I will put the "raw" AI-generated subtitles. If someone would like to edit them, I will then upload them to YouTube so others can watch and understand easier!

Chapter 7 Readme Update

Describe the enhancement

Make File Command From Chapter 7 Is not working for some users.

The Install Make Command for Users who have installed Ubantu as a VM in Windows was not working; hence, I wanted to add the alternative link, which is from the official documentation with a tutorial.

Reason: Assertion failed.] testFailWithoutEnoughEth() (gas: 22948)

Lesson

Lesson 7

https://www.youtube.com/watch?v=sas02qSFZ74)

No response

Operating System

Windows

Describe the bug

here i am trying to run test using forge test.

fund me.sol
function fund() public payable {
        if (msg.value.conversionRate(s_priceFeed) < MINIMUM_USD) {
            revert Not_Sufficient_Amount();
        }```

test.sol
```   function testFailWithoutEnoughEth() public {
        // this test supposed to be passed when we don't have enough eth to
        vm.expectRevert(); // the next line should revert
        fundMe.fund(); // here we are trying to send the zero eth to
    }```

this test should be passed as i am using vm.expectRevert() here why this test failing

Interact with SmartContract from the bash

Lesson

Lesson 6

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

when i try to call "retreive()" function this error appears
' ' '
(code: 3, message: execution reverted, data: Some(String("0x")))
' ' '

here is my integration script.

here is my integration script.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script, console} from "forge-std/Script.sol";
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {FundMe} from "../src/FundMe.sol";

contract FundFundMe is Script {
    uint256 SEND_VALUE = .1 ether;

    function fundFundMe(address mostrecentDeployment) public {
        FundMe(payable(mostrecentDeployment)).fund{value: SEND_VALUE}();

        console.log("EgtgGE%s", SEND_VALUE);
    }

    function run() external {
        address mostrecentDeployment = DevOpsTools.get_most_recent_deployment(
            "FundMe",
            block.chainid
        );
        console.log("ugh9uq3r9grtgqegffuuuefbufueu");
        vm.startBroadcast();
        fundFundMe(mostrecentDeployment);
        vm.stopBroadcast();
    }
}

and trace are

  [1139609] → new DevOpsTools@0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496
    └─ ← 5692 bytes of code

  [277305] → new FundFundMe@0x34A1D3fff3958843C43aD80F30b94c510645C316
    └─ ← 1164 bytes of code

  [57509] FundFundMe::run()
    ├─ [33494] DevOpsTools::get_most_recent_deployment("FundMe", 31337 [3.133e4]) [delegatecall]
    │   ├─ [0] VM::readDir("./broadcast", 3) [staticcall]
    │   │   └─ ← [("IO error for operation on /home/kalmrigaya/hello_foundry/foundry-fund-me/broadcast: No such file or directory (os error 2)", "/home/kalmrigaya/hello_foundry/foundry-fund-me/broadcast", 0, false, false)]
    │   ├─ [0] VM::toString(31337 [3.133e4]) [staticcall]
    │   │   └─ ← "31337"
    │   └─ ← revert: No run-latest.json file found for specified chain
    └─ ← revert: No run-latest.json file found for specified chain


Gas used: 57509
Error: 
script failed: revert: No run-latest.json file found for specified chain

Originally posted by @sagoto80 in #1181

VULNERABILITY! redeemCollateral and redeemCollateralForDsc need to have isAllowedToken(tokenCollateralAddress) modifier

Lesson

Lesson 12

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/wUjYK5gwNZs?t=8205

Operating System

Windows

Describe the bug

redeemCollateral and redeemCollateralForDsc need to have isAllowedToken(tokenCollateralAddress) modifier

Summary

Everyone can call redeemCollateral and redeemCollateralForDsc with address that is not allowed. This vulnerability may result in a critical error, specifically: [FAIL. Reason: panic: arithmetic underflow or overflow (0x11)]. This error occurs when attempting to subtract an amount from zero in the following code snippet: s_collateralDeposited[from][tokenCollateralAddress] -= amountCollateral;

Code Snippet

https://github.com/Cyfrin/foundry-defi-stablecoin-f23/blob/7dca86be19d3eea563daa599d3c73840eff16437/src/DSCEngine.sol#L151C8-L151C8

https://github.com/Cyfrin/foundry-defi-stablecoin-f23/blob/7dca86be19d3eea563daa599d3c73840eff16437/src/DSCEngine.sol#L166

Tool used

Manual Review

Recommendation

Include isAllowedToken(tokenCollateralAddress) modifier. This will revert if invalid collateral address is passed.

function redeemCollateralForDsc(address tokenCollateralAddress, uint256 amountCollateral, uint256 amountDscToBurn)
        external
        moreThanZero(amountCollateral)
+      isAllowedToken(tokenCollateralAddress)
    {
        _burnDsc(amountDscToBurn, msg.sender, msg.sender);
        _redeemCollateral(tokenCollateralAddress, amountCollateral, msg.sender, msg.sender);
        revertIfHealthFactorIsBroken(msg.sender);
    }

    function redeemCollateral(address tokenCollateralAddress, uint256 amountCollateral)
        external
        moreThanZero(amountCollateral)
+      isAllowedToken(tokenCollateralAddress)
        nonReentrant
    {
        _redeemCollateral(tokenCollateralAddress, amountCollateral, msg.sender, msg.sender);
        revertIfHealthFactorIsBroken(msg.sender);
    }

VSCode can't locate chainlink imports

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

Operating System

None

Describe the bug

Hello,

I'm having a problem with the following line:

import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

Source "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found: File not found. Searched the following locations: "".solidity(6275)

If I use forge build everything works as expected, but vscode "doesn't know" the remapping configuration hence I get the error.

VSCode doesn't show an error if I use:

import {AggregatorV3Interface} from "foundry-fund-me-f24/lib/chainlink-brownie-contracts/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

but then Foundy shows an error.

Is there a way to solve this?

Timestamps

Describe the enhancement

Each section of the video is broken up by a screen that looks like this:
Screenshot 2023-06-06 at 1 28 56 PM

It would be great if we could add timestamps in this repo for each one of these.

I'm trying to deploy the contract, and I'm getting this error: const raw = this.data.get(problem.where).raw?.[problem.from] ^ SyntaxError: Unexpected token '.'

Lesson

Lesson 6

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/umepbfKp5rI?si=UOKIZgpCAJoqP_gP&t=28405

Operating System

Windows

Describe the bug

I have this issue when type "npx thirdweb deploy"

const raw = this.data.get(problem.where).raw?.[problem.from]
                                                     ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/mnt/c/Users/admin/AppData/Roaming/nvm/v19.4.0/node_modules/npm/lib/utils/config/definition.js:33:5)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Lesson 1 Caption: "Layer 2: Any application built on top of a layer 2"

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://www.youtube.com/watch?v=umepbfKp5rI&t=6155s

Describe the bug

Thank you for creating the video! I noticed a small error in the caption in this screenshot - I believe it should say "on top of a Layer 1" rather than what's currently written.
It's not a major issue at all, I just wanted to provide the feedback in case it's helpful for improving the accuracy of the captions for future viewers.
Thank you again for the great work on these educational videos!

image

Seem like we might have problem with getting the total collateral value in USD, if any of our user had deposited the two tokens that our protocol supports(weth, wbtc)

Describe the enhancement

So when we were doing the conversion of user deposited collateral to USD we loop through each token supported by our contract and get the balance of the user for each of them and then went ahead to add it all up to the total collateral deposited , code below

function getTotalCollateralDepositedByUser(address _user) private view returns(uint256 _totalCollateralDeposited){
        for(uint256 i; i < s_protocolSupportedCollateralToken.length; i++){
            address[] memory copied_s_protocolSupportedCollateralToken = s_protocolSupportedCollateralToken;
            address token = copied_s_protocolSupportedCollateralToken[i];
            uint256 balanceOnToken = s_userToAmountDepositedOnVariousCollateralToken[_user][token];
            _totalCollateralDeposited += balanceOnToken;
        }

        return _totalCollateralDeposited;
    }

The above code seem very fine and okay , but lets assume the scenario where a user deposited 1 eth and 2 btc to our protocol, doing the above would help get the total deposited collateral but i think we would have problem when we want to convert the total collateral deposited to USD, the reason being which of the token USD price would we be using ?.

We never ran into that issue during the tutorial because we never deposited wbtc which makes everything turns out as expected.

So i think we are supposed to get the total collateral deposited by a user for each of the supported token store them separately and and then get the equivalent USD price for each of them separately and after getting the USD value for each of the deposited Collateral then we can sum them to have the total collateral deposited by each user in USD. like that we would be calculating the USD value for different token with their respective USD price.

Maybe i am not making sense but thats what i found and i think i should share as @PatrickAlphaC mentions the code would be going through an Audit. Thanks for all you do @PatrickAlphaC.

If this is confirmed to make sense then i would fork the repo and make the amendment, thanks 🙏

Modulo examples error

Lesson

Lesson 9

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/sas02qSFZ74?t=14685

Describe the bug

Love the videos, they have been very helpful. Just noticed a minor error when explaining modulo which might trip someone up if they haven't come across it before. Examples shown on remix in the demo are the wrong way around.

It shows on screen (line 11):

// 2 % 2 = 0. 2 % 3 = 1.      2 % 6 = 0.  2 % 7 = 1

What it should be:

// 2 % 2 = 0. 3 % 2 = 1.      6 % 2 = 0.  7 % 2 = 1

Upload .srt file to YouTube

Describe the enhancement

It would be great if someone could:

  1. Convert the YouTube video -> a transcript (using a tool like Descript to auto convert)
  2. Manually update the transcript where the tool gets it wrong
  3. Send me the .srt file

Then I will add it to YouTube

Constructor of "VRFV2WrapperConsumerBase.sol" has 2 arguments instead of 1

In the video, the constructor takes a single argument: address _vrfCoordinator.
In the updated code of VRFV2WrapperConsumerBase.sol, it takes two.
Namely:
constructor(address _link, address _vrfV2Wrapper) { LINK = LinkTokenInterface(_link); VRF_V2_WRAPPER = VRFV2WrapperInterface(_vrfV2Wrapper); }

Stuck at this point.
Confused as to what it needs as the second argument.

4-Lesson.sol Challenge | Line 40 Typo

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")

No response

Operating System

None

Describe the bug

Line 40 of the 4-Lesson.sol challenge code contains a typo in the "10e10" number:
actualPrice = actualPrice * 10e10;

Should be "1e10":
actualPrice = actualPrice * 1e10;

To pass the challenge, add an extra zero to your answer.
For examlpe, if getPrice() returns:
1637320000000000000000, you need to paste this number plus 0, like this:
16373200000000000000000

@guyInTheChair Did you save the file?

@guyInTheChair Did you save the file?

Originally posted by @alymurtazamemon in #82 (comment)

Mine gave a different error message:

Error: 
Compiler run failed:
Error (7858): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.
  --> script/DeploySimpleStorage.s.sol:16:1:
   |
16 | }
   | ^

ChatGPT tells me this:
"The error is caused by an incomplete import statement. It seems that the SimpleStorage contract is not being imported correctly.

Please make sure that the path to the SimpleStorage.sol file is correct. Double-check that the file is located in the correct directory relative to the DeploySimpleStorage.sol file.

Assuming that the SimpleStorage.sol file is in the ../src/ directory, you should update the import statement as follows:

solidity
Copy code
import {SimpleStorage} from "../src/SimpleStorage.sol";
Make sure the path is correct and try compiling the code again."

That was yesterday. Now I run the exact script (unchanged from yesterday) again, and it compiles successfully. This is the second time I had to quit the program and than continue the next day, and it suddenly works.

Any thoughts as to why?

Lesson 9 fork url error

2(d11ts1)/1^-b^^-2/9 + ddx(Ass.V).dmb
R2 = rm^2 + 2/1 (oh^-eipi^n2-2mf.rsc
n^3x.u'/ r^2, 64pi rnt?d3/4
.int
-L^2 = 0rc . g3/2pi / Am^-pu.u*.lk
z = r^2 v^2 - 2*.zip
3+1/2Nmf = -Aq' . 1/2hco.dnc
Trc . dt^2 = oH
OH = 5Tu' . 3/5q^2
dryHe = Frv^vu^2
10KT = / . 2/1 Api/-pu.ucc
DM = ds^5/4 - pu^-2mû'. -hu!
arcsen^2 = Apu'-mf'/1
5/0- . Mo - ddt^2E = GEo . Q^nk . pEc - Ec2
dt = 3/2j - dc2 . t^h + KPR+-4/27
mu^2 = -t^2 + arcsen r^216pirsc^-2/1
s = -2/1 rsc^2 - TKqu' +DEc
o = -pmiEc't^3/2
a = d-pmu . QPRRct
q = +- -2/1dp (-R)
cos159 = ^8pi^KPR 24/7 + 2/3 pidrt^2ms / r^2arsen3/0
FRmo = Amu + KP445 -r^2h
gcr =dt^3 . -1/2dt

Lesson 6, we can use interactive when we are running scripts

Lesson

Lesson 6

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=umepbfKp5rI&t=27765s

Describe the bug

We can use interactive to enter private key when we are running scripts, instead of --interactive/-i, we can use --interactives <num>/-i <num>, and specify the sender address with --sender

For example :

forge script script/DeploySimpleStorage.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --sender 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -i 1

Link in Lesson 1 not working: Error 406

Describe the enhancement

When going to chain.link/education/defi link in Lesson1 section = `

What have Smart Contracts done so far?` . It is showing that the link is bad, that is its showing error 406. Maybe you can update the link, or I can do so.

Promotion competition! ($6,000 in prizes!)

$6,000 Prize pool

I will budget $5,000 to the top 20 promotions of this course ($250 in ETH each!).

And a grand prize of $1,000 for the best piece of marketing material!

The goal of this is to get developers up to speed on web3. If we are going to get web3 to retail, we need more developers like yourself taking courses like this. So this is your chance to join the fight and make some dope content!

To enter

  1. Wait till the course launches. All entries posted here before the Video is up are disqualified.

  2. Comment on this issue with a link to your

  • TikTok / YouTube shorts
  • Twitter Threads
  • LinkedIn posts
  • YouTube videos
  • Blogs
  • Meme on Reddit
  • Other
  1. In the media (not the comment on this issue), you must include an ARBITRUM address, which I will send at the end of the Judging period. (Sometime in July or August).

  2. I will NOT send money to smart contract-based accounts (It MUST be an EOA).

  3. This issue will be closed July 6th, 2023. That will be the last day to post!

To claim your prize

I will send the payments after the judging period in ETH on ARBITRUM. I will not be responsible for it you mess up sending the address. Sorry.

Judging

July 6th 2023 I'll start judging, and I will award prizes to the following different categories:

  1. Most reach
  2. How funny it is
  3. How many web2 developers take the course based off your content
  4. How good the SEO is
  5. How creative it is

An entry can only win on one of the categories.

I will give out at least 2 awards to each of the following mediums:

  • TikTok / YouTube shorts
  • Twitter Threads
  • LinkedIn posts
  • YouTube videos
  • Blogs
  • Meme on Reddit
  • Something else

So yes, if you have a banger tweet, that's eligible.

Sadly, I don't have time to coordinate a DAO around this, so judging will be 100% my discretion. If you don't like my judging, too bad 😜

Add Steps to Deploy after Private Key Encryption

Describe the enhancement

In Lesson 6,

cast wallet import your-account-name --interactive
Enter private key:
Enter password:
`your-account-name` keystore was saved successfully. Address: address-corresponding-to-private-key

After following the above steps, below step has to be followed

forge script <script> --rpc-url <rpc_url> --account <account_name> --sender <address> --broadcast

This step is missing.

It would be better if the Readme file contains direct link to Link Token Contract.

Describe the enhancement

I was going through readme file In lesson 9 in which we deploy our own Link Token contract for anvil chain ht direct link to the contract was not there. It would be better if its included in the readme file with the time stamp.

image

Video TimeStamp

Link

Github Repo Link that i would like to add

Link

Also the Command to install the solmate package

forge install transmissions11/solmate --no-commit

Missing QR codes for Lesson 12 challenge

Lesson

Lesson 12

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/wUjYK5gwNZs?t=17213

Describe the bug

In the end of Lesson 12 I don't see any QR codes for the usual challenge at the end of every Lesson. I thought that this was intentionally like this.

On the contrary, I found that there is a Challenge 12 on:
Sepolia: https://sepolia.etherscan.io/address/0xe5760847db2f10a74fc575b4803df5fe129811c1#code
Arbitrum: https://arbiscan.io/address/0x3dbbf2f9acfb9aac8e0b31563dd75a2d69148d64#code

So I understand that QR code is missing in the end of Lesson 12 and should be added in an update.

Unnecessary type casting in MoodNft.sol and DeployMoodNft.s.sol contracts

Lesson 11

Operating System

macOS (Apple Silicon)

Describe the bug

Hi to the foundry course community :)

I noticed some unnecessary type castings in 2 contracts.

In MoodNft.sol : https://github.com/Cyfrin/foundry-nft-f23/blob/1e0cb4ed67e79f219889c3fac98fff0e766fd64b/src/MoodNft.sol#L95

casting the result of abi.encodePacked() into a bytes variable (array of bytes) is redondant as abi.encodePacked() result is itself an array of bytes.

Same thing happens in DeployMoodNft.s.sol : https://github.com/Cyfrin/foundry-nft-f23/blob/1e0cb4ed67e79f219889c3fac98fff0e766fd64b/script/DeployMoodNft.s.sol#L41-L43

This time, abi.encodePacked() result, which is of bytes types, is converted to string, and then back to bytes.

I removed these castings and everything compiles and works well.

I can make a PR in the MoodNft repo if you confirm this issue.

Thanks a lot to @PatrickAlphaC for this AMAZING content :) !!!!

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.