0

Could anyone help me make sense of this error. For context. I had 2 contracts 1 will verify and the other won't. I noticed this when trying to merge them into 1 contract. The contract that is not verifying is an ERC1155.

I read on brownie gitter page that flattening the oz files aparently solves this. My questions are How do you work with the file after it's flattend? Are all my imports going to be local paths now? I havnt seen this before so Im assuming there is another way.. I tried using the flattend files to verify manually on etherscan but it doesnt work.. Do i need to install hardhat or truffle just to verify?? If anyone could explain this better though would be apreciated. Like why the contracts deployed and verified seperately but when combining them into one it fails verification..

console log:

Running 'scripts\deploy_mintagram.py::main'... Transaction sent: 0x375a0280837efd32bb920ce11939ef349c421f37b06ef22be4fc33c033c936ad Gas price: 2.000000007 gwei Gas limit: 2655526 Nonce: 252 Mint_A_Gram.constructor confirmed Block: 28260856 Gas used: 2414115 (90.91%) Mint_A_Gram deployed at: 0xa3C3F916448aabB9C4D3CAFCf8e8862f91344c36 File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie_cli\run.py", line 49, in main return_value, frame = run( File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\project\scripts.py", line 103, in run return_value = f_locals[method_name](*args, **kwargs) File ".\scripts\deploy_mintagram.py", line 20, in main deploy() File ".\scripts\deploy_mintagram.py", line 7, in deploy Mintagram = Mint_A_Gram.deploy( File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\contract.py", line 600, in call return tx["from"].deploy( File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\account.py", line 555, in deploy contract.publish_source(deployed_contract, silent=silent) File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\contract.py", line 410, in publish_source contract_info = self.get_verification_info() File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\contract.py", line 315, in get_verification_info build_json = self._project._build.get(name) File "C:\Users\ills\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\project\build.py", line 124, in get return self._interfaces[key] KeyError: 'OpenZeppelin/openzeppelin-contracts@4.3.1/Address'

Code (imports & constructor)

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

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";   
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol"; // for testings conveniece
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";

contract Mint_A_Gram is
    ERC1155,
    Ownable,
    VRFConsumerBase,
    KeeperCompatibleInterface,
    ReentrancyGuard
{
    using SafeMath for uint256;
    using Counters for Counters.Counter;
    Counters.Counter private x_tokenIds; 
    string public x_tokenURI;
    uint256 public x_mintCount;
    bytes32 public x_keyHash;
    uint256 public x_chainlinkFee;
    uint256 public x_ticketFee;
    uint256 public x_lastTimeStamp;
    uint256 public x_interval;
    address public x_theWinner;
    address payable[] x_usersEntered;
    lotteryState public x_lotteryState;
    enum lotteryState {
        OPEN,
        Drawing_Winner
    }

    event enteredDraw(address indexed player);
    event requestedDrawWinner(bytes32 indexed requestId);
    event winnerChosen(address indexed player);

    constructor(
        address _vrfCoordinator,
        address _linkToken,
        bytes32 _keyHash,
        uint256 _chainlinkFee,
        uint256 _ticketFee,
        uint256 _interval
    ) ERC1155(x_tokenURI) VRFConsumerBase(_vrfCoordinator, _linkToken) {
        x_lastTimeStamp = block.timestamp;
        x_keyHash = _keyHash;
        x_chainlinkFee = _chainlinkFee;
        x_ticketFee = _ticketFee;
        x_interval = _interval;
        x_theWinner = 0x0000000000000000000000000000000000000000;
        x_lotteryState = lotteryState.OPEN;
    }
0

Solved by upgrading to brownie 1.17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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