0

I have written smart contract in which I have declared one variable like uint256[] public UserIdList. And I am adding 3 userids while migrating that contract.

Now, I am doing the mapping of user id with machine id and I want to fetch the transaction details by particular user id, so how to do it inside solidity ?

  • What do you mean when you say 'transaction details'? Do you want to retrieve transaction information when a userId was added to UserIdList? – Ismael Jul 20 '18 at 4:43
  • Means I have 3 variables uint256[] public machineIdList , uint256[] public userIdList, mapping(uint256 => uint256) public machineAllocs, So when doing mapping between userid and machine id, I am triggering an event and getting user->machine mapping,block and transaction details on my web app. But is there any functionality where we can direct get transaction details by directly giving Machine id or User id without using event and traverse whole blockchain on web application ? – Riya Soni Jul 20 '18 at 5:16
  • You cannot inspect events from a smart contract, if you need event parameter info you have to explicitly store them in your contract. – Ismael Jul 20 '18 at 6:21

Your Answer

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

Browse other questions tagged or ask your own question.