为okx修改gasLimt和gasPrice的设置方式
This commit is contained in:
parent
30e1fb6b6a
commit
e78bc9390f
@ -344,7 +344,7 @@ export class Wallet {
|
|||||||
if (res.error) {
|
if (res.error) {
|
||||||
throw new Error(res.error.message)
|
throw new Error(res.error.message)
|
||||||
}
|
}
|
||||||
return res.result
|
return parseInt(res.result) * 3
|
||||||
}
|
}
|
||||||
|
|
||||||
async chainCheckIn(address) {
|
async chainCheckIn(address) {
|
||||||
@ -356,7 +356,7 @@ export class Wallet {
|
|||||||
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
||||||
let gasPrice = await web3.eth.getGasPrice()
|
let gasPrice = await web3.eth.getGasPrice()
|
||||||
// console.log('chainCheckIn gasPrice: ', gasPrice)
|
// console.log('chainCheckIn gasPrice: ', gasPrice)
|
||||||
gasPrice = gasPrice * 2n
|
// gasPrice = gasPrice * 2n
|
||||||
let gasLimit = await this.estimateGas(address, '0xd8edeb1b');
|
let gasLimit = await this.estimateGas(address, '0xd8edeb1b');
|
||||||
console.log('gasLimit: ', gasLimit, 'gasPrice:', gasPrice)
|
console.log('gasLimit: ', gasLimit, 'gasPrice:', gasPrice)
|
||||||
return instance.methods.dailyCheckin().send({ from: address, gasPrice, gasLimit });
|
return instance.methods.dailyCheckin().send({ from: address, gasPrice, gasLimit });
|
||||||
@ -385,7 +385,7 @@ export class Wallet {
|
|||||||
let idBN = web3.utils.toBigInt('0x'+exploreId)
|
let idBN = web3.utils.toBigInt('0x'+exploreId)
|
||||||
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
||||||
let gasPrice = await web3.eth.getGasPrice()
|
let gasPrice = await web3.eth.getGasPrice()
|
||||||
gasPrice = gasPrice * 2n
|
// gasPrice = gasPrice * 2n
|
||||||
// let gasLimit = await instance.methods.explore(idBN).estimateGas({ from: address });
|
// let gasLimit = await instance.methods.explore(idBN).estimateGas({ from: address });
|
||||||
const dataStr = '0x6457e389' + exploreId.padStart(64, '0');
|
const dataStr = '0x6457e389' + exploreId.padStart(64, '0');
|
||||||
const gasLimit = await this.estimateGas(address, dataStr)
|
const gasLimit = await this.estimateGas(address, dataStr)
|
||||||
@ -418,7 +418,6 @@ export class Wallet {
|
|||||||
let codeBn = web3.utils.toBigInt('0x'+codeHex)
|
let codeBn = web3.utils.toBigInt('0x'+codeHex)
|
||||||
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
||||||
let gasPrice = await web3.eth.getGasPrice()
|
let gasPrice = await web3.eth.getGasPrice()
|
||||||
gasPrice = gasPrice * 2n
|
|
||||||
// let gasLimit = await instance.methods.enhanceBox(codeBn).estimateGas({ from: address });
|
// let gasLimit = await instance.methods.enhanceBox(codeBn).estimateGas({ from: address });
|
||||||
const dataStr = '0x44a17e06' + codeHex.padStart(64, '0');
|
const dataStr = '0x44a17e06' + codeHex.padStart(64, '0');
|
||||||
const gasLimit = await this.estimateGas(address, dataStr)
|
const gasLimit = await this.estimateGas(address, dataStr)
|
||||||
@ -453,7 +452,7 @@ export class Wallet {
|
|||||||
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
||||||
|
|
||||||
let gasPrice = await web3.eth.getGasPrice()
|
let gasPrice = await web3.eth.getGasPrice()
|
||||||
gasPrice = gasPrice * 2n
|
// gasPrice = gasPrice * 2n
|
||||||
// let gasLimit = await instance.methods.openBox(boxIdBN).estimateGas({ from: address });
|
// let gasLimit = await instance.methods.openBox(boxIdBN).estimateGas({ from: address });
|
||||||
const dataStr = '0xb1e5e2b7' + boxId.padStart(64, '0');
|
const dataStr = '0xb1e5e2b7' + boxId.padStart(64, '0');
|
||||||
const gasLimit = await this.estimateGas(address, dataStr)
|
const gasLimit = await this.estimateGas(address, dataStr)
|
||||||
@ -486,7 +485,7 @@ export class Wallet {
|
|||||||
let taskIdBN = web3.utils.toBigInt('0x'+taskIdHex)
|
let taskIdBN = web3.utils.toBigInt('0x'+taskIdHex)
|
||||||
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
const instance = this.initInstance(web3, process.env.VUE_APP_CONTRACT, treasureAbi, address);
|
||||||
let gasPrice = await web3.eth.getGasPrice()
|
let gasPrice = await web3.eth.getGasPrice()
|
||||||
gasPrice = gasPrice * 2n
|
// gasPrice = gasPrice * 2n
|
||||||
// let gasLimit = await instance.methods.claimTaskReward(taskIdBN).estimateGas({ from: address });
|
// let gasLimit = await instance.methods.claimTaskReward(taskIdBN).estimateGas({ from: address });
|
||||||
const dataStr = '0x4052a9c7' + taskIdHex.padStart(64, '0');
|
const dataStr = '0x4052a9c7' + taskIdHex.padStart(64, '0');
|
||||||
const gasLimit = await this.estimateGas(address, dataStr)
|
const gasLimit = await this.estimateGas(address, dataStr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user