Aniket-Engg / sol-verifier

Verify Solidity smart contracts on Etherscan
MIT License
30 stars 15 forks source link

Unable to verify with sol-verify release v1.2.0 #28

Closed digvjs closed 5 years ago

digvjs commented 5 years ago

Current sol-verify version: v1.2.0 Current solidity version: ^0.4.18;

Payload:

{ 
    key: 'XXXXXXXXXXXXXXXXXXXXXX',
    path: '/private/var/www/html/blockchain/konkrete_node/ERC20-Mintable-Contract/erc20_mintable_contract.sol',
    contractAddress: '0xBa69648023f5ca52f93bD9d1E48854c1E82ebe8b',
    network: 'ropsten',
    contractName: 'konkrete6',
    cvalues: [ 'TSTM', 'Happy Project TSTM/projects/2/interest', 12345600 ],
    optimizationFlag: false 
}

Output:

{ 
    status: '0',
    message: 'NOTOK',
    result: 'Fail - Unable to verify' 
}

I am using contract named constructor instead of keyword.

Aniket-Engg commented 5 years ago

Thanks @DigvijaySS for raising this. Can you please let us know how you have deployed the contract, i mean using remix or other ways?

digvjs commented 5 years ago

I am deploying this using ether.js deploy function.

On Sun, Apr 21, 2019, 2:07 AM Aniket notifications@github.com wrote:

Thanks @DigvijaySS https://github.com/DigvijaySS for raising this. Can you please let us know how you have deployed the contract, i mean using remix or other ways?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Aniket-Engg/sol-verifier/issues/28#issuecomment-485167047, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAQVBI47JLAPMP653XVOOTPRN5JJANCNFSM4HHCXWJA .

Aniket-Engg commented 5 years ago

Have you tried any other way of deployment? Also please double check your constructor parameters. I am trying to reproduce it at my end.

Aniket-Engg commented 5 years ago

@DigvijaySS We have tried all the ways to reproduce it but couldn't. I have deployed contract using ethers.js and successfully verified it using this package passing constructor parameters(string type too). Sample: https://rinkeby.etherscan.io/address/0x33BA5305dFA61421e3BFF3F670005B32841AF9aF#code

Still if you would like to share the related code or other information where you think something may be wrong, we will be happy to help you.

digvjs commented 5 years ago

Looks like something wrong around the datatype.

I was deploying contract with ether.js code -

var tokensToDeploy = math.multiply(numOfTokens, math.pow(10, contractDecimals));
let contract = await factory.deploy(tokenSymbol, projectName, tokensToDeploy);

This failed! To make it work, I had to change the tokensToDeploy to something as below - var tokensToDeploy = parseInt(math.multiply(numOfTokens, math.pow(10, contractDecimals)));

Now this works while verification.

Thanks!

Aniket-Engg commented 5 years ago

Great! Closing it.