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
let contractAddress =EthereumAddress("0x45245bc59219eeaaf6cd3f382e078a461ff9de7b")!//BKX token on Ethereum mainnet
286
+
let contractAddress =EthereumAddress("0x8932404A197D84Ec3Ea55971AADE11cdA1dddff1")!//w3s token on Ethereum mainnet
287
287
let contract = web3.contract(Web3.Utils.erc20ABI, at: contractAddress, abiVersion: 2)!// utilize precompiled ERC20 ABI for your concenience
288
-
guardlet bkxBalanceResult = contract.method("balanceOf", parameters: [coldWalletAddress] as [AnyObject], options: options)?.call(options: nil) else {return} // encode parameters for transaction
289
-
guardcase .success(let bkxBalance) = bkxBalanceResult, let bal = bkxBalance["0"] as? BigUInt else {return} // bkxBalance is [String: Any], and parameters are enumerated as "0", "1", etc in order of being returned. If returned parameter has a name in ABI, it is also duplicated
290
-
print("BKX token balance = "+String(bal))
288
+
guardlet w3sBalanceResult = contract.method(
289
+
"balanceOf",
290
+
parameters: [coldWalletAddress] as [AnyObject],
291
+
options: options
292
+
)?.call(options: nil)
293
+
else {return} // encode parameters for transaction
294
+
guardcase .success(let w3sBalance) = w3sBalanceResult, let bal = w3sBalance["0"] as? BigUInt else {return} // w3sBalance is [String: Any], and parameters are enumerated as "0", "1", etc in order of being returned. If returned parameter has a name in ABI, it is also duplicated
0 commit comments