-
-
Notifications
You must be signed in to change notification settings - Fork 113
Description
If contract is not verified and we use getsource method, etherscan returns following json
{"status":"1","message":"OK","result":[{"SourceCode":"","ABI":"Contract source code not verified","ContractName":"","CompilerVersion":"","OptimizationUsed":"","Runs":"","ConstructorArguments":"","EVMVersion":"Default","Library":"","LicenseType":"Unknown","Proxy":"0","Implementation":"","SwarmSource":"","SimilarMatch":""}]}
but etherscan-api could not decode it, and fails with an error
json unmarshal outcome: json: invalid use of ,string struct tag, trying to unmarshal "" into int
I think it happens due to following code
type ContractSource struct {
....
OptimizationUsed int json:"OptimizationUsed,string"
Runs int json:"Runs,string"
...
}