'SourceUnit' object has no attribute 'name' - when trying to fetch a contract from explorer
### Environment information

* `brownie` Version: 1.16.0
* `ganache-cli` Version: 6.12.1
* `solc` Version: 0.8.4+commit.c7e474f2.Darwin.appleclang
* Python Version: 3.9.5
* OS: osx/linux/win MacOS 10.15.7 (19H1217)

### What was wrong?

I was running tests and they were failing, the error was 'SourceUnit' object has no attribute 'name' 

I then tried to run the command:
`Contract.from_explorer("0xBA12222222228d8Ba445958a75a0704d566BF2C8")` 
Getting the same error message: `'SourceUnit' object has no attribute 'name' `
Which tries to fetch the Balancer Vault Contract from Etherscan, this seems to break the emulation


### Full output
```
brownie console

Brownie environment is ready.
>>> Contract.from_explorer("0xBA12222222228d8Ba445958a75a0704d566BF2C8")
Fetching source of 0xBA12222222228d8Ba445958a75a0704d566BF2C8 from api.etherscan.io...
  File "<console>", line 1, in <module>
  File "brownie/network/contract.py", line 1208, in from_explorer
    build_json = compiler.generate_build_json(input_json, output_json)
  File "brownie/project/compiler/__init__.py", line 317, in generate_build_json
    build_json[contract_alias] = solidity._get_unique_build_json(
  File "brownie/project/compiler/solidity.py", line 260, in _get_unique_build_json
    pc_map, statement_map, branch_map = _generate_coverage_data(
  File "brownie/project/compiler/solidity.py", line 451, in _generate_coverage_data
    active_fn_node, active_fn_name = _get_active_fn(active_source_node, offset)
  File "brownie/project/compiler/solidity.py", line 596, in _get_active_fn
    return fn_node, f"{fn_node.parent().name}.{name}"
AttributeError: 'SourceUnit' object has no attribute 'name'
>>>
```

### How can it be fixed?

Not sure, but would just want brownie to run the bytecode without knowing what the contract is
diff --git a/brownie/project/compiler/solidity.py b/brownie/project/compiler/solidity.py
index a413c521..e244735b 100644
--- a/brownie/project/compiler/solidity.py
+++ b/brownie/project/compiler/solidity.py
@@ -593,6 +593,12 @@ def _get_active_fn(source_node: NodeBase, offset: Tuple[int, int]) -> Tuple[Node
             name = "<constructor>"
         else:
             name = "<fallback>"
+
+    parent = fn_node.parent()
+    if parent.nodeType == "SourceUnit":
+        # the function exists outside a contract
+        return fn_node, name
+
     return fn_node, f"{fn_node.parent().name}.{name}"
 
 
['brownie/project/compiler/solidity.py']