Thanks to Grandzero
I changed the above code and new code is very short.
basic-solidity/proxy_1.sol at main · veridelisi/basic-solidity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below…
We deploy RealContract
We copy the the address of the RealContract and we deploy ProxyContractWithCallNoStorage with the address of the RealContract.
We start with RealContract
SetTest function is working and test variable gives us the number.
Our aim is to sent the number to test variable in the RealContract using proxy contract.
ProxyContractWithCallNoStorage has “returnHex” function and this function turns hex to us.
We paste this hex to calldata section
We sent the number to test variable in the RealContract using proxy contract.
Check it !
Everthing is ok !
We sent this number with calldata
When we change the address of pointing contract, we can’t access old datas anymore .
All datas are lost now.
We need to sent this number with Delegatecall.