修正一些gas计算未严格转化成整数的bug

This commit is contained in:
cebgcontract 2022-12-22 15:16:04 +08:00
parent 14e92fd53f
commit 19b7e53c96
4 changed files with 4 additions and 4 deletions

View File

@ -249,7 +249,7 @@ export class ERC1155Standard {
.safeBatchTransferFrom(from, to, tokenIds, amounts)
.estimateGas({ gas: 1000000 });
}
gas = gas * 1.1;
gas = (gas * 1.1) | 1;
if (estimate) {
return jc.wallet.generateGasShow(gas);
}

View File

@ -162,7 +162,7 @@ export class ERC20Standard {
.transfer(to, amountBN)
.estimateGas({ gas: 1000000 });
}
gas = gas * 1.1;
gas = (gas * 1.1) | 1;
if (estimate) {
return jc.wallet.generateGasShow(gas);
}

View File

@ -307,7 +307,7 @@ export class ERC721Standard {
.safeTransferFrom(from, to, tokenId)
.estimateGas({ gas: 1000000 });
}
gas = gas * 1.1;
gas = (gas * 1.1) | 1;
if (estimate) {
return jc.wallet.generateGasShow(gas);
}

View File

@ -169,7 +169,7 @@ export class JCStandard {
}
return contract.methods
.evolve721NFT(nftAddress, tokenIds, startTime, nonce, signature)
.send({ gas: (gas * 1.1) | 0 });
.send({ gas });
}
async evolveChip({