-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Send ERC-20 Token error #251
Comments
I also get an error when I try to send the token to a different address
It appears an error like this: PromiseKit: warning: Please help me, what do I have to do to fix it, and send my ERC token smoothly? Thanks! |
change: options.value = Web3.Utils.parseToBigUInt("0", decimals: token.decimals) no thanks. |
Thank you very much!!! |
|
Feel free to reopen the issue, if you still need help. 👍 |
// 交易
let value: String = amountStr
let walletAddress = EthereumAddress(wallet.address)! // Your wallet address
let toAddress = EthereumAddress(toAddressStr)!
let erc20ContractAddress = EthereumAddress("0xaB8Ad2d7f39A54960Be8b71e01276a9E897833eE", ignoreChecksum:true)!
let contract = self.web3.contract(Web3.Utils.erc20ABI, at: erc20ContractAddress, abiVersion: 2)!
let amount = Web3.Utils.parseToBigUInt(value, units: .eth)
var options = TransactionOptions.defaultOptions
options.value = amount
options.from = walletAddress
options.gasPrice = .automatic
options.gasLimit = .automatic
let method = "transfer"
let tx = contract.write(
method,
parameters: [toAddress, amount] as [AnyObject],
extraData: Data(),
transactionOptions: options)!
back:
processingError(desc: "Failed to fetch gas estimate")
The text was updated successfully, but these errors were encountered: