Skip to content

Commit

Permalink
Merge pull request #256 from argentlabs/issue/goerli-ens-registry
Browse files Browse the repository at this point in the history
[ADD] Multicall/ENS registry addresses for Goerli
  • Loading branch information
DarthMike authored Jul 12, 2022
2 parents 9247d06 + 08c0991 commit da7bcde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web3sTests/ENS/ENSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ENSTests: XCTestCase {

func testGivenRopstenRegistry_WhenExistingDomainName_ResolvesOwnerAddressCorrectly() async {
do {
let function = ENSContracts.ENSRegistryFunctions.owner(contract: ENSContracts.RopstenAddress, _node: EthereumNameService.nameHash(name: "test").web3.hexData ?? Data())
let function = ENSContracts.ENSRegistryFunctions.owner(contract: ENSContracts.RegistryAddress, _node: EthereumNameService.nameHash(name: "test").web3.hexData ?? Data())

let tx = try function.transaction()

Expand Down
9 changes: 5 additions & 4 deletions web3swift/src/ENS/ENSContracts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import Foundation
public typealias ENSRegistryResolverParameter = ENSContracts.ResolveParameter

public enum ENSContracts {
static let RopstenAddress: EthereumAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
static let MainnetAddress: EthereumAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
static let RegistryAddress: EthereumAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"

public static func registryAddress(for network: EthereumNetwork) -> EthereumAddress? {
switch network {
case .ropsten:
return ENSContracts.RopstenAddress
return ENSContracts.RegistryAddress
case .mainnet:
return ENSContracts.MainnetAddress
return ENSContracts.RegistryAddress
case .goerli:
return ENSContracts.RegistryAddress
default:
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions web3swift/src/Multicall/MulticallContract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation
extension Multicall {
public enum Contract {

static let goerliAddress: EthereumAddress = "0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e"
static let ropstenAddress: EthereumAddress = "0x604D19Ba889A223693B0E78bC1269760B291b9Df"
static let rinkebyAddress: EthereumAddress = "0xF20A5837Eb2D9F1F7cdf9D635f3Bc68C47B8B8fF"
static let mainnetAddress: EthereumAddress = "0xF34D2Cb31175a51B23fb6e08cA06d7208FaD379F"
Expand All @@ -21,6 +22,8 @@ extension Multicall {
return Self.rinkebyAddress
case .mainnet:
return Self.mainnetAddress
case .goerli:
return Self.goerliAddress
default:
return nil
}
Expand Down

0 comments on commit da7bcde

Please sign in to comment.