Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] Multicall/ENS registry addresses for Goerli #256

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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