Skip to content

Commit

Permalink
Adding more about solc options, trying to figure out how to make Ethe…
Browse files Browse the repository at this point in the history
…rScan to verify solc 0.4.14.
  • Loading branch information
miohtama committed Aug 23, 2017
1 parent 6326801 commit b455e58
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
7 changes: 6 additions & 1 deletion crowdsales/allocated-token-sale-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ kovan:
#
# solc --version
#
solc_version: 0.4.14+commit.c2215d46
# Note that for EtherScan you need to add letter "v" at the front of the version
#
# Note: You need to have correct optmization settings for the compiler
# in populus.json that matches what EtherScan is expecting.
#
solc_version: v0.4.14+commit.c2215d46

contracts:
# This is the address of the multisig wallet where the paymnts eventually land
Expand Down
15 changes: 15 additions & 0 deletions crowdsales/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ testnet:
# This is a semi automatic process using a Firefox browser.
verify_on_etherscan: yes

# For available versions see
# https://etherscan.io/address/0xa8659f5af01796b39e0dfb3323acc00d8fe97ea2#code
# Click Verify and Publish
# See values in Compiler drop down.
# You can also get the local compiler version with:
#
# solc --version
#
# Note that for EtherScan you need to add letter "v" at the front of the version
#
# Note: You need to have correct optmization settings for the compiler
# in populus.json that matches what EtherScan is expecting.
#
solc_version: v0.4.14+commit.c2215d46

#
# Contracts section defines different smart contracts that
# are required to run the ICO.
Expand Down
3 changes: 3 additions & 0 deletions crowdsales/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ unit_test:
# This is a semi automatic process using a Firefox browser.
verify_on_etherscan: no

# Not used in unit tests
solc_version: v0.4.14+commit.c2215d46

#
# Contracts section defines different smart contracts that
# are required to run the ICO.
Expand Down
3 changes: 2 additions & 1 deletion ico/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def deploy_crowdsale(project: Project, chain, source_definitions: dict, deploy_a
constructor_args=runtime_data["contracts"][name]["constructor_args"],
libraries=runtime_data["contracts"][name]["libraries"],
browser_driver=browser_driver,
compiler=solc_version)
compiler=solc_version,
optimization=False)
runtime_data["contracts"][name]["etherscan_link"] = get_etherscan_link(chain_name, runtime_data["contracts"][name]["address"])

# Write out our expanded contract
Expand Down
1 change: 1 addition & 0 deletions ico/etherscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def verify_contract(project: Project, chain_name: str, address: str, contract_na

print("Contract verification failed. Check the browser for details.")
print("Make sure solc_version in your YAML file matches solc --version output.")
print("Make sure solc optimization settings are the same as what EtherScan thinks.")
input("Press enter to continue")

return src
Expand Down
2 changes: 1 addition & 1 deletion populus.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"settings": {
"stdin": {
"optimizer": {
"enabled": true,
"enabled": false,
"runs": 500
},
"outputSelection": {
Expand Down

0 comments on commit b455e58

Please sign in to comment.