{"action":"created","comment":{"url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/comments/215826522","pull_request_review_id":153180771,"id":215826522,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTgyNjUyMg==","diff_hunk":"@@ -0,0 +1,221 @@\n+---\n+id: learn-about-crowdsales\n+title: Learn About Crowdsales\n+---\n+\n+Crowdsales are a popular use for Ethereum; they let you allocate tokens to network participants in various ways, mostly in exchange for Ether. They come in a variety of shapes and flavors, so let's go over the various types available in OpenZeppelin and how to use them.\n+\n+Crowdsales have a bunch of different propertie, but here are some important ones:\n+- Price & Rate Configuration\n+  - Does your crowdsale sell tokens at a fixed price?\n+  - Does the price change over time or as a function of demand?\n+- Emission\n+  - How is this token actually send to participants?\n+- Validation — Who is allowed to purchase tokens?\n+  - Are there KYC / AML checks?\n+  - Is there a max cap on tokens?\n+  - What if that cap is per-participant?\n+  - Is there a starting and ending time frame?\n+- Distribution\n+  - Does distribution of funds happen in real-time or after the crowdsale?\n+  - Can participants receive a refund if the goal is not met?\n+\n+To manage all of the different combinations and flavors of crowdsales, OpenZeppelin provides a highly configurable [`Crowdsale.sol`](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol) base contract that can be combined with various other functionality to construct a bespoke crowdsale.\n+\n+## Crowdsale Rate\n+\n+Understanding the rate of a crowdsale is super important, and mistakes here are a common source of bugs.\n+\n+✨ **HOLD UP FAM THIS IS IMPORTANT** ✨\n+\n+Firstly, **all currency math is done in the smallest unit of that currency and converted to the correct decimal places when _displaying_ the currency**.\n+\n+This means that when you do math in your smart contracts, you need to understand that you're adding, dividing, and multiplying the smallest amount of a currency (like wei), _not_ the commonly-used displayed value of the currency (Ether).\n+\n+In Ether, the smallest unit of the currency is wei, and `1 ETH === 10^18 wei`. In tokens, the process is _very similar_: `1 TKN === 10^(decimals) TKNbits`.\n+\n+- The smallest unit of a token is \"bits\" or `TKNbits`.\n+- The display value of a token is `TKN`, which is `TKNbits * 10^(decimals)`\n+\n+What people usually call \"one token\" is actually a bunch of TKNbits, displayed to look like `1 TKN`. This is the same relationship that Ether and wei have. And what you're _always_ doing calculations in is **TKNbits**.","path":"docs/docs/learn-about-crowdsales.md","position":40,"original_position":40,"commit_id":"1a433e6f76e2f9640c1d5958449db95bf130639a","original_commit_id":"1a433e6f76e2f9640c1d5958449db95bf130639a","user":{"login":"elopio","id":617831,"node_id":"MDQ6VXNlcjYxNzgzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/617831?v=4","gravatar_id":"","url":"https://api.github.com/users/elopio","html_url":"https://github.com/elopio","followers_url":"https://api.github.com/users/elopio/followers","following_url":"https://api.github.com/users/elopio/following{/other_user}","gists_url":"https://api.github.com/users/elopio/gists{/gist_id}","starred_url":"https://api.github.com/users/elopio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elopio/subscriptions","organizations_url":"https://api.github.com/users/elopio/orgs","repos_url":"https://api.github.com/users/elopio/repos","events_url":"https://api.github.com/users/elopio/events{/privacy}","received_events_url":"https://api.github.com/users/elopio/received_events","type":"User","site_admin":false},"body":"**TKNbits and wei**","created_at":"2018-09-07T01:57:21Z","updated_at":"2018-09-07T01:57:21Z","html_url":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6#discussion_r215826522","pull_request_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/comments/215826522"},"html":{"href":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6#discussion_r215826522"},"pull_request":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6","id":213754147,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNzU0MTQ3","html_url":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6","diff_url":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6.diff","patch_url":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6.patch","issue_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/6","number":6,"state":"open","locked":false,"title":"Feat/learn about","user":{"login":"shrugs","id":1535001,"node_id":"MDQ6VXNlcjE1MzUwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1535001?v=4","gravatar_id":"","url":"https://api.github.com/users/shrugs","html_url":"https://github.com/shrugs","followers_url":"https://api.github.com/users/shrugs/followers","following_url":"https://api.github.com/users/shrugs/following{/other_user}","gists_url":"https://api.github.com/users/shrugs/gists{/gist_id}","starred_url":"https://api.github.com/users/shrugs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrugs/subscriptions","organizations_url":"https://api.github.com/users/shrugs/orgs","repos_url":"https://api.github.com/users/shrugs/repos","events_url":"https://api.github.com/users/shrugs/events{/privacy}","received_events_url":"https://api.github.com/users/shrugs/received_events","type":"User","site_admin":false},"body":"docsss","created_at":"2018-09-06T21:21:26Z","updated_at":"2018-09-07T01:57:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3a7e5d9613095788f3a8078025bbc4c3c81965a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6/commits","review_comments_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6/comments","review_comment_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/6/comments","statuses_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/statuses/1a433e6f76e2f9640c1d5958449db95bf130639a","head":{"label":"shrugs:feat/learn-about","ref":"feat/learn-about","sha":"1a433e6f76e2f9640c1d5958449db95bf130639a","user":{"login":"shrugs","id":1535001,"node_id":"MDQ6VXNlcjE1MzUwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1535001?v=4","gravatar_id":"","url":"https://api.github.com/users/shrugs","html_url":"https://github.com/shrugs","followers_url":"https://api.github.com/users/shrugs/followers","following_url":"https://api.github.com/users/shrugs/following{/other_user}","gists_url":"https://api.github.com/users/shrugs/gists{/gist_id}","starred_url":"https://api.github.com/users/shrugs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrugs/subscriptions","organizations_url":"https://api.github.com/users/shrugs/orgs","repos_url":"https://api.github.com/users/shrugs/repos","events_url":"https://api.github.com/users/shrugs/events{/privacy}","received_events_url":"https://api.github.com/users/shrugs/received_events","type":"User","site_admin":false},"repo":{"id":146520210,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY1MjAyMTA=","name":"openzeppelin-docs","full_name":"shrugs/openzeppelin-docs","owner":{"login":"shrugs","id":1535001,"node_id":"MDQ6VXNlcjE1MzUwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1535001?v=4","gravatar_id":"","url":"https://api.github.com/users/shrugs","html_url":"https://github.com/shrugs","followers_url":"https://api.github.com/users/shrugs/followers","following_url":"https://api.github.com/users/shrugs/following{/other_user}","gists_url":"https://api.github.com/users/shrugs/gists{/gist_id}","starred_url":"https://api.github.com/users/shrugs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrugs/subscriptions","organizations_url":"https://api.github.com/users/shrugs/orgs","repos_url":"https://api.github.com/users/shrugs/repos","events_url":"https://api.github.com/users/shrugs/events{/privacy}","received_events_url":"https://api.github.com/users/shrugs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shrugs/openzeppelin-docs","description":"API docs for zeppelin-solidity","fork":true,"url":"https://api.github.com/repos/shrugs/openzeppelin-docs","forks_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/forks","keys_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/teams","hooks_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/hooks","issue_events_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/issues/events{/number}","events_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/events","assignees_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/assignees{/user}","branches_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/branches{/branch}","tags_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/tags","blobs_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/languages","stargazers_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/stargazers","contributors_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/contributors","subscribers_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/subscribers","subscription_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/subscription","commits_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/contents/{+path}","compare_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/merges","archive_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/downloads","issues_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/issues{/number}","pulls_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/labels{/name}","releases_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/releases{/id}","deployments_url":"https://api.github.com/repos/shrugs/openzeppelin-docs/deployments","created_at":"2018-08-28T23:57:25Z","updated_at":"2018-08-28T23:57:27Z","pushed_at":"2018-09-06T21:21:14Z","git_url":"git://github.com/shrugs/openzeppelin-docs.git","ssh_url":"git@github.com:shrugs/openzeppelin-docs.git","clone_url":"https://github.com/shrugs/openzeppelin-docs.git","svn_url":"https://github.com/shrugs/openzeppelin-docs","homepage":null,"size":374,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenZeppelin:master","ref":"master","sha":"22acda3b340a62c87727c07e914f50c6eeae43d8","user":{"login":"OpenZeppelin","id":20820676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODIwNjc2","avatar_url":"https://avatars3.githubusercontent.com/u/20820676?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenZeppelin","html_url":"https://github.com/OpenZeppelin","followers_url":"https://api.github.com/users/OpenZeppelin/followers","following_url":"https://api.github.com/users/OpenZeppelin/following{/other_user}","gists_url":"https://api.github.com/users/OpenZeppelin/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenZeppelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenZeppelin/subscriptions","organizations_url":"https://api.github.com/users/OpenZeppelin/orgs","repos_url":"https://api.github.com/users/OpenZeppelin/repos","events_url":"https://api.github.com/users/OpenZeppelin/events{/privacy}","received_events_url":"https://api.github.com/users/OpenZeppelin/received_events","type":"Organization","site_admin":false},"repo":{"id":128816453,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MTY0NTM=","name":"openzeppelin-docs","full_name":"OpenZeppelin/openzeppelin-docs","owner":{"login":"OpenZeppelin","id":20820676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODIwNjc2","avatar_url":"https://avatars3.githubusercontent.com/u/20820676?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenZeppelin","html_url":"https://github.com/OpenZeppelin","followers_url":"https://api.github.com/users/OpenZeppelin/followers","following_url":"https://api.github.com/users/OpenZeppelin/following{/other_user}","gists_url":"https://api.github.com/users/OpenZeppelin/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenZeppelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenZeppelin/subscriptions","organizations_url":"https://api.github.com/users/OpenZeppelin/orgs","repos_url":"https://api.github.com/users/OpenZeppelin/repos","events_url":"https://api.github.com/users/OpenZeppelin/events{/privacy}","received_events_url":"https://api.github.com/users/OpenZeppelin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenZeppelin/openzeppelin-docs","description":"API docs for zeppelin-solidity","fork":false,"url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs","forks_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/forks","keys_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/teams","hooks_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/hooks","issue_events_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/events{/number}","events_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/events","assignees_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/assignees{/user}","branches_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/branches{/branch}","tags_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/tags","blobs_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/languages","stargazers_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/stargazers","contributors_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/contributors","subscribers_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/subscribers","subscription_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/subscription","commits_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/contents/{+path}","compare_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/merges","archive_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/downloads","issues_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues{/number}","pulls_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/labels{/name}","releases_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/releases{/id}","deployments_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/deployments","created_at":"2018-04-09T18:28:04Z","updated_at":"2018-08-28T16:25:08Z","pushed_at":"2018-09-06T21:21:27Z","git_url":"git://github.com/OpenZeppelin/openzeppelin-docs.git","ssh_url":"git@github.com:OpenZeppelin/openzeppelin-docs.git","clone_url":"https://github.com/OpenZeppelin/openzeppelin-docs.git","svn_url":"https://github.com/OpenZeppelin/openzeppelin-docs","homepage":null,"size":358,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":13,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6"},"html":{"href":"https://github.com/OpenZeppelin/openzeppelin-docs/pull/6"},"issue":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/6"},"comments":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/OpenZeppelin/openzeppelin-docs/statuses/1a433e6f76e2f9640c1d5958449db95bf130639a"}},"author_association":"NONE"}}
{"actor":{"display_login":"elopio"}}