Imagine two contracts, A
and B
contract A{
...
}
contract B{
A a;
function B(address aAddr){
a = A(aAddr);
}
}
What exactly is B
storing about contract A
? Does it store function hashes? Does it store A
's bytecode?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityImagine two contracts, A
and B
contract A{
...
}
contract B{
A a;
function B(address aAddr){
a = A(aAddr);
}
}
What exactly is B
storing about contract A
? Does it store function hashes? Does it store A
's bytecode?
it creates an instance of A so it is using only a reference in other words B is storing the A's Address, no bytecode no hash.
try to debug the code and watch storage and memory changement. in this exemple the A address is : 0x692a70d2e424a56d2c6c27 aa97d1a86395877b3a