-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update PRG interface and implementation #6
Changes from 7 commits
1a2ff37
ef58175
6347a40
411763d
47d84a3
dd7b295
e4fcf22
17a1416
30bbdc4
19c1190
f1d006f
3645694
90ca8fe
8e7f756
d1dd0fc
7e44dda
9e5e9c4
ce51fcd
d980bae
8a392d0
e05641a
850cca7
d9eecda
6e963b3
5f5ea13
c439f1c
1f72ce7
cbf5d3e
e9157d5
61cc807
ccf6d0e
2f578d6
256c1b2
bf00c4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see | ||
https://www.contributor-covenant.org/faq |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Contributing to the Non-Fungible Token Standard | ||
|
||
The following is a set of guidelines for contributing to the Flow NFT standard. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be changed to say ramdom coin toss implementation instead of NFT standard? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha you're right! Good catch |
||
|
||
#### Table Of Contents | ||
|
||
[How Can I Contribute?](#how-can-i-contribute) | ||
|
||
- [Reporting Bugs](#reporting-bugs) | ||
- [Suggesting Enhancements](#suggesting-enhancements) | ||
- [Pull Requests](#pull-requests) | ||
|
||
[Styleguides](#styleguides) | ||
|
||
- [Git Commit Messages](#git-commit-messages) | ||
|
||
[Additional Notes](#additional-notes) | ||
|
||
|
||
## How Can I Contribute? | ||
|
||
You are free to contribute however you want! You can submit a bug report in an issue, suggest an enhancment, or even just make a PR for us to review. We just ask that you are clear in your communication and documentation of all your work so we can understand how you are trying to help. | ||
|
||
### Reporting Bugs | ||
|
||
#### Before Submitting A Bug Report | ||
|
||
- **Search existing issues** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. | ||
|
||
#### How Do I Submit A (Good) Bug Report? | ||
|
||
Explain the problem and include additional details to help maintainers reproduce the problem: | ||
|
||
- **Use a clear and descriptive title** for the issue to identify the problem. | ||
- **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**. | ||
- **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). | ||
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. | ||
- **Explain which behavior you expected to see instead and why.** | ||
- **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. | ||
|
||
Provide more context by answering these questions: | ||
|
||
- **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. | ||
|
||
Include details about your configuration and environment: | ||
|
||
- **What's the name and version of the OS you're using**? | ||
- **What's the name and version of the flow-cli that you are using**? | ||
|
||
### Suggesting Enhancements | ||
|
||
#### Before Submitting An Enhancement Suggestion | ||
|
||
- **Perform a cursory search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. | ||
|
||
#### How Do I Submit A (Good) Enhancement Suggestion? | ||
|
||
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information: | ||
|
||
- **Use a clear and descriptive title** for the issue to identify the suggestion. | ||
- **Provide a step-by-step description of the suggested enhancement** in as many details as possible. | ||
- **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). | ||
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. | ||
- **Include screenshots and animated GIFs**. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. | ||
- **Explain why this enhancement would be useful** to be included in the standard. | ||
|
||
### Pull Requests | ||
|
||
The process described here has several goals: | ||
|
||
- Maintain code quality | ||
- Fix problems that are important to users | ||
|
||
Please follow the [styleguides](#styleguides) to have your contribution considered by the maintainers. | ||
Reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. | ||
|
||
## Styleguides | ||
|
||
Before contributing, make sure to examine the project to get familiar with the patterns and style already being used. | ||
|
||
### Git Commit Messages | ||
|
||
- Use the present tense ("Add feature" not "Added feature") | ||
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...") | ||
- Limit the first line to 72 characters or less | ||
- Reference issues and pull requests liberally after the first line | ||
|
||
|
||
### Additional Notes | ||
|
||
Thank you for your interest in contributing to the Flow Token Standards! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <https://unlicense.org> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# [WIP] Random Coin Toss | ||
|
||
> :warning: This repo is still a work in progress - the underlying RandomBeaconHistory is also still a work in progress | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, the contract is finalized. I'll update this section |
||
|
||
## Overview | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clear and easy-to-read doc 👌🏼 |
||
|
||
The contracts contained in this repo demonstrate how to use Flow's onchain randomness safely - safe randomness here | ||
meaning non-revertible randomness. | ||
|
||
Random sources are committed to the [`RandomBeaconHistory` contract](./contracts/RandomBeaconHistory.cdc) by the service | ||
account at the end of every block. These random sources are catalogued chronologically, extending historically for every | ||
associated block height to the initial commitment height. | ||
|
||
Used on their own, these random sources are not safe. In other words, using the random source in your contract without | ||
the framing of a commit-reveal mechanism would enable callers to condition their interactions with your contract on the | ||
sisyphusSmiling marked this conversation as resolved.
Show resolved
Hide resolved
|
||
random result. In the context of a random coin toss, I could revert my transaction if I didn't win - not a very fair | ||
game. | ||
|
||
To achieve non-revertible randomness, the contract should be structured to resolve in two phases: | ||
|
||
1. Commit - Caller commits to the resolution of their bet with some yet unknown source of randomness (i.e. in the | ||
future) | ||
2. Reveal - Caller can then reveal the result of their bet | ||
|
||
Though a caller could still condition the revealing transaction on the coin flip result, they've already incurred the | ||
cost of their bet and would gain nothing by doing so. | ||
|
||
## References | ||
|
||
- [Secure Random Number Generator Forum Post](https://forum.onflow.org/t/secure-random-number-generator-for-flow-s-smart-contracts/5110) | ||
- [RandomBeaconHistory PR - flow-core-contracts](https://github.com/onflow/flow-core-contracts/pull/375) | ||
- [FLIP: On-Chain randomness history for commit-reveal schemes](https://github.com/onflow/flips/pull/123) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Responsible Disclosure Policy | ||
|
||
Flow was built from the ground up with security in mind. Our code, infrastructure, and development methodology helps us keep our users safe. | ||
|
||
We really appreciate the community's help. Responsible disclosure of vulnerabilities helps to maintain the security and privacy of everyone. | ||
|
||
If you care about making a difference, please follow the guidelines below. | ||
|
||
# **Guidelines For Responsible Disclosure** | ||
|
||
We ask that all researchers adhere to these guidelines [here](https://docs.onflow.org/bounties/responsible-disclosure/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if there is a Flow team address available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This was taken from an existing open source template, so I'm not sure if we have a dedicated flow team email address for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked around but didn't get an answer so far