Who has access to this?
For example, if I call type(SimpleStorage).creationCode
, wouldn't this cause an issue because there are a lot of SimpleStorage
's
How does the type() function know the specific C
/contract I am calling without an address?
So from the Solidity Docs website
Memory byte array that contains the creation bytecode of the contract. This can be used in inline assembly to build custom creation routines, especially by using the create2 opcode. This property can not be accessed in the contract itself or any derived contract. It causes the bytecode to be included in the bytecode of the call site and thus circular references like that are not possible.
So it cannot be called within the contract itself (which makes sense) and cannot be called from a contract that is made from the contract we want the creationCode
from.
So the contract can only be called from a parent contract?
To be clear I have at least three questions
- What if there are multiple contracts named
C
? - Where can I call this function?
- What is its range of scope? What are the security considerations?