KangaFinance / kanga

Kanga Core Contracts and Deployments
Other
2 stars 0 forks source link

Verification of contracts #2

Open johnwhitton opened 2 years ago

johnwhitton commented 2 years ago

Update Deploy Process so hardhat etherscan-verify works seamlessly Currently when doingyarn kovan:verify the factory and Pair contracts are not verified due to missing metadata

Contract UniswapV2Factory was deployed without saving metadata. Cannot submit to etherscan, skipping.
Contract UniswapV2Pair was deployed without saving metadata. Cannot submit to etherscan, skipping.

Also we are falling back on solcinput for other contracts

Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying MiniBreederV2 (0x7A0a3f4b33baC113F0E7b26D6a5be7a144CE514d) ...
waiting for result...
 => contract MiniBreederV2 is now verified

Describe the solution you'd like Update the deploy process and scripts so that the deploy works seamlessly.

Describe alternatives you've considered

Additional context Log from verify:kovan

johnlaptop kanga (v0.1.0) $ yarn kovan:verify
yarn run v1.22.11
warning ../../package.json: No license field
$ hardhat --network kovan etherscan-verify --solc-input
(node:70242) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
verifying Billabong (0xC1e88aF95a8F81a3aB19b8b1b46bde28cA2F352a) ...
waiting for result...
Failed to verify contract Billabong: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0xC1e88aF95a8F81a3aB19b8b1b46bde28cA2F352a",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/Billabong.sol:Billabong",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "0000000000000000000000001428261e49e2c1554438edb657915436c05d134e",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying Billabong (0xC1e88aF95a8F81a3aB19b8b1b46bde28cA2F352a) ...
waiting for result...
 => contract Billabong is now verified
verifying ERC20Mock (0xEE78e3A95c6CfE7f66260B927E5458A34C61F235) ...
waiting for result...
Failed to verify contract ERC20Mock: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0xEE78e3A95c6CfE7f66260B927E5458A34C61F235",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/mocks/ERC20Mock.sol:ERC20Mock",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000204fce5e3e250261100000000000000000000000000000000000000000000000000000000000000000000003555354000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035553540000000000000000000000000000000000000000000000000000000000",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying ERC20Mock (0xEE78e3A95c6CfE7f66260B927E5458A34C61F235) ...
waiting for result...
 => contract ERC20Mock is now verified
verifying KangaBounce (0x67540479658e79C0e308De1aA83364128d4795c7) ...
waiting for result...
Failed to verify contract KangaBounce: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0x67540479658e79C0e308De1aA83364128d4795c7",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/KangaBounce.sol:KangaBounce",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000004ded055ad5a6734286d5cc6855311aacb6e1e1c8",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying KangaBounce (0x67540479658e79C0e308De1aA83364128d4795c7) ...
waiting for result...
 => contract KangaBounce is now verified
verifying KangaMaker (0xDC5025743489820F876C5a63686A76052041BA9e) ...
waiting for result...
Failed to verify contract KangaMaker: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0xDC5025743489820F876C5a63686A76052041BA9e",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/KangaMaker.sol:KangaMaker",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "00000000000000000000000080a000f9d85cfb9a426065189b7feee868a8a41c000000000000000000000000c1e88af95a8f81a3ab19b8b1b46bde28ca2f352a0000000000000000000000001428261e49e2c1554438edb657915436c05d134e000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying KangaMaker (0xDC5025743489820F876C5a63686A76052041BA9e) ...
waiting for result...
 => contract KangaMaker is now verified
verifying KangaToken (0x1428261e49E2C1554438eDB657915436c05d134E) ...
waiting for result...
Failed to verify contract KangaToken: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0x1428261e49E2C1554438eDB657915436c05d134E",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/KangaToken.sol:KangaToken",
  "compilerversion": "v0.6.12+commit.27d51765",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying KangaToken (0x1428261e49E2C1554438eDB657915436c05d134E) ...
waiting for result...
 => contract KangaToken is now verified
verifying MasterBreeder (0x2c546deB5980c636039DFB7d3a95660a658E8C59) ...
waiting for result...
Failed to verify contract MasterBreeder: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0x2c546deB5980c636039DFB7d3a95660a658E8C59",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/MasterBreeder.sol:MasterBreeder",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "0000000000000000000000001428261e49e2c1554438edb657915436c05d134e0000000000000000000000009cf3000a2f555607ce330bf70b0f67c7cbcd3be800000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003635c9adc5dea00000",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying MasterBreeder (0x2c546deB5980c636039DFB7d3a95660a658E8C59) ...
waiting for result...
 => contract MasterBreeder is now verified
verifying MiniBreederV2 (0x7A0a3f4b33baC113F0E7b26D6a5be7a144CE514d) ...
waiting for result...
Failed to verify contract MiniBreederV2: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0x7A0a3f4b33baC113F0E7b26D6a5be7a144CE514d",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/MiniBreederV2.sol:MiniBreederV2",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "0000000000000000000000001428261e49e2c1554438edb657915436c05d134e",
  "licenseType": 3
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying MiniBreederV2 (0x7A0a3f4b33baC113F0E7b26D6a5be7a144CE514d) ...
waiting for result...
 => contract MiniBreederV2 is now verified
already verified: Multicall2 (0x6975Aba6A5562Cd513738a31F95F6D943E8bC93D), skipping.
Contract UniswapV2Factory was deployed without saving metadata. Cannot submit to etherscan, skipping.
Contract UniswapV2Pair was deployed without saving metadata. Cannot submit to etherscan, skipping.
verifying UniswapV2Router02 (0x4DED055AD5a6734286d5Cc6855311aAcb6E1e1C8) ...
waiting for result...
Failed to verify contract UniswapV2Router02: NOTOK, Fail - Unable to verify
{
  "apikey": "XXXXXX",
  "module": "contract",
  "action": "verifysourcecode",
  "contractaddress": "0x4DED055AD5a6734286d5Cc6855311aAcb6E1e1C8",
  "sourceCode": "...",
  "codeformat": "solidity-standard-json-input",
  "contractname": "contracts/uniswapv2/UniswapV2Router02.sol:UniswapV2Router02",
  "compilerversion": "v0.6.12+commit.27d51765",
  "constructorArguements": "00000000000000000000000080a000f9d85cfb9a426065189b7feee868a8a41c000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
  "licenseType": 5
}
Falling back on solcInput. etherscan seems to sometime require full solc-input with all source files, even though this should not be needed. See https://github.com/ethereum/solidity/issues/9573
verifying UniswapV2Router02 (0x4DED055AD5a6734286d5Cc6855311aAcb6E1e1C8) ...
waiting for result...
 => contract UniswapV2Router02 is now verified
✨  Done in 453.47s.
johnwhitton commented 2 years ago

Have updated the deploy scripts for UniswapV2Factory and UniswapV2Pair to deploy the contracts directly rather than referring to ABI's from master.

johnwhitton commented 2 years ago

Sample verified conracts on Kovan