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)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay