add UEFA ropsten as a constant

pull/1566/head
James Sangalli 5 years ago
parent ed401eb030
commit 9bb0f72d84
  1. 3
      AlphaWallet/Settings/Types/Constants.swift
  2. 7
      AlphaWallet/Tokens/Coordinators/GetERC721ForTicketsBalanceCoordinator.swift
  3. 2
      AlphaWallet/Tokens/Coordinators/GetIsERC721ForTicketsContractCoordinator.swift

@ -55,6 +55,9 @@ public struct Constants {
// FIFA hardcoded FIFA token address
static let ticketContractAddress = AlphaWallet.Address(string: "0xA66A3F08068174e8F005112A8b2c7A507a822335")!
static let ticketContractAddressRopsten = AlphaWallet.Address(string: "0xD8e5F58DE3933E1E35f9c65eb72cb188674624F3")!
// UEFA hardcoded addresses
static let uefaRopsten = AlphaWallet.Address(string: "0x439bf1B20841Fa5498C3471C202F438147b7e447")!
// Hardcoded discovery token address
static let discoveryContractAddress = AlphaWallet.Address(string: "0x8c0edb69ebf038ba0c7a4873e40fc09725064c2e")!

@ -2,6 +2,7 @@
import Foundation
import Result
import BigInt
class GetERC721ForTicketsBalanceCoordinator {
private let server: RPCServer
@ -21,10 +22,10 @@ class GetERC721ForTicketsBalanceCoordinator {
}
private func adapt(_ values: Any?) -> [String] {
guard let array = values as? [Data] else { return [] }
guard let array = values as? [BigUInt] else { return [] }
return array.map { each in
let value = each.toHexString()
let value = each.serialize().hex()
return "0x\(value)"
}
}
}
}

@ -13,7 +13,7 @@ class GetIsERC721ForTicketsContractCoordinator {
func getIsERC721ForTicketContract(for contract: AlphaWallet.Address, completion: @escaping (Result<Bool, AnyError>) -> Void) {
//TODO check ERC165 interface hash
//TODO update with production ready contract
let defaultTicketContract = Constants.ticketContractAddress
let defaultTicketContract = Constants.uefaRopsten
if contract.sameContract(as: defaultTicketContract) {
completion(.success(true))
} else {

Loading…
Cancel
Save