Skip to content

In docs/01-create-pool.mdx, there is no need to add 60 to block.timestamp for the deadline. #978

@ZeroTrust01

Description

@ZeroTrust01

https://docs.uniswap.org/contracts/v4/quickstart/create-pool#7-encode-the-modifyliquidites-call
7. Encode the modifyLiquidites call

uint256 deadline = block.timestamp + 60;
params[1] = abi.encodeWithSelector(
    posm.modifyLiquidities.selector, abi.encode(actions, mintParams), deadline
);

In the EVM, block.timestamp represents the block time (i.e., the timestamp when the current block is mined), not the local system time.
Therefore, using block.timestamp in a transaction (tx) implies that the deadline for this tx is effectively "forever," making block.timestamp + 60 entirely equivalent to block.timestamp alone.
If you want to enforce a time constraint on a pending tx, you should ​not​ rely on block.timestamp. Instead, use the user's local system time plus a fixed duration (e.g., 60 seconds).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions