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.