DEV Community

Aditya Khare
Aditya Khare

Posted on

Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract).

I am getting the error:

Line: 49 in TransactionsContract.sol

Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract).

Even though I have declared transactionsCount public and I have also imported the TransactionContract. I looked up on forums but didn't find anything suitable.

I am new to asking questions on forums, so correct if you find the format bothersome.

Any help is greatly appreciated! 🙏

TransactionsContract.sol:

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

contract TransactionsContract{
enum TransactionStatus { InTransit, Delivered, Returned, RequestedRefund, DeliveryRejected }

struct Transaction {
uint256 transactionId;
uint256 productId;
TransactionStatus status;
}

mapping(uint256 => Transaction) public transactions;
uint256 public transactionCount;

}
Enter fullscreen mode Exit fullscreen mode

ProductContract.sol

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

contract TransactionsContract{
enum TransactionStatus { InTransit, Delivered, Returned, RequestedRefund, DeliveryRejected }

struct Transaction {
uint256 transactionId;
uint256 productId;
TransactionStatus status;
}

mapping(uint256 => Transaction) public transactions;
uint256 public transactionCount;

}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)