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
//trans
let fromAddress: Address = "0x65d1d0dfc525aff63aa2ffea0c3256c171b4ee6a"
let toAddress: Address = "0x95171276fda97ba1ff19af8481bf597bbcdfde83"
let amount = try NaturalUnits.init("1.23")
let amount18 = amount.number(with: 18)
let erc20 = ERC20(self.contractAddress)
erc20.options.from = fromAddress
let erc20Result = try erc20.transferFrom(owner: fromAddress, to: toAddress, amount: amount18)
The error is "Failed to fetch gas estimate"
//get token name
let token = ERC20(contractAddress)
let name = try token.name()
The error is notFound
Please help me to solve the issue , thanks
The text was updated successfully, but these errors were encountered:
wq19920109
changed the title
Swnd ERC token error And get token name error
Send ERC token error And get token name error
Apr 20, 2020
wq19920109
changed the title
Send ERC token error And get token name error
Send ERC20 token error And get token name error
Apr 20, 2020
You have an old example of using lib Now we get the name of token now we used ->
Go to https://infura.io/dashboard/ethereum
Create a new project. In new project you will have PROJECT ID
guard let url = URL(string: "https://kovan.infura.io/v3/your PROJECT ID"), let web3 = try? Web3.new(url) else { return } let w3sTokenAddress = EthereumAddress("")! let st20token = ERC20.init(web3: web3, provider: web3.provider, address: w3sTokenAddress)
label
//trans
let fromAddress: Address = "0x65d1d0dfc525aff63aa2ffea0c3256c171b4ee6a"
let toAddress: Address = "0x95171276fda97ba1ff19af8481bf597bbcdfde83"
let amount = try NaturalUnits.init("1.23")
let amount18 = amount.number(with: 18)
let erc20 = ERC20(self.contractAddress)
erc20.options.from = fromAddress
let erc20Result = try erc20.transferFrom(owner: fromAddress, to: toAddress, amount: amount18)
The error is "Failed to fetch gas estimate"
//get token name
let token = ERC20(contractAddress)
let name = try token.name()
The error is notFound
Please help me to solve the issue , thanks
The text was updated successfully, but these errors were encountered: