Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove security footgun example in onchain values docs #793

Merged
merged 1 commit into from
Jan 24, 2024
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
7 changes: 0 additions & 7 deletions docs/zkapps/o1js/on-chain-values.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ class VotingApp extends SmartContract {

A more refined example could store the current start date in an on-chain state variable, which can then be reset by some process that is also encoded by the zkApp.

In addition to using a predefined range, you can also construct a range that depends on another variable, such as the current time. For example, a DEX with an order book could support orders that expire after an hour. In this case, the range would be `[now, now + 1h]`:
barriebyron marked this conversation as resolved.
Show resolved Hide resolved

```ts
const now = this.network.timestamp.get();
this.network.timestamp.requireBetween(now, now.add(60 * 60 * 1000));
```

### Network reference

For completeness, here is the full list of network states you can use and make assertions about in your zkApp.
Expand Down
Loading