I am invoking the buyTicket function of contract from account "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C" in remix IDE with 20 ethers which is clear from log but confused what is "from" and "topic" addresses in Remix ide as per log below any idea please ? Thanks

  event Deposit(address _from, uint _amount); 

 function buyTicket() public payable returns (bool success) { 
    if (numRegistrants >= quota) { return false; } // see footnote
     registrantsPaid[msg.sender] = msg.value;
     emit Deposit(msg.sender, msg.value);
     return true;

Remix Ide Log

        "*from*": "0x692a70d2e424a56d2c6c27aa97d1a86395877b3a",
        "***topic***": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
        "event": "Deposit",
        "args": {
            "0": "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C",
            "1": "20",
            "_from": "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C",
            "_amount": "20",
            "length": 2

from should be the contract address.

topics is the hash name of your event in the smart contract

| improve this answer | |
  • Sorry the addresses are not the contrcat address the address are not in the list of remix samples addresses. I am talking about "from": "0x692a70d2e424a56d2c6c27aa97d1a86395877b3a" "topic": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", The address used in this contract 0x14723a09acff6d2a60dcdf7aa4aff308fddc160c buyer 0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db seller 0xca35b7d915458ef540ade6068dfe2f44e8fa733c - contrcat – raky May 25 '18 at 14:34
  • You right in this case, the fromshould be the address of the account who make the transaction/call the function – Lbrth_BoC May 25 '18 at 14:37
  • Sorry Lbrth_BoC, please read my question above there are 2 from's (from and _from). i know _from but 2nd "from" and "Topic" has unusual addresses which is unclear i am trying to find answer for both . – raky May 25 '18 at 14:39
  • Sorry I didn't see the two from, I'm analysing that right now ! – Lbrth_BoC May 25 '18 at 14:45
  • The msg.sender is always the account from who send the transaction/call the function. So obviously, the address loged as _from in your event should be exactly the same of the from above. (Here I understand why you ask:)). Please try to code this, just before your if statement in your smart contract : require(numRegistrant == msg.sender) where numRegistrant should the account which call the function – Lbrth_BoC May 25 '18 at 14:53

You find those in the terminal window below the editor. Just click on the log to expand it and you will get all the details about the transaction

| improve this answer | |
  • I meant what those address are pointing to , the address are no way related to Remix .. – raky May 25 '18 at 14:31

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.