I'm trying to understand the difference between the 'create' and 'CREATE2' functions. Could someone explain the distinction between these two and how they are used?
6
answers
Dario
Fri Feb 14 2025
A crucial distinction exists in the method of determining the address for a new contract.
KimchiQueenCharm
Thu Feb 13 2025
Alternatively, with the CREATE2 opcode, the determination of the address involves an additional factor.
Martino
Thu Feb 13 2025
When utilizing the CREATE opcode, the address is derived from the nonce of the factory contract.
BitcoinBaroness
Thu Feb 13 2025
Specifically, CREATE2 utilizes an arbitrary salt value in conjunction with the init_code to ascertain the contract's address.
SolitudeNebula
Thu Feb 13 2025
Each time CREATE is invoked within the factory, the nonce is incremented by one.