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

Adding code example for smart signatures to check genesis hash. #1218

Merged
merged 1 commit into from
Jan 12, 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
11 changes: 11 additions & 0 deletions docs/get-details/dapps/smart-contracts/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ These guidelines are specific to smart signatures. They complement the other gui
* Be careful about the fact that the same smart signature can be used in multiple networks.
* For instance, if a smart signature is signed with the intent of using it on TestNet, that same transaction can be sent to MainNet with that same smart signature.
* Always use new accounts when using TestNet (or any other network) to avoid reusing the same account that signed a smart signature.
* Make sure to write a smart signature that checks which network it is being run on. You can use:

=== "PyTeal"
```py
Global.genesis_hash()
```

=== "TEAL"
```teal
global GenesisHash
```

## Additional resources

Expand Down
Loading