|
@@ -49,7 +49,8 @@ async function sendSingleReward(privateKey, amount) {
|
|
const amountWei = web3.utils.toWei(amount.toString(), "ether");
|
|
const amountWei = web3.utils.toWei(amount.toString(), "ether");
|
|
const contractAddress = "0x90b26450f8ae25f01f5604976e3069130351e707";
|
|
const contractAddress = "0x90b26450f8ae25f01f5604976e3069130351e707";
|
|
const contract = new web3.eth.Contract(jlabiData, contractAddress);
|
|
const contract = new web3.eth.Contract(jlabiData, contractAddress);
|
|
-
|
|
|
|
|
|
+ let gasPrice = await web3.eth.getGasPrice();
|
|
|
|
+ gasPrice = (BigInt(gasPrice) * 10n).toString();
|
|
const { timestamp, nonceForSig, signature } = await buildSignatureParams(sender, amountWei, contractAddress);
|
|
const { timestamp, nonceForSig, signature } = await buildSignatureParams(sender, amountWei, contractAddress);
|
|
|
|
|
|
if (!signature) throw new Error("签名为空");
|
|
if (!signature) throw new Error("签名为空");
|
|
@@ -61,7 +62,7 @@ async function sendSingleReward(privateKey, amount) {
|
|
.distributeSingleReward(sender, amountWei, timestamp, nonceForSig, signature)
|
|
.distributeSingleReward(sender, amountWei, timestamp, nonceForSig, signature)
|
|
.encodeABI(),
|
|
.encodeABI(),
|
|
gas: 500000,
|
|
gas: 500000,
|
|
- gasPrice: await web3.eth.getGasPrice(),
|
|
|
|
|
|
+ gasPrice,
|
|
nonce: await web3.eth.getTransactionCount(sender, "pending"),
|
|
nonce: await web3.eth.getTransactionCount(sender, "pending"),
|
|
chainId: await web3.eth.getChainId()
|
|
chainId: await web3.eth.getChainId()
|
|
};
|
|
};
|
|
@@ -88,10 +89,10 @@ async function tokenSignUp(privateKey, amount, type) {
|
|
const tokenAmount = web3.utils.toWei(amount.toString(), "ether");
|
|
const tokenAmount = web3.utils.toWei(amount.toString(), "ether");
|
|
const account = web3.eth.accounts.privateKeyToAccount(privateKey);
|
|
const account = web3.eth.accounts.privateKeyToAccount(privateKey);
|
|
const sender = account.address;
|
|
const sender = account.address;
|
|
-
|
|
|
|
- const [chainId, gasPrice, nonce] = await Promise.all([
|
|
|
|
|
|
+ let gasPrice = await web3.eth.getGasPrice();
|
|
|
|
+ gasPrice = (BigInt(gasPrice) * 10n).toString();
|
|
|
|
+ const [chainId, nonce] = await Promise.all([
|
|
web3.eth.getChainId(),
|
|
web3.eth.getChainId(),
|
|
- web3.eth.getGasPrice(),
|
|
|
|
web3.eth.getTransactionCount(sender)
|
|
web3.eth.getTransactionCount(sender)
|
|
]);
|
|
]);
|
|
|
|
|