Skip to main content

Who has access to this?

For example, if I call type(SimpleStorage).creationCode, wouldn't this cause aan 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

  1. What if there are multiple contracts named C?
  2. Where can I call this function?
  3. What is its range of scope? What are the security considerations?

Who has access to this?

For example if I call type(SimpleStorage).creationCode, wouldn't this cause a issue because there 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

  1. What if there are multiple contracts named C?
  2. Where can I call this function?
  3. What is its range of scope? What are the security considerations?

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

  1. What if there are multiple contracts named C?
  2. Where can I call this function?
  3. What is its range of scope? What are the security considerations?
added 220 characters in body
Source Link

Who has access to this?

For example if I call type(SimpleStorage).creationCode, wouldn't this cause a issue because there 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

  1. What if there are multiple contracts named C?
  2. Where can I call this function?
  3. What is its range of scope? What are the security considerations?

Who has access to this?

For example if I call type(SimpleStorage).creationCode, wouldn't this cause a issue because there 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?

Who has access to this?

For example if I call type(SimpleStorage).creationCode, wouldn't this cause a issue because there 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

  1. What if there are multiple contracts named C?
  2. Where can I call this function?
  3. What is its range of scope? What are the security considerations?
Source Link

type(C).creationCode who has access to this?

Who has access to this?

For example if I call type(SimpleStorage).creationCode, wouldn't this cause a issue because there 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?