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

adityakhare86

Aditya Khare

Posted on May 3, 2024

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
💖 💪 🙅 🚩
adityakhare86
Aditya Khare

Posted on May 3, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related