Difference between TransparentUpgradeableProxy.json's deployed bytecode

Hi,

I was trying to get the deployed bytecode of the TransparentUpgradeableProxy.
There are two of them in node_modules/@openzeppelin.

contracts/proxy/transparent/TransparentUpgradeableProxy.sol
contracts/build/contracts/TransparentUpgradeableProxy.json
upgrades-core/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json

The question is : Why do the two bytecodes differ? What is the difference? Which one is the 'actual' one?
FYI, the one I'm getting through an API call in the blockchain is the same as the one under 'upgrades-core/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json'

This is my package.json:
"dependencies": {
"@openzeppelin/contracts": "^4.7.0",
"@openzeppelin/contracts-upgradeable": "^4.7.0",

Thanks!
Best,
Kevin

contracts/build/contracts/TransparentUpgradeableProxy.json was compiled by the https://github.com/OpenZeppelin/openzeppelin-contracts project and is distributed as part of OpenZeppelin Contracts.

upgrades-core/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json was compiled by the https://github.com/OpenZeppelin/openzeppelin-upgrades/tree/master/packages/core project and is distributed as part of the Upgrades Plugins.

The bytecodes differ because the projects use different compiler versions.

When you use the Upgrades Plugins to deploy proxies, it deploys using the bytecodes from the artifacts in upgrades-core/artifacts/@openzeppelin/contracts/proxy/*

1 Like