From 80c03b545e6cfddd97e211f791d0c6709740ede2 Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Thu, 13 Dec 2018 20:21:48 +0300 Subject: [PATCH 1/7] fixed erc721 --- .../ERC721/Web3+ERC721.swift | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index d4abab516..eb458e601 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -9,9 +9,32 @@ import BigInt import PromiseKit import EthereumAddress +protocol IERC721 { + + func getBalance(account: EthereumAddress) throws -> BigUInt + + func getOwner(tokenId: BigUInt) throws -> EthereumAddress + + func tokenByIndex(index: BigUInt) throws -> BigUInt + + func tokenOfOwnerByIndex(owner: EthereumAddress, index: BigUInt) throws -> BigUInt + + func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction + + func transfer(from: EthereumAddress, to: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction + + func approve(approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction + + func setApprovalForAll(operator address: EthereumAddress, approved: Bool) throws -> WriteTransaction + + func getApproved(tokenId: BigUInt) throws -> EthereumAddress + + func isApprovedForAll(operator address: EthereumAddress, approved: Bool) throws -> Bool +} + // This namespace contains functions to work with ERC721 tokens. // can be imperatively read and saved -public class ERC721 { +public class ERC721: IERC721 { @available(*, deprecated, renamed: "transactionOptions") public var options: Web3Options = .init() @@ -20,6 +43,7 @@ public class ERC721 { private var _symbol: String? = nil private var _tokenId: BigUInt? = nil private var _tokenURI: String? = nil + private var _totalSupply: BigUInt? = nil private var _hasReadProperties: Bool = false public var transactionOptions: TransactionOptions @@ -74,6 +98,14 @@ public class ERC721 { return "" } + public var totalSupply: BigUInt { + self.readProperties() + if self._totalSupply != nil { + return self._totalSupply! + } + return 0 + } + public func readProperties() { if self._hasReadProperties { return @@ -90,7 +122,9 @@ public class ERC721 { guard let tokenURIpromise = contract.read("tokenURI", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - let allPromises = [namePromise, symbolPromise, tokenIdPromise, tokenURIpromise] + guard let totalSupplyPromise = contract.read("totalSupply", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} + + let allPromises = [namePromise, symbolPromise, tokenIdPromise, tokenURIpromise, totalSupplyPromise] let queue = self.web3.requestDispatcher.queue when(resolved: allPromises).map(on: queue) { (resolvedPromises) -> Void in guard case .fulfilled(let nameResult) = resolvedPromises[0] else {return} @@ -109,6 +143,10 @@ public class ERC721 { guard let uri = tokenURIresult["0"] as? String else {return} self._tokenURI = uri + guard case .fulfilled(let totalSupplyResult) = resolvedPromises[4] else {return} + guard let totalSupply = totalSupplyResult["0"] as? BigUInt else {return} + self._totalSupply = totalSupply + self._hasReadProperties = true }.wait() } @@ -122,7 +160,7 @@ public class ERC721 { return res } - public func getOwner(tokenId: BigUInt) throws -> EthereumAddress{ + public func getOwner(tokenId: BigUInt) throws -> EthereumAddress { let contract = self.contract var transactionOptions = TransactionOptions() transactionOptions.callOnBlock = .latest @@ -178,4 +216,30 @@ public class ERC721 { return tx } + public func approve(approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction { + let contract = self.contract + var basicOptions = TransactionOptions() + basicOptions.callOnBlock = .latest + + let tx = contract.write("approve", parameters: [approved, tokenId] as [AnyObject], transactionOptions: basicOptions)! + return tx + } + + public func setApprovalForAll(operator address: EthereumAddress, approved: Bool) throws -> WriteTransaction { + let contract = self.contract + var basicOptions = TransactionOptions() + basicOptions.callOnBlock = .latest + + let tx = contract.write("setApprovalForAll", parameters: [address, approved] as [AnyObject], transactionOptions: basicOptions)! + return tx + } + + public func isApprovedForAll(operator address: EthereumAddress, approved: Bool) throws -> Bool { + let contract = self.contract + var basicOptions = TransactionOptions() + basicOptions.callOnBlock = .latest + let result = try contract.read("setApprovalForAll", parameters: [address, approved] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } } From de705838e923f5f1bfc53452fad4d90e4a74befa Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Thu, 13 Dec 2018 20:31:30 +0300 Subject: [PATCH 2/7] small fix --- web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index eb458e601..3571a462c 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -216,19 +216,19 @@ public class ERC721: IERC721 { return tx } - public func approve(approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction { + public func approve(from: EthereumAddress, approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction { let contract = self.contract var basicOptions = TransactionOptions() - basicOptions.callOnBlock = .latest + basicOptions.from = from let tx = contract.write("approve", parameters: [approved, tokenId] as [AnyObject], transactionOptions: basicOptions)! return tx } - public func setApprovalForAll(operator address: EthereumAddress, approved: Bool) throws -> WriteTransaction { + public func setApprovalForAll(operator address: EthereumAddress, from: EthereumAddress, approved: Bool) throws -> WriteTransaction { let contract = self.contract var basicOptions = TransactionOptions() - basicOptions.callOnBlock = .latest + basicOptions.from = from let tx = contract.write("setApprovalForAll", parameters: [address, approved] as [AnyObject], transactionOptions: basicOptions)! return tx From a0b15f1c62e0ca837b2992c2131d7428b73a106c Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Thu, 13 Dec 2018 20:35:19 +0300 Subject: [PATCH 3/7] very small fix --- web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index 3571a462c..f50f80a68 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -23,9 +23,9 @@ protocol IERC721 { func transfer(from: EthereumAddress, to: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction - func approve(approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction + func approve(from: EthereumAddress, approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction - func setApprovalForAll(operator address: EthereumAddress, approved: Bool) throws -> WriteTransaction + func setApprovalForAll(operator address: EthereumAddress, from: EthereumAddress, approved: Bool) throws -> WriteTransaction func getApproved(tokenId: BigUInt) throws -> EthereumAddress From 7e11e650cfcaf992bf36b39257dda8ac1ffd0d94 Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Thu, 13 Dec 2018 20:41:22 +0300 Subject: [PATCH 4/7] last small fix --- web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index f50f80a68..7b449fb98 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -238,7 +238,7 @@ public class ERC721: IERC721 { let contract = self.contract var basicOptions = TransactionOptions() basicOptions.callOnBlock = .latest - let result = try contract.read("setApprovalForAll", parameters: [address, approved] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + let result = try contract.read("isApprovedForAll", parameters: [address, approved] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) guard let res = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} return res } From ca8de0d7dacc88808b3fa48e858dc1baa7be4eab Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Fri, 14 Dec 2018 02:48:46 +0300 Subject: [PATCH 5/7] major fix erc721 --- .../ERC721/Web3+ERC721.swift | 124 ++++++++---------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index 7b449fb98..f05709830 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -15,10 +15,6 @@ protocol IERC721 { func getOwner(tokenId: BigUInt) throws -> EthereumAddress - func tokenByIndex(index: BigUInt) throws -> BigUInt - - func tokenOfOwnerByIndex(owner: EthereumAddress, index: BigUInt) throws -> BigUInt - func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction func transfer(from: EthereumAddress, to: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction @@ -32,18 +28,33 @@ protocol IERC721 { func isApprovedForAll(operator address: EthereumAddress, approved: Bool) throws -> Bool } +protocol IERC721Metadata { + + func name() throws -> String + + func symbol() throws -> String + + func tokenURI(tokenId: BigUInt) throws -> String + +} + +protocol IERC721Enumerable { + + func totalSupply() throws -> BigUInt + + func tokenByIndex(index: BigUInt) throws -> BigUInt + + func tokenOfOwnerByIndex(owner: EthereumAddress, index: BigUInt) throws -> BigUInt +} + // This namespace contains functions to work with ERC721 tokens. // can be imperatively read and saved -public class ERC721: IERC721 { +public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { @available(*, deprecated, renamed: "transactionOptions") public var options: Web3Options = .init() - private var _name: String? = nil - private var _symbol: String? = nil private var _tokenId: BigUInt? = nil - private var _tokenURI: String? = nil - private var _totalSupply: BigUInt? = nil private var _hasReadProperties: Bool = false public var transactionOptions: TransactionOptions @@ -66,22 +77,6 @@ public class ERC721: IERC721 { self.transactionOptions = mergedOptions } - public var name: String { - self.readProperties() - if self._name != nil { - return self._name! - } - return "" - } - - public var symbol: String { - self.readProperties() - if self._symbol != nil { - return self._symbol! - } - return "" - } - public var tokenId: BigUInt { self.readProperties() if self._tokenId != nil { @@ -90,22 +85,6 @@ public class ERC721: IERC721 { return 0 } - public var tokenURI: String { - self.readProperties() - if self._tokenURI != nil { - return self._tokenURI! - } - return "" - } - - public var totalSupply: BigUInt { - self.readProperties() - if self._totalSupply != nil { - return self._totalSupply! - } - return 0 - } - public func readProperties() { if self._hasReadProperties { return @@ -114,39 +93,16 @@ public class ERC721: IERC721 { guard contract.contract.address != nil else {return} var transactionOptions = TransactionOptions.defaultOptions transactionOptions.callOnBlock = .latest - guard let namePromise = contract.read("name", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - - guard let symbolPromise = contract.read("symbol", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} guard let tokenIdPromise = contract.read("tokenId", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - guard let tokenURIpromise = contract.read("tokenURI", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - - guard let totalSupplyPromise = contract.read("totalSupply", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - - let allPromises = [namePromise, symbolPromise, tokenIdPromise, tokenURIpromise, totalSupplyPromise] + let allPromises = [tokenIdPromise] let queue = self.web3.requestDispatcher.queue when(resolved: allPromises).map(on: queue) { (resolvedPromises) -> Void in - guard case .fulfilled(let nameResult) = resolvedPromises[0] else {return} - guard let name = nameResult["0"] as? String else {return} - self._name = name - - guard case .fulfilled(let symbolResult) = resolvedPromises[1] else {return} - guard let symbol = symbolResult["0"] as? String else {return} - self._symbol = symbol - - guard case .fulfilled(let tokenIdResult) = resolvedPromises[2] else {return} + guard case .fulfilled(let tokenIdResult) = resolvedPromises[0] else {return} guard let tokenId = tokenIdResult["0"] as? BigUInt else {return} self._tokenId = tokenId - guard case .fulfilled(let tokenURIresult) = resolvedPromises[3] else {return} - guard let uri = tokenURIresult["0"] as? String else {return} - self._tokenURI = uri - - guard case .fulfilled(let totalSupplyResult) = resolvedPromises[4] else {return} - guard let totalSupply = totalSupplyResult["0"] as? BigUInt else {return} - self._totalSupply = totalSupply - self._hasReadProperties = true }.wait() } @@ -242,4 +198,40 @@ public class ERC721: IERC721 { guard let res = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} return res } + + public func totalSupply() throws -> BigUInt { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("totalSupply", parameters: [AnyObject](), extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } + + public func name() throws -> String { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("name", parameters: [AnyObject](), extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? String else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } + + public func symbol() throws -> String { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("symbol", parameters: [AnyObject](), extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? String else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } + + public func tokenURI(tokenId: BigUInt) throws -> String { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("tokenId", parameters: [tokenId] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? String else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } } From 871bf2d00881b493c6204013f154667f573731ae Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Fri, 14 Dec 2018 16:46:44 +0300 Subject: [PATCH 6/7] small fix --- .../PrecompiledContracts/ERC721/Web3+ERC721.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index f05709830..112366bc2 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -21,11 +21,11 @@ protocol IERC721 { func approve(from: EthereumAddress, approved: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction - func setApprovalForAll(operator address: EthereumAddress, from: EthereumAddress, approved: Bool) throws -> WriteTransaction + func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool) throws -> WriteTransaction func getApproved(tokenId: BigUInt) throws -> EthereumAddress - func isApprovedForAll(operator address: EthereumAddress, approved: Bool) throws -> Bool + func isApprovedForAll(owner: EthereumAddress, operator user: EthereumAddress) throws -> Bool } protocol IERC721Metadata { @@ -181,20 +181,20 @@ public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { return tx } - public func setApprovalForAll(operator address: EthereumAddress, from: EthereumAddress, approved: Bool) throws -> WriteTransaction { + public func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool) throws -> WriteTransaction { let contract = self.contract var basicOptions = TransactionOptions() basicOptions.from = from - let tx = contract.write("setApprovalForAll", parameters: [address, approved] as [AnyObject], transactionOptions: basicOptions)! + let tx = contract.write("setApprovalForAll", parameters: [user, approved] as [AnyObject], transactionOptions: basicOptions)! return tx } - public func isApprovedForAll(operator address: EthereumAddress, approved: Bool) throws -> Bool { + public func isApprovedForAll(owner: EthereumAddress, operator user: EthereumAddress) throws -> Bool { let contract = self.contract var basicOptions = TransactionOptions() basicOptions.callOnBlock = .latest - let result = try contract.read("isApprovedForAll", parameters: [address, approved] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + let result = try contract.read("isApprovedForAll", parameters: [owner, user] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) guard let res = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} return res } From 0f144ddcdf77d360437fd159bd221642e12f5cc4 Mon Sep 17 00:00:00 2001 From: BaldyAsh Date: Sat, 15 Dec 2018 02:17:49 +0300 Subject: [PATCH 7/7] small refactor --- .../ERC721/Web3+ERC721.swift | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift index 112366bc2..462081827 100644 --- a/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift +++ b/web3swift/PrecompiledContracts/ERC721/Web3+ERC721.swift @@ -49,7 +49,7 @@ protocol IERC721Enumerable { // This namespace contains functions to work with ERC721 tokens. // can be imperatively read and saved -public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { +public class ERC721: IERC721 { @available(*, deprecated, renamed: "transactionOptions") public var options: Web3Options = .init() @@ -134,24 +134,6 @@ public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { return res } - public func tokenByIndex(index: BigUInt) throws -> BigUInt { - let contract = self.contract - var transactionOptions = TransactionOptions() - transactionOptions.callOnBlock = .latest - let result = try contract.read("tokenByIndex", parameters: [index] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) - guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} - return res - } - - public func tokenOfOwnerByIndex(owner: EthereumAddress, index: BigUInt) throws -> BigUInt { - let contract = self.contract - var transactionOptions = TransactionOptions() - transactionOptions.callOnBlock = .latest - let result = try contract.read("tokenOfOwnerByIndex", parameters: [owner, index] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) - guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} - return res - } - public func transfer(from: EthereumAddress, to: EthereumAddress, tokenId: BigUInt) throws -> WriteTransaction { let contract = self.contract var basicOptions = TransactionOptions() @@ -199,6 +181,10 @@ public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { return res } +} + +extension ERC721: IERC721Enumerable { + public func totalSupply() throws -> BigUInt { let contract = self.contract var transactionOptions = TransactionOptions() @@ -208,6 +194,28 @@ public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { return res } + public func tokenByIndex(index: BigUInt) throws -> BigUInt { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("tokenByIndex", parameters: [index] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } + + public func tokenOfOwnerByIndex(owner: EthereumAddress, index: BigUInt) throws -> BigUInt { + let contract = self.contract + var transactionOptions = TransactionOptions() + transactionOptions.callOnBlock = .latest + let result = try contract.read("tokenOfOwnerByIndex", parameters: [owner, index] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions)!.call(transactionOptions: transactionOptions) + guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} + return res + } + +} + +extension ERC721: IERC721Metadata { + public func name() throws -> String { let contract = self.contract var transactionOptions = TransactionOptions() @@ -234,4 +242,5 @@ public class ERC721: IERC721, IERC721Enumerable, IERC721Metadata { guard let res = result["0"] as? String else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")} return res } + }