Beispiel #1
0
def vy_registry(w3):
    registry_path = ASSETS_DIR / "vyper_registry"
    manifest = json.loads((registry_path / "1.0.0.json").read_text().rstrip('\n'))
    registry_package = Package(manifest, w3)
    registry_deployer = Deployer(registry_package)
    deployed_registry_package = registry_deployer.deploy("registry")
    registry_instance = deployed_registry_package.deployments.get_instance("registry")
    assert registry_instance.functions.owner().call() == w3.eth.defaultAccount
    return VyperReferenceRegistry(to_canonical_address(registry_instance.address), w3)
Beispiel #2
0
def sol_registry(w3):
    manifest = json.loads((ASSETS_DIR / "registry" / "1.0.0.json").read_text())
    strategy = solidity_registry_strategy()
    registry_package = Package(manifest, w3)
    registry_deployer = Deployer(registry_package)
    registry_deployer.register_strategy("PackageRegistry", strategy)
    deployed_registry_package = registry_deployer.deploy("PackageRegistry")
    assert isinstance(registry_package, Package)
    registry = deployed_registry_package.deployments.get_instance("PackageRegistry")
    return SolidityReferenceRegistry(to_canonical_address(registry.address), w3)
Beispiel #3
0
def twig_deployer(compiler, w3):
    # Return a Deployer containing all .vy contracts found
    sources = compiler.get_source_tree()
    contract_types = compiler.get_contract_types()
    pkg = b.build(b.init_manifest("twig", "1.0.0"), *sources, *contract_types,
                  b.as_package(w3))
    return Deployer(pkg)
Beispiel #4
0
 def _deployer(path: Path) -> Deployer:
     manifest = json.loads(path.read_text())
     package = Package(manifest, w3)
     return Deployer(package)