OpenZeppelin / openzeppelin-sdk

OpenZeppelin SDK repository for CLI and upgrades.js. No longer actively developed.
MIT License
431 stars 201 forks source link

Extend `verify` command functionality to verify App/Package/Directory contracts #65

Open jbcarpanelli opened 6 years ago

jbcarpanelli commented 6 years ago

At present, the verify command can only be used to verify user's contracts. Extend its functionality to also verify zeppelinOS contracts (i.e., App, Implementation -etc- related contracts.)

facuspagnuolo commented 6 years ago

Just dropping an idea here, if we have our contracts published on an on-chain library, there is no need to extend the verify command, we can simply verify them like any other dev team would verify their contracts. Then, every dev team willing to have an instance of our App architecture for their contracts will be using the same implementation.

GershonA commented 5 years ago

I would have been very happy to see this realized.

jbcarpanelli commented 5 years ago

Hi, @GershonA! We didn't decide whether to implement this or not yet. Do you find this useful? Why? Having feedback from some users could be enough for us to implement it. Also, we manually verified all v2.2 contracts. Take a look at this issue for more info! It may be useful for you!

GershonA commented 5 years ago

Hello @jcarpanelli ! Thank You for answer. I read the attached link process, but I still have a problem. My deployment as following:

Deployed ProxyAdmin at 0x0b48fc39Ee75925d8a90E14Ecd14b42aFC3066ab Creating proxy to logic contract 0x9f9D9103A774CFc8B785C84340a84eb00b5dB137 and initializing by calling initialize with: Instance created at 0x9EdA76D2A9B73612e7F8788c3F24396e736f0dBF

Now i verified it as following: npx zos verify MDZA -n dev-infura --remote etherscan --api-key [MyKey]

[Verifier] Contract verified successfully. You can check it here: https://ropsten.etherscan.io/address/0x9f9D9103A774CFc8B785C84340a84eb00b5dB137#code

But i can't find a way to verify the 0x9EdA76D2A9B73612e7F8788c3F24396e736f0dBF The 0x9EdA76D2A9B73612e7F8788c3F24396e736f0dBF created with different bytcode from my flattened file truffle-flattener.cmd .\contracts\MDZA.sol > FlattenedMDZA.sol Thank You !

GershonA commented 5 years ago

OK. Got it worked.

  1. Flatten all zos files PS D:\MDZA-TESTNET1\solidity-flattener\SolidityFlatteryGo> .\flat.exe -input .\zos-lib\contracts\application\App.sol  -output .\zos-lib\AppFlatten I use (https://github.com/BlockCatIO/solidity-flattener)
    • i copied all the zos-lib project from node_modules to root of my SolidityFlatteryGo installation folder.

      P.S on windows , need to change single quotes to double quote import './UpgradeabilityProxy.sol'; import "./UpgradeabilityProxy.sol";

  2. Go to etherscan verification https://ropsten.etherscan.io/verifyContract2?a=
  3. Paste flattened file
  4. In the name , write AdminUpgradeabilityProxy
  5. You will get an error. From ByteCode (what we are looking for): note all the code after{bzzr}and try again while You add the taken code into Constructor Arguments ABI-encoded section.
  6. Contract verified Medooza Token on ropsten https://ropsten.etherscan.io/address/0x9EdA76D2A9B73612e7F8788c3F24396e736f0dBF#code Medooza Token on mainnet https://etherscan.io/address/0x0eCDd783dc7bF820614044B51862ED29714d2BA5#code
shanefontaine commented 5 years ago

For anyone trying to manually verify the problem with version 2.5.3 of OpenZeppelin (September 2019 ), I was able to verify InitializableAdminUpgradeabilityProxy.sol with the following parameters:

I used truffle-flattener to flatten the contracts directly in my node_modules.

You can find the verified contract here.