My account address on Remix IDE is 0xCA3…a733c and wallet address is 0x147…C160C. Following is my code obtained from Solidity Tutorial. In this code, buyer address is passed as an argument. I have got 3 addresses in the image, which one is the buyer address? Also in the log file I have “to” and “from” addresses, please tell me which one is the buyer address?
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);
}
}
The log file is given below:
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 image of the project is:
Somebody please guide me.
Zulfi.