Skip to content

Commit

Permalink
Add example how to whitelist participants. Add spelling error TODO in…
Browse files Browse the repository at this point in the history
… ABI.
  • Loading branch information
miohtama committed May 16, 2017
1 parent 4f421ac commit bd8a905
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/Crowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ contract Crowdsale is Haltable {
/**
* Allow addresses to do early participation.
*
* TODO: Fix spelling error in the name
*/
function setEarlyParicipantWhitelist(address addr, bool status) onlyOwner {
earlyParticipantWhitelist[addr] = status;
Expand Down
29 changes: 29 additions & 0 deletions docs/source/interact.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,32 @@ Example triggering the funds transfer to ICO:
print("TXID is", txid)
check_succesful_tx(web3, txid)
print("OK")
Whitelisting crowdsale participants
===================================

Here is an example how to whitelist ICO participants before the ICO beings:

.. code-block:: python
from ico.utils import check_succesful_tx
import populus
from populus.utils.cli import request_account_unlock
from populus.utils.accounts import is_account_locked
p = populus.Project()
account = "0x001FC7d7E506866aEAB82C11dA515E9DD6D02c25" # Our controller account on Kovan
with p.get_chain("kovan") as chain:
web3 = chain.web3
Contract = getattr(chain.contract_factories, "Crowdsale")
contract = Contract(address="0x06829437859594e19276f87df601436ef55af4f2")
if is_account_locked(web3, account):
request_account_unlock(chain, account, None)
txid = contract.transact({"from": account}).setEarlyParicipantWhitelist("0x65cbd9a48c366f66958196b0a2af81fc73987ba3", True)
print("TXID is", txid)
check_succesful_tx(web3, txid)
print("OK")

0 comments on commit bd8a905

Please sign in to comment.