I would like to know if I can infer an ABI for contracts that have the same bytecode. If both have the same bytecode can I assume their ABI will be the same?
1 Answer
The bytecode is what runs the EVM. A simple contract would look like this:
608060405234801561001057600080fd5b506101f4806100206000396000f3fe60806040526004361061003b5760003560e01c806360fe47b1146100405780636d4ce63c1461007f575b600080fd5b34801561004c57600080fd5b506100556100d0565b6040518082815260200191505060405180910390f35b6100706100e5565b005b60006020819052908152604090205460ff1681565b6000805490509056fea165627a7a723058203dcd3f1c7a2f2d9b7ed8d580aaf44c30f03111814a35c3fb3dceee130bdc2f2b0029
In principle, the same bytecode will be associated with the ABI generated at the same time. Therefore, for each deployment we have a unique bytecode - ABI equivalent pair.
Two contracts with the same bytecode would then be the same.