修改gas数量
This commit is contained in:
parent
63051447c8
commit
ff177093f8
@ -156,7 +156,7 @@ export class ERC20Reactor {
|
||||
return contract.methods.mint(to, amountBN).encodeABI()
|
||||
}
|
||||
let gas = await contract.methods.mint(to, amountBN).estimateGas({ gas: 1000000 })
|
||||
return contract.methods.mint(to, amountBN).send({ gas: (gas * 1.1) | 0 })
|
||||
return contract.methods.mint(to, amountBN).send({ gas: (gas * 1.5) | 0 })
|
||||
}
|
||||
|
||||
async getPastEvents({ address, fromBlock }: { address?: string; fromBlock: number }) {
|
||||
|
@ -340,7 +340,7 @@ export class ERC721Reactor {
|
||||
return contract.methods.mint(to, tokenId).encodeABI()
|
||||
}
|
||||
let gas = await contract.methods.mint(to, tokenId).estimateGas({ gas: 1000000 })
|
||||
return contract.methods.mint(to, tokenId).send({ gas: gas | 0 })
|
||||
return contract.methods.mint(to, tokenId).send({ gas: (gas * 1.5) | 0 })
|
||||
}
|
||||
|
||||
async batchMint({
|
||||
@ -364,7 +364,7 @@ export class ERC721Reactor {
|
||||
return contract.methods.batchMint(to, countStr).encodeABI()
|
||||
}
|
||||
let gas = await contract.methods.batchMint(to, countStr).estimateGas({ from: account || this.account.address })
|
||||
return contract.methods.batchMint(to, countStr).send({ gas: gas | 0 })
|
||||
return contract.methods.batchMint(to, countStr).send({ gas: (gas * 1.5) | 0 })
|
||||
}
|
||||
|
||||
async getPastEvents({ address, fromBlock }: { address?: string; fromBlock: number }) {
|
||||
|
@ -43,7 +43,7 @@ export class WalletReactor {
|
||||
.estimateGas({ from: this.account.address })
|
||||
let res = await this.contract.methods
|
||||
.schedule(operation.targets, operation.values, operation.datas, operation.predecessor, operation.salt, seconds)
|
||||
.send({ gas: gas | 0 })
|
||||
.send({ gas: (gas * 1.5) | 0 })
|
||||
operation.transactionHash = res.transactionHash
|
||||
return operation
|
||||
}
|
||||
@ -88,10 +88,9 @@ export class WalletReactor {
|
||||
let gas = await this.contract.methods
|
||||
.execute(operation.targets, operation.values, operation.datas, operation.predecessor, operation.salt)
|
||||
.estimateGas({ from: this.account.address })
|
||||
gas = gas | 0
|
||||
let res = await this.contract.methods
|
||||
.execute(operation.targets, operation.values, operation.datas, operation.predecessor, operation.salt)
|
||||
.send({ gas })
|
||||
.send({ gas: (gas * 1.5) | 0 })
|
||||
return res
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user