From 9570182470183ace1915d8e928ee21cefebbad12 Mon Sep 17 00:00:00 2001 From: Anton Grigorev Date: Sat, 15 Dec 2018 02:46:07 +0300 Subject: [PATCH] Revert "Added erc777 precompiled contract" --- .../Public/BigInt/BigInt-iOS-umbrella.h | 2 +- .../Public/BigInt/BigInt-iOS.modulemap | 2 +- .../Public/BigInt/BigInt-macOS-umbrella.h | 2 +- .../Public/BigInt/BigInt-macOS.modulemap | 2 +- .../CryptoSwift/CryptoSwift-iOS-umbrella.h | 2 +- .../CryptoSwift/CryptoSwift-iOS.modulemap | 2 +- .../CryptoSwift/CryptoSwift-macOS-umbrella.h | 2 +- .../CryptoSwift/CryptoSwift-macOS.modulemap | 2 +- .../EthereumABI/EthereumABI-iOS-umbrella.h | 2 +- .../EthereumABI/EthereumABI-iOS.modulemap | 2 +- .../EthereumABI/EthereumABI-macOS-umbrella.h | 2 +- .../EthereumABI/EthereumABI-macOS.modulemap | 2 +- .../EthereumAddress-iOS-umbrella.h | 2 +- .../EthereumAddress-iOS.modulemap | 2 +- .../EthereumAddress-macOS-umbrella.h | 2 +- .../EthereumAddress-macOS.modulemap | 2 +- .../Public/PromiseKit/PromiseKit-umbrella.h | 2 +- .../Public/PromiseKit/PromiseKit.modulemap | 2 +- ...Kit.root-CorePromise-Foundation-umbrella.h | 2 +- ...eKit.root-CorePromise-Foundation.modulemap | 2 +- .../Public/Result/Result-iOS-umbrella.h | 2 +- .../Public/Result/Result-iOS.modulemap | 2 +- .../Public/Result/Result-macOS-umbrella.h | 2 +- .../Public/Result/Result-macOS.modulemap | 2 +- .../Public/SipHash/SipHash-iOS-umbrella.h | 2 +- .../Public/SipHash/SipHash-iOS.modulemap | 2 +- .../Public/SipHash/SipHash-macOS-umbrella.h | 2 +- .../Public/SipHash/SipHash-macOS.modulemap | 2 +- .../Public/SwiftRLP/SwiftRLP-iOS-umbrella.h | 2 +- .../Public/SwiftRLP/SwiftRLP-iOS.modulemap | 2 +- .../Public/SwiftRLP/SwiftRLP-macOS-umbrella.h | 2 +- .../Public/SwiftRLP/SwiftRLP-macOS.modulemap | 2 +- .../Public/scrypt/scrypt-iOS-umbrella.h | 2 +- .../Public/scrypt/scrypt-iOS.modulemap | 2 +- .../Public/scrypt/scrypt-macOS-umbrella.h | 2 +- .../Public/scrypt/scrypt-macOS.modulemap | 2 +- .../secp256k1_swift-iOS-umbrella.h | 2 +- .../secp256k1_swift-iOS.modulemap | 2 +- .../secp256k1_swift-macOS-umbrella.h | 2 +- .../secp256k1_swift-macOS.modulemap | 2 +- web3swift.xcodeproj/project.pbxproj | 14 - .../ERC777/Web3+ERC777.swift | 364 ---- web3swift/Web3/Classes/Web3+Utils.swift | 1731 ----------------- 43 files changed, 40 insertions(+), 2149 deletions(-) delete mode 100644 web3swift/PrecompiledContracts/ERC777/Web3+ERC777.swift diff --git a/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h b/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h index 16afa3a0c..54c439564 120000 --- a/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h +++ b/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap b/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap index ba43bbb44..5827ffd6f 120000 --- a/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap +++ b/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h b/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h index c3ee0d508..15cd9101e 120000 --- a/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h +++ b/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap b/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap index bd641c3af..db0458375 120000 --- a/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap +++ b/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h index 9c82822e9..38ee2e270 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap index 11d195f60..d3c8afa43 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h index 75d2d1a64..4f6598359 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap index fdd21eb6a..13bb9bda2 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h index 2bfc96860..372038959 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap index e4c1fe11f..ded50b1ab 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h index 296ae6f64..e72800bb6 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap index 8f1687a58..99eb1eb31 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h index 63dd90111..505dcdba1 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap index 564c53983..2e8de9c1b 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h index a71a370eb..45c29b7ea 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap index 39952c2eb..1814f3891 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h b/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h index 1de04831e..384f088cd 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h +++ b/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap b/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap index 05d14d0fb..5b105d963 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h index 2215a97db..6026bec84 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap index cb55a7e03..515bc96ce 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-iOS-umbrella.h b/Pods/Headers/Public/Result/Result-iOS-umbrella.h index 66e128f43..5017bcc62 120000 --- a/Pods/Headers/Public/Result/Result-iOS-umbrella.h +++ b/Pods/Headers/Public/Result/Result-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-iOS.modulemap b/Pods/Headers/Public/Result/Result-iOS.modulemap index c19082802..a9cb518ea 120000 --- a/Pods/Headers/Public/Result/Result-iOS.modulemap +++ b/Pods/Headers/Public/Result/Result-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-macOS-umbrella.h b/Pods/Headers/Public/Result/Result-macOS-umbrella.h index 2cd2be5b4..d933679ed 120000 --- a/Pods/Headers/Public/Result/Result-macOS-umbrella.h +++ b/Pods/Headers/Public/Result/Result-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-macOS.modulemap b/Pods/Headers/Public/Result/Result-macOS.modulemap index 31357df43..6ff87c94a 120000 --- a/Pods/Headers/Public/Result/Result-macOS.modulemap +++ b/Pods/Headers/Public/Result/Result-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h b/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h index 4880a52a0..736829e4f 120000 --- a/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h +++ b/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap b/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap index e9597c3e1..363bde1c4 120000 --- a/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap +++ b/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h b/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h index 8f93caa8a..c56e6a45b 120000 --- a/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h +++ b/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap b/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap index 3d9b28ab7..835353525 120000 --- a/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap +++ b/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h index cfc099ecc..b77347325 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap index ec58169b3..ae407f989 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h index e2ad7b9b0..4740a4f84 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap index cc3bc63c5..d1421e204 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h b/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h index 0176eb75c..1c81cd5a7 120000 --- a/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h +++ b/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap b/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap index 29e617553..02bd8338d 120000 --- a/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap +++ b/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h b/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h index e915dea97..75f99866d 120000 --- a/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h +++ b/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap b/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap index 606bbe68b..2e33aed25 120000 --- a/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap +++ b/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h index bd5ff7f5d..70cc63a67 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap index 7470662b4..c5b6fa265 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h index 15f74edd9..d75b444d6 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap index 48a096319..c0e372d55 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap @@ -1 +1 @@ -/Users/baldyash/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS.modulemap \ No newline at end of file diff --git a/web3swift.xcodeproj/project.pbxproj b/web3swift.xcodeproj/project.pbxproj index afbfbdfd6..eb489d118 100755 --- a/web3swift.xcodeproj/project.pbxproj +++ b/web3swift.xcodeproj/project.pbxproj @@ -171,8 +171,6 @@ 81FB21FF207BB297007F9A83 /* EIP67Code.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81FB21F8207BA78B007F9A83 /* EIP67Code.swift */; }; 81FB2201207BC58C007F9A83 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81FB2200207BC58B007F9A83 /* CoreImage.framework */; }; 81FB2203207BC6DB007F9A83 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81FB2202207BC6DB007F9A83 /* ImageIO.framework */; }; - 9196A68B21B9F0DA00852ED0 /* Web3+ERC777.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9196A68A21B9F0DA00852ED0 /* Web3+ERC777.swift */; }; - 9196A68C21B9F0DA00852ED0 /* Web3+ERC777.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9196A68A21B9F0DA00852ED0 /* Web3+ERC777.swift */; }; 985BFD4A216CE8B100B28C14 /* Web3+TxPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 985BFD49216CE8B100B28C14 /* Web3+TxPool.swift */; }; 985BFD4E216E2E0A00B28C14 /* Promise+Web3+TxPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 985BFD4D216E2E0A00B28C14 /* Promise+Web3+TxPool.swift */; }; B350A445E5DB35C60E59AD70 /* libPods-web3swift-macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57F8C9C48884592DCF561393 /* libPods-web3swift-macOS.a */; }; @@ -363,7 +361,6 @@ 81FECD63211AF162006DA367 /* web3swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "web3swift-Bridging-Header.h"; sourceTree = ""; }; 8349531F1984454E50389370 /* libPods-web3swift-iOS_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-web3swift-iOS_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 8675751D91DB2DBC9E7A3469 /* libPods-web3swift-macOS_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-web3swift-macOS_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 9196A68A21B9F0DA00852ED0 /* Web3+ERC777.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Web3+ERC777.swift"; sourceTree = ""; }; 985BFD49216CE8B100B28C14 /* Web3+TxPool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Web3+TxPool.swift"; sourceTree = ""; }; 985BFD4D216E2E0A00B28C14 /* Promise+Web3+TxPool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Promise+Web3+TxPool.swift"; sourceTree = ""; }; A5E8AF69880F5141B4AC9DF0 /* libPods-web3swift-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-web3swift-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -615,7 +612,6 @@ 8159C50921343EF900197B91 /* PrecompiledContracts */ = { isa = PBXGroup; children = ( - 9196A68921B9F0B100852ED0 /* ERC777 */, E279C9ED21C3F2970081695F /* ERC165 */, E2E94C5E2177886C005F54A0 /* ERC721 */, 8159C50621343ED300197B91 /* ERC20 */, @@ -801,14 +797,6 @@ name = Pods; sourceTree = ""; }; - 9196A68921B9F0B100852ED0 /* ERC777 */ = { - isa = PBXGroup; - children = ( - 9196A68A21B9F0DA00852ED0 /* Web3+ERC777.swift */, - ); - path = ERC777; - sourceTree = ""; - }; E228BD8921A4492A0085268C /* web3swiftLegacy */ = { isa = PBXGroup; children = ( @@ -1319,7 +1307,6 @@ 81C0FCF220440EB500D82FAF /* Web3+Protocols.swift in Sources */, 81C0FCF420440F0900D82FAF /* Web3+Options.swift in Sources */, 81A1822E20D67BC30016741F /* Promise+Web3+Eth+GetTransactionReceipt.swift in Sources */, - 9196A68B21B9F0DA00852ED0 /* Web3+ERC777.swift in Sources */, 81A1824020D79FDB0016741F /* Promise+Web3+Eth+EstimateGas.swift in Sources */, 81909D1221862D17007D2AE5 /* Web3+ReadingTransaction.swift in Sources */, 81A1822B20D67A1B0016741F /* Promise+Web3+Eth+GetTransactionDetails.swift in Sources */, @@ -1441,7 +1428,6 @@ 8103BBCD2077B84400499769 /* PlainKeystore.swift in Sources */, 4194813D203630530065A83B /* RIPEMD160+StackOveflow.swift in Sources */, 4194813E203630530065A83B /* Data+Extension.swift in Sources */, - 9196A68C21B9F0DA00852ED0 /* Web3+ERC777.swift in Sources */, 81A1822F20D67BC30016741F /* Promise+Web3+Eth+GetTransactionReceipt.swift in Sources */, 81A1822C20D67A1B0016741F /* Promise+Web3+Eth+GetTransactionDetails.swift in Sources */, 81909D1321862D17007D2AE5 /* Web3+ReadingTransaction.swift in Sources */, diff --git a/web3swift/PrecompiledContracts/ERC777/Web3+ERC777.swift b/web3swift/PrecompiledContracts/ERC777/Web3+ERC777.swift deleted file mode 100644 index 085016ae6..000000000 --- a/web3swift/PrecompiledContracts/ERC777/Web3+ERC777.swift +++ /dev/null @@ -1,364 +0,0 @@ -// -// Web3+ERC777.swift -// web3swift -// -// Created by Anton Grigorev on 07/12/2018. -// Copyright © 2018 The Matter Inc. All rights reserved. -// - -import Foundation -import BigInt -import PromiseKit -import EthereumAddress - -protocol IERC777 { - func getBalance(account: EthereumAddress) throws -> BigUInt - func getAllowance(originalOwner: EthereumAddress, delegate: EthereumAddress) throws -> BigUInt - func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) throws -> WriteTransaction - func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction - func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) throws -> WriteTransaction - func authorize(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction - func revoke(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction - func isOperatorFor(operator user: EthereumAddress, tokenHolder: EthereumAddress) throws -> Bool - func send(from: EthereumAddress, to: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction - func operatorSend(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction - func burn(from: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction - func operatorBurn(from: EthereumAddress, amount: String, originalOwner: EthereumAddress, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction -} - -// This namespace contains functions to work with ERC721 tokens. -// can be imperatively read and saved -public class ERC777: IERC777 { - - private var _name: String? = nil - private var _symbol: String? = nil - private var _decimals: UInt8? = nil - private var _totalSupply: BigUInt? = nil - private var _granularity: BigUInt? = nil - private var _defaultOperators: [EthereumAddress]? = nil - - private var _hasReadProperties: Bool = false - - public var transactionOptions: TransactionOptions - public var web3: web3 - public var provider: Web3Provider - public var address: EthereumAddress - - lazy var contract: web3.web3contract = { - // TODO: - need erc777abi - let contract = self.web3.contract(Web3.Utils.erc777ABI, at: self.address, abiVersion: 2) - precondition(contract != nil) - return contract! - }() - - public init(web3: web3, provider: Web3Provider, address: EthereumAddress) { - self.web3 = web3 - self.provider = provider - self.address = address - var mergedOptions = web3.transactionOptions - mergedOptions.to = address - 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 "" - } - - /// Must be 18! - public var decimals: UInt8 { - self.readProperties() - if self._decimals != nil { - return self._decimals! - } - return 18 - } - - public var totalSupply: BigUInt { - self.readProperties() - if self._totalSupply != nil { - return self._totalSupply! - } - return 0 - } - - public var granularity: BigUInt { - self.readProperties() - if self._granularity != nil { - return self._granularity! - } - return 1 - } - - public var defaultOperators: [EthereumAddress] { - self.readProperties() - if self._defaultOperators != nil { - return self._defaultOperators! - } - return [] - } - - public func readProperties() { - if self._hasReadProperties { - return - } - let contract = self.contract - 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 decimalPromise = contract.read("decimals", 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} - - guard let granularityPromise = contract.read("granularity", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - - guard let defaultOperatorsPromise = contract.read("defaultOperators", parameters: [] as [AnyObject], extraData: Data(), transactionOptions: transactionOptions)?.callPromise() else {return} - - let allPromises = [namePromise, symbolPromise, decimalPromise, totalSupplyPromise, granularityPromise, defaultOperatorsPromise] - 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 decimalsResult) = resolvedPromises[2] else {return} - guard let decimals = decimalsResult["0"] as? BigUInt else {return} - self._decimals = UInt8(decimals) - - guard case .fulfilled(let totalSupplyResult) = resolvedPromises[3] else {return} - guard let totalSupply = totalSupplyResult["0"] as? BigUInt else {return} - self._totalSupply = totalSupply - - guard case .fulfilled(let granularityResult) = resolvedPromises[4] else {return} - guard let granularity = granularityResult["0"] as? BigUInt else {return} - self._granularity = granularity - - guard case .fulfilled(let defaultOperatorsResult) = resolvedPromises[5] else {return} - guard let defaultOperators = defaultOperatorsResult["0"] as? [EthereumAddress] else {return} - self._defaultOperators = defaultOperators - - self._hasReadProperties = true - }.wait() - } - - public func getBalance(account: EthereumAddress) throws -> BigUInt { - let contract = self.contract - var transactionOptions = TransactionOptions() - transactionOptions.callOnBlock = .latest - let result = try contract.read("balanceOf", parameters: [account] 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 getAllowance(originalOwner: EthereumAddress, delegate: EthereumAddress) throws -> BigUInt { - let contract = self.contract - var transactionOptions = TransactionOptions() - transactionOptions.callOnBlock = .latest - let result = try contract.read("allowance", parameters: [originalOwner, delegate] 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, amount: String) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.to = self.address - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - let tx = contract.write("transfer", parameters: [to, value] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.to = self.address - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - - let tx = contract.write("transferFrom", parameters: [originalOwner, to, value] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.to = self.address - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(newAmount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - - let tx = contract.write("setAllowance", parameters: [to, value] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - /// ERC777 methods - public func authorize(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.callOnBlock = .latest - - let tx = contract.write("authorizeOperator", parameters: [user] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func revoke(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.callOnBlock = .latest - - let tx = contract.write("revokeOperator", parameters: [user] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func isOperatorFor(operator user: EthereumAddress, tokenHolder: EthereumAddress) throws -> Bool { - let contract = self.contract - var transactionOptions = TransactionOptions() - transactionOptions.callOnBlock = .latest - let result = try contract.read("isOperatorFor", parameters: [user, tokenHolder] 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 - } - - public func send(from: EthereumAddress, to: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.to = self.address - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - let tx = contract.write("send", parameters: [to, value, data] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func operatorSend(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.to = self.address - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - let tx = contract.write("operatorSend", parameters: [originalOwner, to, value, data, operatorData] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func burn(from: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - let tx = contract.write("burn", parameters: [value, data] as [AnyObject], transactionOptions: basicOptions)! - return tx - } - - public func operatorBurn(from: EthereumAddress, amount: String, originalOwner: EthereumAddress, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction { - let contract = self.contract - var basicOptions = TransactionOptions() - basicOptions.from = from - basicOptions.callOnBlock = .latest - - // get the decimals manually - let callResult = try contract.read("decimals", transactionOptions: basicOptions)!.call() - var decimals = BigUInt(0) - guard let dec = callResult["0"], let decTyped = dec as? BigUInt else { - throw Web3Error.inputError(desc: "Contract may be not ERC20 compatible, can not get decimals")} - decimals = decTyped - - let intDecimals = Int(decimals) - guard let value = Web3.Utils.parseToBigUInt(amount, decimals: intDecimals) else { - throw Web3Error.inputError(desc: "Can not parse inputted amount") - } - let tx = contract.write("burn", parameters: [originalOwner, value, data, operatorData] as [AnyObject], transactionOptions: basicOptions)! - return tx - } -} diff --git a/web3swift/Web3/Classes/Web3+Utils.swift b/web3swift/Web3/Classes/Web3+Utils.swift index ee2fd6957..934b759a0 100755 --- a/web3swift/Web3/Classes/Web3+Utils.swift +++ b/web3swift/Web3/Classes/Web3+Utils.swift @@ -72,1737 +72,6 @@ extension Web3.Utils { /// Precoded ERC20 contracts ABI. Output parameters are named for ease of use. public static var erc20ABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_initialAmount\",\"type\":\"uint256\"},{\"name\":\"_tokenName\",\"type\":\"string\"},{\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"name\":\"_tokenSymbol\",\"type\":\"string\"}],\"type\":\"constructor\"},{\"payable\":false,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},]" - /// Precoded ERC777 contracts ABI. Output parameters are named for ease of use. - public static var erc777ABI = """ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "from", - "type": "address" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "defaultOperators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "granularity", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - }, - { - "name": "_operatorData", - "type": "bytes" - } - ], - "name": "operatorSend", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_tokenHolder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_operator", - "type": "address" - } - ], - "name": "authorizeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - } - ], - "name": "send", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_operator", - "type": "address" - }, - { - "name": "_tokenHolder", - "type": "address" - } - ], - "name": "isOperatorFor", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_operator", - "type": "address" - } - ], - "name": "revokeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_tokenHolder", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - }, - { - "name": "_operatorData", - "type": "bytes" - } - ], - "name": "operatorBurn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - } - ], - "name": "burn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "name": "_name", - "type": "string" - }, - { - "name": "_symbol", - "type": "string" - }, - { - "name": "_granularity", - "type": "uint256" - }, - { - "name": "_defaultOperators", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Sent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "AuthorizedOperator", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "RevokedOperator", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "defaultOperators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "success", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "success", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "granularity", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - }, - { - "name": "_operatorData", - "type": "bytes" - } - ], - "name": "operatorSend", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_tokenHolder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_operator", - "type": "address" - } - ], - "name": "authorizeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - } - ], - "name": "send", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "success", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_operator", - "type": "address" - }, - { - "name": "_tokenHolder", - "type": "address" - } - ], - "name": "isOperatorFor", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - }, - { - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "remaining", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_operator", - "type": "address" - } - ], - "name": "revokeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_tokenHolder", - "type": "address" - }, - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - }, - { - "name": "_operatorData", - "type": "bytes" - } - ], - "name": "operatorBurn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_amount", - "type": "uint256" - }, - { - "name": "_data", - "type": "bytes" - } - ], - "name": "burn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "name": "_name", - "type": "string" - }, - { - "name": "_symbol", - "type": "string" - }, - { - "name": "_granularity", - "type": "uint256" - }, - { - "name": "_defaultOperators", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Sent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "AuthorizedOperator", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "RevokedOperator", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "defaultOperators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "granularity", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "from", - "type": "address" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "operatorData", - "type": "bytes" - } - ], - "name": "operatorSend", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "operator", - "type": "address" - } - ], - "name": "authorizeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "send", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "operator", - "type": "address" - }, - { - "name": "tokenHolder", - "type": "address" - } - ], - "name": "isOperatorFor", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "operator", - "type": "address" - } - ], - "name": "revokeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "from", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "operatorData", - "type": "bytes" - } - ], - "name": "operatorBurn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "amount", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "burn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Sent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - }, - { - "indexed": false, - "name": "operatorData", - "type": "bytes" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "AuthorizedOperator", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "name": "tokenHolder", - "type": "address" - } - ], - "name": "RevokedOperator", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "operator", - "type": "address" - }, - { - "name": "from", - "type": "address" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "operatorData", - "type": "bytes" - } - ], - "name": "tokensReceived", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "operator", - "type": "address" - }, - { - "name": "from", - "type": "address" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "userData", - "type": "bytes" - }, - { - "name": "operatorData", - "type": "bytes" - } - ], - "name": "tokensToSend", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "addr", - "type": "address" - }, - { - "name": "iHash", - "type": "bytes32" - }, - { - "name": "implementer", - "type": "address" - } - ], - "name": "setInterfaceImplementer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "addr", - "type": "address" - } - ], - "name": "getManager", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "addr", - "type": "address" - }, - { - "name": "newManager", - "type": "address" - } - ], - "name": "setManager", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "addr", - "type": "address" - }, - { - "name": "iHash", - "type": "bytes32" - } - ], - "name": "getInterfaceImplementer", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "new_address", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "last_completed_migration", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "completed", - "type": "uint256" - } - ], - "name": "setCompleted", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - } -] -""" - public static var erc721ABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"_name\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_approved\",\"type\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"_symbol\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_operator\",\"type\":\"address\"},{\"name\":\"_approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_approved\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_operator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"}]" public static var ensRegistryABI = """ [{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"label","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"ttl","outputs":[{"name":"","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"resolver","type":"address"}],"name":"NewResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"ttl","type":"uint64"}],"name":"NewTTL","type":"event"}]