Skip to content

Lesson 4 - Attribute Error #16

Answered by PatrickAlphaC
oceanKingEth asked this question in Q&A
Discussion options

You must be logged in to vote

Does all the rest of your code look like this:

import json

from web3 import Web3

# In the video, we forget to `install_solc`
# from solcx import compile_standard
from solcx import compile_standard, install_solc
import os
from dotenv import load_dotenv

load_dotenv()


with open("./SimpleStorage.sol", "r") as file:
    simple_storage_file = file.read()

# We add these two lines that we forgot from the video!
print("Installing...")
install_solc("0.6.0")

# Solidity source code
compiled_sol = compile_standard(
    {
        "language": "Solidity",
        "sources": {"SimpleStorage.sol": {"content": simple_storage_file}},
        "settings": {
            "outputSelection": {
                

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oceanKingEth
Comment options

Answer selected by PatrickAlphaC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants