1

import "./PupperPass.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/Crowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/emission/MintedCrowdsale.sol";


// Have the PupperPass contract inherit the following OpenZeppelin:
// * Crowdsale
// * MintedCrowdsale
contract PupperPassCrowdsale is Crowdsale, MintedCrowdsale{ // UPDATE THE CONTRACT SIGNATURE TO ADD INHERITANCE
    
    // Provide parameters for all of the features of your crowdsale, such as the `rate`, `wallet` for fundraising, and `token`.
    constructor(
        uint256 rate,
        address payable wallet,
        PupCoin token
    ) public Crowdsale(rate, wallet, token) {

    }
}


contract PupCoinCrowdsaleDeployer {
    // Create an `address public` variable called `pupper_token_address`.
    address public pupper_token_address;
    // Create an `address public` variable called `pupper_crowdsale_address`.
    address public pupper_crowdsale_address;

    // Add the constructor.
    constructor(
       string memory name,
       string memory symbol,
       address payable wallet 
    ) public {
        // Create a new instance of the Pupcoin contract.
        PupCoin token = new PupCoin(name, symbol, 0);
        
        // Assign the token contract’s address to the `pupper_token_address` variable.
        pupper_token_address = address(token);

        // Create a new instance of the `PupCoinCrowdsale` contract
        PupCoinCrowdsale pupper_crowdsale = 
            new PupCoinCrowdsale(1, wallet, token);
            
        // Assign the `PupCoinCrowdsale` contract’s address to the `pupper_crowdsale_address` variable.
        pupper_crowdsale_address = address(pupper_crowdsale);
        
        // Set the `PupCoinCrowdsale` contract as a minter
        token.addMinter(pupper_crowdsale_address);
        
        // Have the `PupCoinCrowdsaleDeployer` renounce its minter role.
        token.renounceMinter();
    }
}

Line 43, "puppper_crowdsale is no unique or not found, I can't find a solution to this, i've looked at my notes and the code seems correct, I just create a variable to create a new instance to the crowdsale contract. Am I missing something would appreciate some help.

0

1 Answer 1

1

It looks like there is a typo in your contract on line 43. The variable name is pupper_crowdsale, but you wrote puppper_crowdsale.

Try changing line 43 to the following:

PupCoinCrowdsale pupper_crowdsale = 
            new PupCoinCrowdsale(1, wallet, token);

This should fix the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.