Skip to content
Open
Show file tree
Hide file tree
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
130 changes: 130 additions & 0 deletions client/public/imgs/BigLevel34.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions client/public/imgs/Level34.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions client/src/gamedata/ar/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
يطبق عقد TimeVault أدناه تخزيناً آمناً مع آلية قفل زمني. تم تصميم الخزنة لتبقى مقفلة لفترة زمنية محددة (ساعة واحدة) قبل أن يتمكن أي شخص من الوصول إلى محتوياتها.

تحتوي الخزنة على قيمة سرية يجب تعيينها إلى رقم محدد لإكمال هذا المستوى.

هدفك هو تجاوز القفل الزمني وتعيين القيمة السرية إلى 42.

الوقت وهم في عالم البلوك تشين. هل يمكنك التلاعب به لصالحك؟
13 changes: 13 additions & 0 deletions client/src/gamedata/ar/descriptions/levels/timevault_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
يوضح هذا المستوى ثغرة استخدام `block.timestamp` للتحكم في الوصول المبني على الوقت في العقود الذكية.

يتضمن الحل فهم أن المعدنين لديهم بعض السيطرة على طوابع الوقت للكتل. بينما لا يمكنهم تعيين طوابع وقت عشوائية، يمكنهم التلاعب بها ضمن حدود معينة (عادة ±15 ثانية من الوقت الفعلي).

في بيئات الاختبار مثل Foundry أو Hardhat، يمكنك استخدام دوال التلاعب بالوقت (`vm.warp()` أو `evm_increaseTime()`) لتسريع الوقت وتجاوز القفل الزمني فوراً.

للحصول على تطبيقات آمنة للقفل الزمني، فكر في:
- استخدام أرقام الكتل بدلاً من الطوابع الزمنية للحصول على توقيت أكثر قابلية للتنبؤ
- تطبيق ضوابط وصول إضافية تتجاوز القيود المبنية على الوقت
- استخدام أنماط القفل الزمني المعتمدة مثل TimelockController من OpenZeppelin
- إدراك أن جميع البيانات على السلسلة عامة، بما في ذلك المتغيرات "الخاصة"

راجع [أفضل ممارسات العقود الذكية من Consensys](https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/timestamp-dependence/) لمزيد من المعلومات حول ثغرات الاعتماد على الطوابع الزمنية.
9 changes: 9 additions & 0 deletions client/src/gamedata/authors.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@
"www.x.com/carlitox477", "https://github.com/GianfrancoBazzani/"
],
"emails": ["[email protected]", "[email protected]"]
},
"Waiting-Chai": {
"name": [
"Waiting-Chai"
],
"websites": [
"https://github.com/Waiting-Chai"
],
"emails": []
}
}
}
7 changes: 7 additions & 0 deletions client/src/gamedata/en/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The TimeVault contract below implements a secure storage with a time lock mechanism. The vault is designed to remain locked for a specific time period (1 hour) before anyone can access its contents.

The vault contains a secret value that must be set to a specific number to complete this level.

Your goal is to bypass the time lock and set the secret value to 42.

Time is an illusion in the blockchain world. Can you manipulate it to your advantage?
13 changes: 13 additions & 0 deletions client/src/gamedata/en/descriptions/levels/timevault_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This level demonstrates the vulnerability of using `block.timestamp` for time-based access controls in smart contracts.

The solution involves understanding that miners have some control over block timestamps. While they cannot set arbitrary timestamps, they can manipulate them within certain bounds (typically ±15 seconds from the actual time).

In testing environments like Foundry or Hardhat, you can use time manipulation functions (`vm.warp()` or `evm_increaseTime()`) to fast-forward time and bypass the timelock immediately.

For secure timelock implementations, consider:
- Using block numbers instead of timestamps for more predictable timing
- Implementing additional access controls beyond time-based restrictions
- Using established timelock patterns like OpenZeppelin's TimelockController
- Being aware that all on-chain data is public, including "private" variables

See [Consensys Smart Contract Best Practices](https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/timestamp-dependence/) for more information about timestamp dependence vulnerabilities.
7 changes: 7 additions & 0 deletions client/src/gamedata/es/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
El contrato TimeVault a continuación implementa un almacenamiento seguro con un mecanismo de bloqueo temporal. La bóveda está diseñada para permanecer bloqueada durante un período de tiempo específico (1 hora) antes de que cualquiera pueda acceder a su contenido.

La bóveda contiene un valor secreto que debe establecerse en un número específico para completar este nivel.

Tu objetivo es eludir el bloqueo temporal y establecer el valor secreto en 42.

El tiempo es una ilusión en el mundo blockchain. ¿Puedes manipularlo a tu favor?
13 changes: 13 additions & 0 deletions client/src/gamedata/es/descriptions/levels/timevault_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Este nivel demuestra la vulnerabilidad de usar `block.timestamp` para controles de acceso basados en tiempo en contratos inteligentes.

La solución implica entender que los mineros tienen cierto control sobre las marcas de tiempo de los bloques. Aunque no pueden establecer marcas de tiempo arbitrarias, pueden manipularlas dentro de ciertos límites (típicamente ±15 segundos del tiempo real).

En entornos de prueba como Foundry o Hardhat, puedes usar funciones de manipulación de tiempo (`vm.warp()` o `evm_increaseTime()`) para acelerar el tiempo y eludir el bloqueo temporal inmediatamente.

Para implementaciones seguras de bloqueo temporal, considera:
- Usar números de bloque en lugar de marcas de tiempo para un tiempo más predecible
- Implementar controles de acceso adicionales más allá de las restricciones basadas en tiempo
- Usar patrones de bloqueo temporal establecidos como TimelockController de OpenZeppelin
- Ser consciente de que todos los datos en cadena son públicos, incluyendo variables "privadas"

Consulta [Mejores Prácticas de Contratos Inteligentes de Consensys](https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/timestamp-dependence/) para más información sobre vulnerabilidades de dependencia de marcas de tiempo.
7 changes: 7 additions & 0 deletions client/src/gamedata/fr/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Le contrat TimeVault ci-dessous implémente un stockage sécurisé avec un mécanisme de verrouillage temporel. Le coffre-fort est conçu pour rester verrouillé pendant une période de temps spécifique (1 heure) avant que quiconque puisse accéder à son contenu.

Le coffre-fort contient une valeur secrète qui doit être définie sur un nombre spécifique pour compléter ce niveau.

Votre objectif est de contourner le verrouillage temporel et de définir la valeur secrète à 42.

Le temps est une illusion dans le monde de la blockchain. Pouvez-vous le manipuler à votre avantage ?
13 changes: 13 additions & 0 deletions client/src/gamedata/fr/descriptions/levels/timevault_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Ce niveau démontre la vulnérabilité de l'utilisation de `block.timestamp` pour les contrôles d'accès basés sur le temps dans les contrats intelligents.

La solution implique de comprendre que les mineurs ont un certain contrôle sur les horodatages des blocs. Bien qu'ils ne puissent pas définir des horodatages arbitraires, ils peuvent les manipuler dans certaines limites (généralement ±15 secondes par rapport au temps réel).

Dans les environnements de test comme Foundry ou Hardhat, vous pouvez utiliser des fonctions de manipulation du temps (`vm.warp()` ou `evm_increaseTime()`) pour accélérer le temps et contourner le verrouillage temporel immédiatement.

Pour des implémentations sécurisées de verrouillage temporel, considérez :
- Utiliser les numéros de blocs au lieu des horodatages pour un timing plus prévisible
- Implémenter des contrôles d'accès supplémentaires au-delà des restrictions basées sur le temps
- Utiliser des modèles de verrouillage temporel établis comme TimelockController d'OpenZeppelin
- Être conscient que toutes les données on-chain sont publiques, y compris les variables "privées"

Consultez [Meilleures Pratiques des Contrats Intelligents de Consensys](https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/timestamp-dependence/) pour plus d'informations sur les vulnérabilités de dépendance aux horodatages.
15 changes: 15 additions & 0 deletions client/src/gamedata/gamedata.json
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,21 @@
"deployId": "33",
"instanceGas": 750000,
"author": "Gianfranco&carlitox477"
},
{
"name": "TimeVault",
"created": "2025-08-18",
"difficulty": "5",
"description": "timevault.md",
"completedDescription": "timevault_complete.md",
"levelContract": "TimeVaultFactory.sol",
"instanceContract": "TimeVault.sol",
"revealCode": true,
"deployParams": [],
"deployFunds": 0,
"deployId": "34",
"instanceGas": 500000,
"author": "Waiting-Chai"
}
]
}
7 changes: 7 additions & 0 deletions client/src/gamedata/ja/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
以下のTimeVaultコントラクトは、タイムロックメカニズムを備えた安全なストレージを実装しています。このボールトは、誰でもその内容にアクセスできるようになる前に、特定の時間(1時間)ロックされたままになるように設計されています。

ボールトには秘密の値が含まれており、このレベルを完了するには特定の数値に設定する必要があります。

あなたの目標は、タイムロックをバイパスして秘密の値を42に設定することです。

ブロックチェーンの世界では、時間は幻想です。あなたはそれを有利に操作できますか?
13 changes: 13 additions & 0 deletions client/src/gamedata/ja/descriptions/levels/timevault_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
このレベルは、スマートコントラクトにおける時間ベースのアクセス制御に`block.timestamp`を使用することの脆弱性を実証しています。

解決策は、マイナーがブロックのタイムスタンプに対してある程度の制御権を持っていることを理解することです。任意のタイムスタンプを設定することはできませんが、一定の範囲内(通常は実際の時間から±15秒)で操作することができます。

FoundryやHardhatなどのテスト環境では、時間操作関数(`vm.warp()`または`evm_increaseTime()`)を使用して時間を早送りし、タイムロックを即座にバイパスできます。

安全なタイムロック実装については、以下を検討してください:
- より予測可能なタイミングのために、タイムスタンプの代わりにブロック番号を使用する
- 時間ベースの制限を超えた追加のアクセス制御を実装する
- OpenZeppelinのTimelockControllerなどの確立されたタイムロックパターンを使用する
- 「プライベート」変数を含むすべてのオンチェーンデータが公開されていることを認識する

タイムスタンプ依存の脆弱性について詳しくは、[Consensysスマートコントラクトベストプラクティス](https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/timestamp-dependence/)を参照してください。
7 changes: 7 additions & 0 deletions client/src/gamedata/pt_br/descriptions/levels/timevault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
O contrato TimeVault abaixo implementa um armazenamento seguro com um mecanismo de bloqueio temporal. O cofre foi projetado para permanecer bloqueado por um período específico de tempo (1 hora) antes que qualquer pessoa possa acessar seu conteúdo.

O cofre contém um valor secreto que deve ser definido para um número específico para completar este nível.

Seu objetivo é contornar o bloqueio temporal e definir o valor secreto para 42.

O tempo é uma ilusão no mundo blockchain. Você pode manipulá-lo a seu favor?
Loading