0

I have a problem understanding the concept of deployed object. Kindly follow the link:

Executing reentrancy on Truffle Console: attacker not stealing 5 ether , why only 2 reentrant calls?

The link shows a Solidity smart contract having the following function:

function () external payable{
      count++;
      emit LogFallback(count, address(this).balance);
      if(count < 5 ) {
         v.withdraw(owner,amount);
      }
    }

It says to replace 'owner' with address(this). It says that the owner is a deployed object. It has a constructor also:

constructor (address payable victim) public {       
 owner = msg.sender;      
 count =0;      
 v=Victim(victim);    
}

The following link :

https://www.oreilly.com/library/view/hands-on-smart-contract/9781492045250/ch04.html

According to the above link, deployed object is declared in the constructor.

Please guide me what is the difference between the address(this) and the 'owner' concerning stack exchange question. If we consider 'owner' as a deployed object then it confronts with the oreilly link. Somebody please guide me. @clement

Zulfi.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.