PatrickAlphaC / brownie_fund_me

26 stars 64 forks source link

[Duplicated] Brownie - Constructor Sequence has incorrect length, expected 1 but got 0 #2

Closed Magofoco closed 3 years ago

Magofoco commented 3 years ago

FreeCodeCamp VIDEO at 5:15:45

I am trying to deploy the FundMe contract on Rinkeby by running brownie run scripts/deploy.py --network rinkebybut I get following error:

Constructor Sequence has incorrect length, expected 1 but got 0 I think the problem is that I do NOT specify the initial value of the constructor when I run my deploy.py script. Is it correct? If yes, how can I fix it?

deploy.py


from brownie import FundMe
from scripts.helpful_script import get_account

def deploy_fund_me():
    account = get_account()
    fund_me = FundMe.deploy({"from": account})
    print(f"Contract deployed to {fund_me.account}")

Solidity contract

pragma solidity ^0.6.6;

import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol";

contract FundMe {
    using SafeMathChainlink for uint256;

    mapping(address => uint256) public addressToAmountFunded;
    address[] public funders;
    address public owner;
    AggregatorV3Interface public priceFeed;

    constructor(address _priceFeed) public {
        priceFeed = AggregatorV3Interface(_priceFeed);
        owner = msg.sender;
    }
    ...OTHER FUNCTIONS...
    }
}
PatrickAlphaC commented 3 years ago

@Magofoco thanks for making this!

What did the resolution end up being? If another person runs into this issue, it would be great for them to know what the solution is.

PatrickAlphaC commented 3 years ago

Oh whoops, i see it's open elsewhere