Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/contracts/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,16 @@ const _encodeAddTransactionData = ({
args: addTransactionArgs,
});

// `_validUntil = 0` is treated as "expired" by the on-chain consensus
// contract, so every submission with a v6 signature would revert. Use
// `now + 1 hour` — enough buffer for wallet confirmation + mining, short
// enough that stale signed txs don't hang around forever.
const validUntil = BigInt(Math.floor(Date.now() / 1000) + 3600);

const encodedDataV6 = encodeFunctionData({
abi: ADD_TRANSACTION_ABI_V6 as any,
functionName: "addTransaction",
args: [...addTransactionArgs, 0n],
args: [...addTransactionArgs, validUntil],
});

if (getAddTransactionInputCount(client.chain.consensusMainContract?.abi) >= 6) {
Expand Down
Loading