You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-42Lines changed: 26 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@
55
55
-[x] Interactions (read/write to Smart contracts) :arrows_counterclockwise:
56
56
-[x] Parsing TxPool content into native values (ethereum addresses and transactions) - easy to get pending transactions
57
57
-[x] Event loops functionality
58
+
-[x] Supports Web3View functionality - WKWebView with injected "web3" provider
59
+
-[x] Possibility to add or remove "middleware" that intercepts, modifies and even cancel transaction workflow on stages "before assembly", "after assembly"and "before submission"
58
60
-[x] Literally following the standards:
59
61
- [x] [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD Wallets: Deterministic Wallet
@@ -173,51 +175,32 @@ For example: you want to interact with smart-contract and all you know is - its
173
175
174
176
You can get the ABI of your contract directly from [Remix IDE](https://remix.ethereum.org/) ([Solution](https://ethereum.stackexchange.com/questions/27536/where-to-find-contract-abi-in-new-version-of-online-remix-solidity-compiler?rq=1))
175
177
176
-
Then you should use contract address and ABI in creating contract object:
178
+
Then you should use contract address and ABI in creating contract object. In example we use Infura Mainnet:
177
179
```swift
178
-
let contract = Web3.InfuraMainnetWeb3().contract(<abiString:String>, at: <EthereumAddress?>, abiVersion: <Int>)
180
+
let yourContractABI: String=<CONTRACT JSON ABI>
181
+
let toEthereumAddress: EthereumAddress?=<DESTINATION ETHEREUM ADDRESS>
182
+
let abiVersion: Int=<ABI VERSION NUMBER>
183
+
184
+
let contract = Web3.InfuraMainnetWeb3().contract(yourContractABI, at: toEthereumAddress, abiVersion: abiVersion)
179
185
```
180
-
To create transaction you should call some contract method:
186
+
Here is the example how you should call some contract method:
181
187
```swift
182
-
let transaction = contract.method(<method:String>, parameters: <[AnyObject]>, extraData: <Data>, options: <Web3Options?>)
188
+
let method: String=<CONTRACT METHOD NAME>
189
+
let parameters: [AnyObject] =<PARAMETERS>
190
+
let extraData: Data =<DATA>
191
+
let transactionOptions: TransactionOptions =<OPTIONS>
192
+
193
+
let transaction = contract.read(method, parameters: parameters, extraData: extraData, transactionOptions: transactionOptions)
183
194
```
184
195
185
-
Here is the function example that creates TransactionIntermediate object, that you can send to smart-contract:
196
+
Here is the example how you should send transaction to some contract method:
guardlet transaction = contract.method("<METHOD OF CONTRACT YOU WANT TO CALL>", parameters: [parameters] as [AnyObject], options: options) else {return}
213
-
guardcase .success(let estimate) = transaction.estimateGas(options: options) else {return} //here is estimated gas - something like confirming that you made a transaction correctly
214
-
print("estimated cost: \(estimate)")
215
-
216
-
DispatchQueue.main.async {
217
-
completion(Result.Success(transaction))
218
-
}
219
-
}
220
-
}
203
+
let transaction = contract.write(method, parameters: parameters, extraData: extraData, transactionOptions: transactionOptions)
-[x][EIP-165](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md) (Creates a standard method to publish and detect what interfaces a smart contract implements - ERC-165)
235
218
-[x][EIP-777](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-777.md) (A new advanced token standard - ERC-777)
219
+
-[x][EIP-888](https://github.com/ethereum/EIPs/issues/888) (MultiDimensional Token Standard - ERC-888)
220
+
-[x][EIP-1400](https://github.com/ethereum/EIPs/issues/1411) (Security Token Standard - ERC-1400)
221
+
-[x][R-Token](https://github.com/harborhq/r-token) (Smart Contracts for applying regulatory compliance to tokenized securities issuance and trading)
222
+
-[x][SRC-20](https://swarm.fund/swarm-basics/) (Swarm protocol that enables the tokenization of assets on the blockchain - Security Tokens)
223
+
-[x][ST-20](https://github.com/PolymathNetwork/polymath-core) (ST-20 token is an Ethereum-based token implemented on top of the ERC-20 protocol that adds the ability for tokens to control transfers based on specific rules)
236
224
-[x][Objective-C] - a proxy bridge to build your DApp on Objective-C using web3swift
237
-
-[x] Support Web3View functionality - WKWebView with injected "web3" provider
238
-
-[x] Add or remove "middleware" that intercepts, modifies and even cancel transaction workflow on stages "before assembly", "after assembly"and "before submission"
239
-
-[x] Put the groundwork for implementing hooks functionality
240
-
-[x] No more "Web3Options" - new classes "ReadTransaction" and "WriteTransaction" with a variable "transactionOptions" used to specify gas price, limit, nonce policy, value
0 commit comments