Giter VIP home page Giter VIP logo

full-blockchain-solidity-course-js's People

Contributors

0xsanyam avatar akashgreninja avatar akshaiim avatar alymurtazamemon avatar bharathmuddada avatar cymatic9 avatar divyanshudeoli avatar eroblaze avatar harendra-shakya avatar jacobwillemsma avatar krakxn avatar lanewhitten avatar marthendalnunes avatar msbivens avatar omniscienthorizon avatar othaime-en avatar patrickalphac avatar pinalikefruit avatar rohitks7 avatar rohitsingh107 avatar rowinvanamsterdam avatar santipu03 avatar scottt avatar shifta-robel avatar technophile-04 avatar uday03meh avatar zeuslawyer 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  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

full-blockchain-solidity-course-js's Issues

LESSON 9: hh deploy [ERROR]

Error: ERROR processing /home/hh-fcc/hardhat-smartcontract-lottery-fcc/deploy/01-deploy-raffle.js:
Error: invalid contract address or ENS name (argument="addressOrName", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.6.2)

======================================================================================

Terminal is returning the above error after deploying mocks when running hh deploy or yarn hardhat deploy [15:19:55]

I was unable to find a solution online & my 01-deploy-raffle.js seems identical from the one in the course. I also have watched the entire lesson from the beginning once again but still unable to figure out the issue.

Does anyone have a suggestion on how to fix this bug, plz?

Originally posted by @DorianDaSilva in #682

Verifying FundMe with Hardhat

I am following the YT video and am at 10:59:00 now thw contract is neither being verified nor any error is being displayed :-)
verify.js is as follow

const {run} = require("hardhat")
const verify = async (contractAddress, args)=>{
    console.log("Veryfing contract" +contractAddress)
    try {
        await run("verify:verify", {
          address: contractAddress,
          constructorArguments: args,
        });
        console.log("verified at "+contractAddress)
      } catch (e) {
        if (e.message.toLowerCase().includes("verified")) {
          console.log("Already Verified");
        } else console.log(e);
      }
}
module.exports = {verify}

Here is the output

sulabh@BTECH2006510:/mnt/c/projects/block/hardhat-fund-me$ yarn hardhat deploy --network rinkeby
yarn run v1.22.15
warning package.json: No license field
$ /mnt/c/projects/block/hardhat-fund-me/node_modules/.bin/hardhat deploy --network rinkeby
Nothing to compile
rinkeby
reusing "FundMe" at 0xEB738b09d9eBF8Ad6F79Dad1269D908eE8a37338
Veryfing contract0xEB738b09d9eBF8Ad6F79Dad1269D908eE8a37338
---------------------------------------
Done in 124.25s.

Question: checkUpkeep

If checkUpkeep is called everytime automatically by keeper and decides on the basis of bool value to call the performUpkeep or not. Then in our raffle contract does it even make sense to call the checkUpkeep again inside performUpkeep ? will it save gas if we don't call it?

function checkUpkeep(bytes calldata /* checkData */) public  override returns(bool upkeepNeeded, bytes memory /* performData */){}

function performUpkeep(bytes calldata /* performData */) external override {
   (bool upkeepNeeded, ) = checkUpkeep("");
}

VRF stuck in Pending.

As per title, for the lottery VRF implementation, I've followed the steps and have been met with the VRF being stuck twice.

Localhost/Hardhat works fine in the unit tests, but the staging is stuck due to Chainlink VRF being unable to go through.

image

Here's the contract address.

Best way to test low level call function

@PatrickAlphaC
How can i test the withdrawProceeds that it should revert with the NftMarketplace__TransferFailed(); error ?

function withdrawProceeds() external {
        uint256 proceeds = s_proceeds[msg.sender];
        if(proceeds <= 0){
            revert NftMarketplace__NoProceeds();
        }

        s_proceeds[msg.sender] = 0;
        (bool success,) = payable(msg.sender).call{value: proceeds}("");
        if(!success){
            revert NftMarketplace__TransferFailed();
        }
    }

LESSON 5 - Verify & Publish error - rinkeby.etherscan

Compiler debug log:
 Error! Unable to generate Contract ByteCode and ABI
 Found the following ContractName(s) in source code : SimpleStorage
 But we were unable to locate a matching bytecode (err_code_2)
 For troubleshooting, you can try compiling your source code with the [Remix - Solidity IDE](https://remix.ethereum.org/) and check for exceptions

I am getting this error message when trying to verify & publish SimpleStorage.sol at the end of the lesson

This is my SimpleStorage contract - Compiled and deployed perfectly (Compiler v0.8.12)

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.8; // 0.8.12 (Latest)

contract SimpleStorage {
    uint256 favoriteNumber;

    mapping(string => uint256) public nameToFavoriteNumber;
    //The string (name) is being mapped to favoriteNumber
    //Index starts iterating at 0

    struct People {
        uint256 favoriteNumber;
        string name;
    }

    People[] public people;

    function store(uint256 _favoriteNumber) public virtual {
        favoriteNumber = _favoriteNumber;
    }

    function retrieve() public view returns(uint256){
        return favoriteNumber;
    }

//calldata, memory, storage
    function addPerson(string memory _name, uint256 _favoriteNumber) public {
        people.push(People(_favoriteNumber, _name));
        nameToFavoriteNumber[_name] = _favoriteNumber; 
    }

}

Thank you!

This seemed to get rid of the TypeError, however, my function getters seem to be returning an empty promise.

This seemed to get rid of the TypeError, however, my function getters seem to be returning an empty promise.

Screen Shot 2022-06-07 at 3 57 47 PM

Screen Shot 2022-06-07 at 3 59 15 PM

Here is my numPlayers code:

const [numPlayers, setNumPlayers] = useState("0");
const { runContractFunction: getNumPlayers } = useWeb3Contract({
    abi: abi,
    contractAddress: raffleAddress, //specify networkId
    functionName: "getNumPlayers",
    params: {},
  });
const numPlayersFromCall = await getNumPlayers().toString();

Originally posted by @RevanthGundala in #165 (reply in thread)

Lesson 7: FundMe.test.js >>> Error: expected 0 constructor arguments, got 2

  FundMe
    constructor
      1) "before each" hook for "sets the aggregator addresses correctly"


  0 passing (754ms)
  1 failing

  1) FundMe
       "before each" hook for "sets the aggregator addresses correctly":
     ERROR processing /home/me/hardhat-fundme-fcc/deploy/00-deploy-mocks.js:
Error: expected 0 constructor arguments, got 2

I am getting this error when running cmd line on FundMe.test.js:

$ yarn hardhat test

00-deploy-mocks.js deployed properly in the previous section & code is identical to the video. Not sure what the issue is, any input is welcome. Thank you!

Lesson 7: Compiler Version Error -> 10:43.16 [SOLVED]

$ /home/ionmind/hardhat-fundme-fcc/node_modules/.bin/hardhat deploy --network rinkeby
Error HH606: The project cannot be compiled, see reasons below.

These files import other files that use a different and incompatible version of Solidity:

  * contracts/test/MockV3Aggregator.sol (^0.8.12) imports @chainlink/contracts/src/v0.6/tests/MockV3Aggregator.sol (^0.6.0)

To learn more, run the command again with --verbose

Read about compiler configuration at https://hardhat.org/config

After getting this error I modified the hardhat.config.js file as instructed on the video

module.exports = {
  //solidity: "0.8.12",
  solidity: {
    compilers: [{ version: "0.8.12" }, { version: "0.6.0" }],
  },

But still getting the error, so I also modified the compiler version in solhint.js file

{
  "extends": "solhint:recommended",
  "rules": {
    "compiler-version": ["error", "^0.8.12", "^0.6.0"],
    "func-visibility": ["warn", { "ignoreConstructors": true }],
    "var-name-mixedcase": "off",
    "avoid-low-level-calls": "off"
  }
}

But still getting the error.

I created a separate AggregatorV2V3Interface file in test folder, locally imported into MockV3Aggregator.sol & also declared solidity version ^0.8.12 for each of the files

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

interface AggregatorInterface {
        //Code Here//
}

interface AggregatorV3Interface {
       //Code Here//
}

interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface {}
//SPDX-License-Identifier:MIT
pragma solidity ^0.8.12;

import "./AggregatorV2V3Interface.sol";

There are no errors or warnings in the code but I still get the same error when trying to compile. I don't get why I seem to be the only person having this compiler issue.

Any help is appreciated. Thank you!

Lesson 7: Compiler Version Error -> 10:43.16

$ /home/ionmind/hardhat-fundme-fcc/node_modules/.bin/hardhat deploy --network rinkeby
Error HH606: The project cannot be compiled, see reasons below.

These files import other files that use a different and incompatible version of Solidity:

  * contracts/test/MockV3Aggregator.sol (^0.8.12) imports @chainlink/contracts/src/v0.6/tests/MockV3Aggregator.sol (^0.6.0)

To learn more, run the command again with --verbose

Read about compiler configuration at https://hardhat.org/config

After getting this error I modified the hardhat.config.js file as instructed on the video

module.exports = {
  //solidity: "0.8.12",
  solidity: {
    compilers: [{ version: "0.8.12" }, { version: "0.6.0" }],
  },

But still getting the error, so I also modified the compiler version in solhint.js file

{
  "extends": "solhint:recommended",
  "rules": {
    "compiler-version": ["error", "^0.8.12", "^0.6.0"],
    "func-visibility": ["warn", { "ignoreConstructors": true }],
    "var-name-mixedcase": "off",
    "avoid-low-level-calls": "off"
  }
}

But still getting the error. I will create a new copy of the contract in test on v0.8.12 and import locally into mockV3Aggregator as a temporary fix but it would be very helpful if someone could help me understand what I am doing wrong here for future references.

Thank you!

Error in a link

Describe the enhancement

Hi Patrick,

First thank you for this amazing content. Especially concerning low level calls, I was struggling finding a good intro and your one is perfect.

In your readme (https://github.com/smartcontractkit/full-blockchain-solidity-course-js), section : Lesson 14 Recap, the link "Knowing and controlling your Smart Contract Address" is redirecting to the same link as "From Solidity to byte code". If you remember the doc you wanted to put, maybe you could try to replace with the correct version :)

Getting compile errors after importing MockV3Aggregater test from node modules

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

https://youtu.be/gyMwXuJrbJQ?list=PLyag8AsLVlQxjlVqS7zs7sbOMzG3hrk5u&t=39181

Operating System

Windows

Describe the bug

Am getting this error after importing the MockV3Aggregator test code from node modules

@chainlink/contracts/src/v0.6/interfaces/AggregatorV2V3Interface.sol:7:38: TypeError: Interfaces cannot inherit.
interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface

I have tried to modifiy the solidity compiler version in hardhat-config file like this but the code wont compile

module.exports = {
  solidity: {
    compilers: [{ version: '0.8.8' }, { version: '0.6.0' }],
  },
  defaultNetwork: 'hardhat',
  networks: {
    ropsten: {
      url: process.env.ROPSTEN_URL || '',
      accounts:
        process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
    },
  },
  gasReporter: {
    enabled: process.env.REPORT_GAS !== undefined,
    currency: 'USD',
  },
  etherscan: {
    apiKey: process.env.ETHERSCAN_API_KEY,
  },
  namedAccounts: {
    deployer: {
      default: 0,
    },
  },
}

Lesson 5:SyntaxError: Source file requires different compiler version

ethers-simple-storage/SimpleStorage.sol:2:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.17+commit.bdeb9e52.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.8;

I get this error on the 1st line
pragma solidity ^0.8.8;

But when i run the command line: solc --version it returns
Version: 0.8.14+commit.80d49f37.Linux.g++

Note that all compiler options have disappeared from settings and manual update of settings.json is not working either. Can anyone tell me what I am missing, plz? This is extremely upsetting...Thank you

Lesson 5 : TypeError : Cannot read properties of undefined (reading `toHexString`)

Lesson

Lesson 5

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/gyMwXuJrbJQ?t=27189

Operating System

Windows

Describe the bug

I could not get Ganache to run properly, so I skipped to hardhat and am having some issues deploying my contract at this phase. Here is the TypeError. I tried googling and searching on the appropriate resources, but can't seem to find the solution.

~/hardhat-fcc/ethers-simple-storage$ node deploy.js
TypeError: Cannot read properties of undefined (reading 'toHexString')
at isHexable (/home/thearkitech/hardhat-fcc/ethers-simple-storage/node_modules/@ethersproject/bytes/lib/index.js:9:21)
at hexlify (/home/thearkitech/hardhat-fcc/ethers-simple-storage/node_modules/@ethersproject/bytes/lib/index.js:175:9)
at new SigningKey (/home/thearkitech/hardhat-fcc/ethers-simple-storage/node_modules/@ethersproject/signing-key/lib/index.js:20:82)
at new Wallet (/home/thearkitech/hardhat-fcc/ethers-simple-storage/node_modules/@ethersproject/wallet/lib/index.js:120:36)
at main (/home/thearkitech/hardhat-fcc/ethers-simple-storage/deploy.js:11:20)
at Object. (/home/thearkitech/hardhat-fcc/ethers-simple-storage/deploy.js:47:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)

This is my current deploy.js code:

const ethers = require("ethers");
const fs = require("fs-extra");
require("dotenv").config()
// synchronous [solidity]
// asynchronous [javascript]
// http://172.29.144.1:7545S


async function main() {
    const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL);
    const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
    const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
    const binary = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin","utf8");
    const contractFactory = new ethers.ContractFactory(abi,binary,wallet);
    console.log("Deploying, please wait...");
    const contract = await contractFactory.deploy();//could add overrides here
     await contract.deployTransaction.wait(1);
    // console.log("Here is the deployment transaction (transaction response): ");
    // console.log(contract.deployTransaction);

    // console.log("Here is the transaction receipt: ");
    // console.log(transactionReceipt);

//     console.log("Let's deploy with only transaction data!");
//     const nonce = await wallet.getTransactionCount();//auto updates nonce count
//     const tx = {
//         nonce: nonce,
//         gasPrice: "20000000000",
//         gasLimit: "1000000",
//         to: null,
//         value: 0,
//         data: "0x608060405234801561001057600080fd5b5061077a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80632e64cec11461005c5780636057361d1461007a5780636f760f41146100965780638bab8dd5146100b25780639e7a13ad146100e2575b600080fd5b610064610113565b6040516100719190610533565b60405180910390f35b610094600480360381019061008f9190610476565b61011c565b005b6100b060048036038101906100ab919061041a565b61012f565b005b6100cc60048036038101906100c791906103d1565b6101bf565b6040516100d99190610533565b60405180910390f35b6100fc60048036038101906100f79190610476565b6101ed565b60405161010a92919061054e565b60405180910390f35b60008054905090565b8060008190555060005460008190555050565b600260405180604001604052808381526020018481525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010190805190602001906101959291906102a9565b505050806001836040516101a9919061051c565b9081526020016040518091039020819055505050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b600281815481106101fd57600080fd5b906000526020600020906002020160009150905080600001549080600101805461022690610647565b80601f016020809104026020016040519081016040528092919081815260200182805461025290610647565b801561029f5780601f106102745761010080835404028352916020019161029f565b820191906000526020600020905b81548152906001019060200180831161028257829003601f168201915b5050505050905082565b8280546102b590610647565b90600052602060002090601f0160209004810192826102d7576000855561031e565b82601f106102f057805160ff191683800117855561031e565b8280016001018555821561031e579182015b8281111561031d578251825591602001919060010190610302565b5b50905061032b919061032f565b5090565b5b80821115610348576000816000905550600101610330565b5090565b600061035f61035a846105a3565b61057e565b90508281526020810184848401111561037b5761037a61070d565b5b610386848285610605565b509392505050565b600082601f8301126103a3576103a2610708565b5b81356103b384826020860161034c565b91505092915050565b6000813590506103cb8161072d565b92915050565b6000602082840312156103e7576103e6610717565b5b600082013567ffffffffffffffff81111561040557610404610712565b5b6104118482850161038e565b91505092915050565b6000806040838503121561043157610430610717565b5b600083013567ffffffffffffffff81111561044f5761044e610712565b5b61045b8582860161038e565b925050602061046c858286016103bc565b9150509250929050565b60006020828403121561048c5761048b610717565b5b600061049a848285016103bc565b91505092915050565b60006104ae826105d4565b6104b881856105df565b93506104c8818560208601610614565b6104d18161071c565b840191505092915050565b60006104e7826105d4565b6104f181856105f0565b9350610501818560208601610614565b80840191505092915050565b610516816105fb565b82525050565b600061052882846104dc565b915081905092915050565b6000602082019050610548600083018461050d565b92915050565b6000604082019050610563600083018561050d565b818103602083015261057581846104a3565b90509392505050565b6000610588610599565b90506105948282610679565b919050565b6000604051905090565b600067ffffffffffffffff8211156105be576105bd6106d9565b5b6105c78261071c565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000819050919050565b82818337600083830152505050565b60005b83811015610632578082015181840152602081019050610617565b83811115610641576000848401525b50505050565b6000600282049050600182168061065f57607f821691505b60208210811415610673576106726106aa565b5b50919050565b6106828261071c565b810181811067ffffffffffffffff821117156106a1576106a06106d9565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b610736816105fb565b811461074157600080fd5b5056fea264697066735822122071e19bb4890c5bad4bbb19b7844c2eea0e1be6d3a977d51f7802315910422eee64736f6c63430008070033",
//         chainID: 31337,
//     };
//     const sentTxResponse = await wallet.sendTransaction(tx);
//     await sentTxResponse.wait(1);
//     console.log(sentTxResponse);

const currentFavoriteNumber = await contract.retrieve();
console.log(`Current Favorite Number: ${currentFavoriteNumber.toString()}`);
const transactionResponse = await contract.store("7");
const transactionReceipt = await transactionResponse.wait(1);
const updatedFavoriteNumer = await contract.retrieve();
console.log(`Updated favorite number is: ${updatedFavoriteNumber}`);
 }

main()
.then(() => process.exit(0))
.catch((error) => {
    console.error(error)
    process.exit(1);
});

[SOLVED]Lesson 7: Error: Transaction reverted: function returned an unexpected amount of data

image

| I am getting this error when running the test on addressTo AmountFunded() (11:23:25)

Below is my code (I ran it with & without describe line)

  describe("amount funded", async function () {
    it("Updated the amount funded data structure", async function () {
      await fundMe.fund({ value: sendValue });
      const response = await fundMe.addressToAmountFunded(deployer);
      assert.equal(response.toString(), sendValue.toString());
    });
  });

===============================================================================

|I tried checking online but no solution available on any of the forums

Does anyone have an idea of what maybe wrong? Been on this for hours and nothing. Thank you!

Fix links, and add special guest socials

Describe the enhancement

We have a bunch of links right now that are looking for supporting material. You can do a quick search on the repo for ]() and you'll find a bunch of hyperlinks that need to be added.

Including the special guest socials.

Lesson 7: yarn hardhat deploy --tags mocks

yarn hardhat deploy --tags mocks

returns

Error: expected 0 constructor arguments, got 2

after running line

local detected! Deploying mocks...
An unexpected error occurred:

Checked my code several times but all seems identical to video lesson. Help plz!

Why do we borrow 0.95 in the defi example?

Can anyone please help me understand this part, i understood the part 0.95 wherein if we can borrow 10, in that case we are just borrowing the 95% of the DAI, last reciprocal part i didn't understand why do we even need that. sorry for the dumb math question

  const amountDaiToBorrow = availableBorrowsETH.toString() * 0.95 * (1 / daiPrice.toNumber());

eth conversion on Test net not deploying

I can not deploy my Fundme contract into MataMask despiting dividing minimum usd / eth price=50/1100= 0.05 eth.
when i converted it to wei it failed to deploy (Minimum gas fee transaction failed) what could be the issue?

lesson 2 line 11 struct error reading

Lesson

Lesson 2

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

struct bs

i wish i had an understanding as to why this will not allow me to complete my struct command, this is my 3rd time going over this section from the start and i am not trying to do this all over again. I just want people to show up on my deployed contract.

Add Timestamps to all the sections

Describe the enhancement

Every "section" of the video is separated by a clip of what's in ./img/hh-fcc-background.png. We currently have the title text of each section in this repo, but we don't have the timestamp in here!

Max Priority Fee Definition.

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/gyMwXuJrbJQ?t=1h34m14s

Describe the bug

The best video on solidity, blockchain and web3 I've come across. Just wanted to correct what I think was a mistake.

You mentioned at the timestamp added to this issue that max priority fee was the max gas fee we are willing to pay plus the max tip we are willing to give the miners.

From my prior research before taking this course and little additional research I thought that definition applied to max fee rather than max priority fee.

Isn't Max priority fee the total tip we are willing to give the miners?

I'd love further explanation if I am wrong and thanks yet again for this wonderful course.

Lesson 5 - Compiler stopped working / All preferences have disappeared

I am getting the following errors after trying to run
node deploy.js with Ganache UI

Box on lower left of the screen when editing settings.json>>>
solc error: TypeError: solc.compileStandardWrapper is not a function

Terminal>>>

TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')

SimpleStorage.sol - line 2

pragma solidity ^0.8.14

SyntaxError: Source file requires different compiler version (current compiler is 0.4.17+commit.bdeb9e52.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.14;

NOTE: Compiler was working fine and version was set properly.

Compiler version must be fixed [compiler-fixed]

Everything was fine before trying to deploy to ganache

async function main() {
  const provider = new ethers.provider.JsonRpcProvider("HTTP://0.0.0.0:8545");
  const wallet = new ethers.Wallet(
    "c893......................6c9a13081",
    provider
  );

Now, all compiler settings have disappeared from preferences, only get the option to edit json file and settings.json edits are not working.

Can anyone tell me what the hell is going on and how to fix this, plz?

LESSON 9: Error: invalid contract address or ENS name [15:19:55]

Error: ERROR processing /home/hh-fcc/hardhat-smartcontract-lottery-fcc/deploy/01-deploy-raffle.js:
Error: invalid contract address or ENS name (argument="addressOrName", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.6.2)

======================================================================================

Terminal is returning the above error after deploying mocks when running hh deploy or yarn hardhat deploy

I was unable to find a solution online & my 01-deploy-raffle.js seems identical from the one in the course.

Does anyone have a suggestion on how to fix this bug, plz?

Error: No Contract deployed with name VRFCoordinatorV2Mock

Hi Patrick,

Absolutely love your YouTube content. Been working through your latest course featuring this repo and it's been great. I'm stuck at hh deploy at around 15:20:00 and I cannot for the life of me figure it out. I've tried everything for the last 5 hours or so. Here's the error I keep getting:

image

I'm stuck to be honest. I've tried everything, uninstalling with package.json, switching around versions. Keep getting this error. If I clone this repo everything compiles as in your lecture, however.

I'm about to give up and just continue with your repo, but it's a shame. Any ideas on what I'm missing here? Thanks sir.

Raffle Keepers , VRF Issue

My raffle contract deploys perfectly fine, after deploying the contract https://rinkeby.etherscan.io/address/0x2FBeaAFdacb7116CD5258d64ee102E908addEc85

  1. Created the VRF Chainlink Subscription https://vrf.chain.link/rinkeby/6148
  2. Registered the keeper
    3.Funded both vrf and keepers

After all theses steps.. i ran the staging test ... it initiated the test, entered into the raffle. after 30 seconds performUpkeep triggered.it even emitted the requestId https://rinkeby.etherscan.io/tx/0xb72ed45c229ecf369459c55e05d91a3ca49cf2c0919b0c02d85c717f6e94ec96#eventlog
But in VRF sub , it still shows pending, waited for almost 24hours for the first time :(. i thought i did something wrong so tried the whole process again. after the performUpkeep the vrf shows it in pending. i also checked the
VRFCoordinatorV2 rinkeby contract pendingRequestExists('6148') with my subId it returns true
https://rinkeby.etherscan.io/address/0x6168499c0cFfCaCD319c818142124B7A15E857ab#readContract

image

@PatrickAlphaC what could be the issue ?

Hardhat Question

@PatrickAlphaC
In deploy script can i not access the SomeContract right after deployment ?. i want to call one of the set methods right after deployments, ethers.getContract("SomeContract") is throwing error ethers.getContract is not a function


  const someContract = await deploy("SomeContract",{
    from: deployer,
    args: [],
    log: true,
    waitConfirmations: network.config.blockConfirmations || 1
  });

  const someC = await ethers.getContract("SomeContract");

Lesson 5: Cannot connect to Ganache with JSON RPC provider

Hi, I am following the tutorial for Lesson 5 using WSL 2 Ubunto. Currently, I am on timestamp 7:07:32

When I try to deploy node.js, I receive an error that says I could not detect a network.

Here are the versions I am using:
node: v16.14.2
yarn: 1.12.19

I am sure Ganache is working. I have tried looking in forums, and StackOverflow but do not find anything that works. There are others that have the same issue and have not found an answer. So if I manage to fix this error, I will also make sure to help others.

Excuse me for the improperly asked question. This is my first ever issue on GitHub.

Deploying, please way...
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.8)
    at Logger.makeError (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/logger/lib/index.js:233:21)
    at Logger.throwError (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/logger/lib/index.js:242:20)
    at JsonRpcProvider.<anonymous> (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:561:54)
    at step (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
    at Object.next (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
    at fulfilled (/home/georgi_nedyalkov/fcc-hh-tutorial/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:20:58)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at listOnTimeout (node:internal/timers:528:9)
    at processTimers (node:internal/timers:502:7) {
  reason: 'could not detect network',
  code: 'NETWORK_ERROR',
  event: 'noNetwork'
}
const ethers = require("ethers");
const fs = require("fs-extra");

async function main() {
  // http://127.0.0.1:7545
  const provider = new ethers.providers.JsonRpcProvider([
    "http://127.0.0.1:7545",
  ]);
  const wallet = new ethers.Wallet(
    "2515bc70f606d5615a964972008f03b1fbdf222c66107b02e737e7e191613ecf",
    provider
  );
  const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
  const binary = fs.readFileSync(
    "./SimpleStorage_sol_SimpleStorage.bin",
    "utf8"
  );
  const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
  console.log("Deploying, please way...");
  const contract = await contractFactory.deploy();
  console.log(contract);
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

Lesson 8: Error: Transaction reverted without a string and invalid block tags.

Discussed in #475

Originally posted by MichaelGKing June 21, 2022
Hello,

I am having trouble running my code on the local hardhat node.

On both Patrick's cloned repo's and my own work I consistently get this error:
Error: Transaction reverted without a reason string

Also in my node terminal, even after resetting my Metamask I get this issue: (block number changes)
Received invalid block tag 4. Latest block number is 3

When cloning Patrick's repo I do everything the Readme says. Except this part, I'm unsure what it means:
Reserve the front end with yarn http-server, input an amount in the text box, and hit fund button after connecting

This is my index.js folder:

// in front-end js you cannot use require, must use import
import { ethers } from "./ethers-5.6.esm.min.js";
import { abi, contractAddress } from "./constants.js";

// Have to add onclick events in js file, due to it being imported as a module type in the HTML.
const connectButton = document.getElementById("connectButton");
const fundButton = document.getElementById("fundButton");
connectButton.onclick = connect;
fundButton.onclick = fund;

console.log(ethers);

async function connect() {
  if (typeof window.ethereum != "undefined") {
    await window.ethereum.request({ method: "eth_requestAccounts" });
    connectButton.innerHTML = "Connected!";
  } else {
    connectButton.innerHTML = "Please install metamask!";
  }
}

// fund function
async function fund() {
  const ethAmount = "0.5";
  console.log(`Funding with ${ethAmount}...`);
  if (typeof window.ethereum != "undefined") {
    // provider / connection to the blockchain
    // signer / wallet/ someone with some gas
    // contract that we are interacting with
    // ^ ABI & Address
    // Web3Provider objects takes that http end point and automatically sticks it in ethers for us.
    // It looks at our metamask and says I found the http endpoint inside their metamask, thats what we are going to use as our provider here.
    const provider = new ethers.providers.Web3Provider(window.ethereum);
    const signer = provider.getSigner();
    const contract = new ethers.Contract(contractAddress, abi, signer);
    const transactionResponse = await contract.fund({
      value: ethers.utils.parseEther(ethAmount),
    });
  }
}

Any help on the issue would be greatly appreciated.

Compiler Trouble

[Info  - 11:14:56 AM] solang language server v0.1.11 initialized
thread 'main' panicked at 'not implemented', src/emit/ewasm.rs:835:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Output terminal returns this error which causes this error on the pragma version declaration

/mnt/c/Users/doria/hardhat-simple-storage-fcc/contracts/SimpleStorage.sol:2:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.17+commit.bdeb9e52.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.8; // 0.8.12 (Latest)
^---------------------^

Seems to be caused by solidity + hardhat extension - I get error on solidity Juan blanco ext, Solang and solhint (All stopped working) but even unistalled errors persist. Help plz, this is an on going issue!

Lesson 7: 11:20:38 -> TypeError: ethers.getContract is not a function

AssertionError: Expected transaction to be reverted with You need to spend more ETH!, but other exception was thrown: Error: Transaction reverted: function returned an unexpected amount of data

I was getting this error when runinning test for fundMe() around 11:20:38 of the video

describe("FundMe", async function () {
  let fundMe;
  let deployer;
  let MockV3Aggregator;
  beforeEach(async function () {
    deployer = (await getNamedAccounts()).deployer;
    await deployments.fixture(["all"]);
    fundMe = await ethers.getContract("FundMe", deployer);
    MockV3Aggregator = await ethers.getContract("MockV3Aggregator", deployer);
  });

  describe("constructor", async function () {
    it("sets the aggregator addresses correctly", async function () {
      const response = await fundMe.priceFeed();
      assert.equal(response, MockV3Aggregator.address);
    });
  });
  describe("fund", async function () {
    it("Fails if you don't send enough ETH", async function () {
      await expect(fundMe.fund()).to.be.revertedWith(
        "You need to spend more ETH!"
      );
    });
  });
});

After some research it seemed that the issue could ber esolved by downloading @nomicslabs/hardhat-waffle from hardhat docs
[https://hardhat.org/plugins/nomiclabs-hardhat-waffle]

But after running the install I now get the following error running the above test

  1) FundMe
       "before each" hook for "sets the aggregator addresses correctly":
     TypeError: ethers.getContract is not a function

Any ideas of what could be the issue here? thank you!

Cant install dependencies after setting up hardhat

I cant install dependencies after setting up hardhat, i was not given options to install am them automatically, i ran into the below errors when installing them manually using this command npm install --save-dev @nomiclabs/hardhat-waffle 'ethereum-waffle@^3.0.0' @nomiclabs/hardhat-ethers,

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\Users\PC\Desktop\DEVELOPEMENT\HARDHATDEMO> npm install --save-dev @nomiclabs/hardhat-waffle 'ethereum-waffle@^3.0.0' @nomiclabs/hardhat-ethers 'ethers@^5.0.0'
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ethereum-waffle
npm ERR! dev ethereum-waffle@"3.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ethereum-waffle@"^3.2.0" from @nomiclabs/[email protected]
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\PC\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Local\npm-cache_logs\2022-06-28T19_22_08_016Z-debug-0.log
PS C:\Users\PC\Desktop\DEVELOPEMENT\HARDHATDEMO>

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.