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
Hi All, I am having some trouble calling a method on the ENS registrar contract. Some methods work fine, while others give me a gas estimation error.
For example, I am able to call startAuction with no problems like so:
letparameters=["0x\(name.labelHash!)"]as[AnyObject]DispatchQueue.global().async{letgasPriceResult=Keys.shared.web3.eth.getGasPrice()
guard case .success(let gasPrice)= gasPriceResult else{return}varoptions=Web3Options.defaultOptions()
options.gasPrice = gasPrice
options.gasLimit =BigUInt(200000)
options.from =Keys.shared.manager?.addresses?.first!
DispatchQueue.global().async{letcontract=Keys.shared.web3.contract(Web3.Utils.registrarABI, at:ENSRegistrar.registrarContract, abiVersion:2)!
letintermediate= contract.method("startAuction", parameters: parameters, options: options)
guard let res = intermediate?.send(password:"PASSWORD")else{return}
switch res {case.success(let res):completion(true,nil)case.failure(let error):completion(false, error)}}}
Starting the auction works fine and the tx goes through: https://ropsten.etherscan.io/tx/0x59ad6cfa53985301ecdf6c07df20b02e55aa31965a45e14e0b2f6b3ec5e85823
However, when I try to call newBid in the same manner, I get a gas estimation error.
This is the error I am getting. It happens at the case .failure line:
failure res:.failure(processingError(desc:"Failed to fetch gas estimate"))
Here is my code calling newBid:
letparameters=["0x\(sealedBid!)"]as[AnyObject]DispatchQueue.global().async{letgasPriceResult=Keys.shared.web3.eth.getGasPrice()
guard case .success(let gasPrice)= gasPriceResult else{return}varoptions=Web3Options.defaultOptions()
options.gasPrice = gasPrice
options.gasLimit =BigUInt(200000)
options.from =Keys.shared.manager?.addresses?.first!
letcontract=Keys.shared.web3.contract(Web3.Utils.registrarABI, at:ENSRegistrar.registrarContract, abiVersion:2)!
letintermediate= contract.method("newBid", parameters: parameters, options: options)DispatchQueue.global().async{
guard let res = intermediate?.send(password:"PASSWORD")else{return}
switch res {case.success(_):completion(true,nil)case.failure(let error):
// this is where I'm getting a gas estimation error
print("failure res: \(res)")completion(false, error)}}
I am using the following contract on Ropsten: https://ropsten.etherscan.io/address/0xc19fd9004b5c9789391679de6d766b981db94610#code
Hi All, I am having some trouble calling a method on the ENS registrar contract. Some methods work fine, while others give me a gas estimation error.
For example, I am able to call
startAuction
with no problems like so:Starting the auction works fine and the tx goes through:
https://ropsten.etherscan.io/tx/0x59ad6cfa53985301ecdf6c07df20b02e55aa31965a45e14e0b2f6b3ec5e85823
However, when I try to call
newBid
in the same manner, I get a gas estimation error.This is the error I am getting. It happens at the
case .failure
line:Here is my code calling
newBid
:I am using the following contract on Ropsten:
https://ropsten.etherscan.io/address/0xc19fd9004b5c9789391679de6d766b981db94610#code
And here's the ABI:
I'm not sure why one function is working while the other is throwing gas estimation errors. Is there a way to NOT use the gas estimator? Thanks!
The text was updated successfully, but these errors were encountered: