# 时间戳操纵 > 时间戳操纵 **Published by:** [web3zoom](https://paragraph.com/@web3zoom/) **Published on:** 2026-01-06 **URL:** https://paragraph.com/@web3zoom/delegatecall ## Content 漏洞合约: 游戏合约,每个区块有一个合约玩家,若time.timestamp 为13的倍数,则拿走所有的奖金。// SPDX-License-Identifier: MIT pragma solidity ^0.8.30; contract TimeGame { uint public lastBlockTime; constructor() payable {} function play() external payable { require(msg.value >= 1 ether); require(block.timestamp != lastBlockTime); lastBlockTime = block.timestamp; if(block.timestamp % 13 == 0){ payable (msg.sender).transfer(address(this).balance); } } receive() external payable { } } 攻击原理: 当合约汇集大量资金,矿工有足够的时间操作时间戳,可以根据需要进行修改,向13的倍数进行调整,block.timestamp , 同时调用play方法完成攻击目标。 防范: 1、尽量不使用时间戳,可以使用Oracle获取相关信息 2、如果使用时间戳,就使用平均时间戳 ## Publication Information - [web3zoom](https://paragraph.com/@web3zoom/): Publication homepage - [All Posts](https://paragraph.com/@web3zoom/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@web3zoom): Subscribe to updates - [Twitter](https://twitter.com/primer2011): Follow on Twitter