0

Is transaction log also called trnsaction receipt? My account address on Remix IDE is 0xCA3…a733c and wallet address is 0x147…C160C. Following is my code obtained from Solidity Tutorial

pragma solidity 0.5.4;
contract MyContractEtherEvents {
   mapping(address => uint256) public balances;
   address payable wallet;
   event Purchase(
    address indexed _buyer,
    uint256 _amount
   );

   constructor(address payable _wallet) public {
    wallet = _wallet;
   }

   function() external payable {
     buyToken();
   }

   function buyToken() public payable {
    balances[msg.sender] += 1;
    wallet.transfer(msg.value);
    emit Purchase(msg.sender, 1);
   }
 }
 I got the following Ether log:

transaction hash 0xa4484b15bd6e83c5377bbc4e21f69e8c208a02c3ea0187ffa77cb29c9352df6e from 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c to MyContractEtherEvents.balances(address) 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A transaction cost 23832 gas (Cost only applies when called by a contract) execution cost 1152 gas (Cost only applies when called by a contract) hash 0xa4484b15bd6e83c5377bbc4e21f69e8c208a02c3ea0187ffa77cb29c9352df6e input 0x27e...a733c decoded input { "address ": "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c" } decoded output { "0": "uint256: 4

The 'from' address is: 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c (correct) but 'to' address is: 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A, which is the address at which the contract is deployed. But the remix image does not show the deployed address instead it shows the address : 0x147…C160C which is the address of Wallet. Is the log information correct? I have also added the image, the image does not show the 'to' address

Some body please guide me. Zulfi.

Problem with understanding the transaction log

1

Expand the transaction receipt to see the log.

enter image description here

Hope it helps.

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.