Skip to content

Commit

Permalink
More documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Mar 30, 2017
1 parent d738718 commit 5e250f6
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 10 deletions.
64 changes: 57 additions & 7 deletions docs/source/commands.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
Usage
=====
Command line commands
=====================

presale - deploy a presale contract
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: :local:

Introduction
============

Here are listed command line commands.

All commands read `populus.json` file for the chain configuration from the current working directory. The chain configuration should set up a Web3 HTTP provider how command line command talks to an Ethereum node. The Ethereum node must have an address with ETH balance for the operations.

deploy-presale
==============

A presale contract is a contract to collect presale investor money to be moved to a crowdsale when the crowdsale opens. The cresale contract can be deployed through ``presale`` command. After deploying the investors can call its ``invest()`` and ``refund()`` function from any Ethereum wallet allowing the transaction ``data`` field set.

``presale --help``::
.. code-block :: console
presale --help
::

Usage: presale [OPTIONS]

Expand All @@ -17,9 +30,13 @@ A presale contract is a contract to collect presale investor money to be moved t
--minimum FLOAT What is the minimum pre-ico buy in (ether)
--help Show this message and exit.

Example that makes immediately refundable presale contract for testing on the mainnet::
Example that deploys an immediately refundable (-1 days to refund) presale contract for testing on the mainnet.

.. code-block :: console
deploy-presale --address=0x8888888888888888888 --days=-1 --minimum=0.001
presale --address=0x8888888888888888888 --days=-1 --minimum=0.001
::

Make sure mainnet chain is running, you can connect to it, or you'll get timeout
Web3 provider is RPC connection http://127.0.0.1:8545
Expand All @@ -35,3 +52,36 @@ Example that makes immediately refundable presale contract for testing on the ma
Presale.invest() data payload is 0xe8b5e51f
Presale.refund() data payload is 0x590e1ae3
All done! Enjoy your decentralized future.

Now you can make a invest transaction to the contract:

.. image:: screenshots/presale_invest.png
:width: 384

deploy-token
============

Deploy a crowdsale token contract.

Example that deploys a crowdsale token to testnet and then sets the owner as a release agent (party that can make the token transferable):

.. code-block:: console
deploy-token --chain=ropsten --address=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --name="MikkoToken 2.0" --symbol=MOO --release-agent=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --supply=100000
::

Web3 provider is RPC connection http://127.0.0.1:8546
Owner address is 0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6
Owner balance is 1427.411449177796571295 ETH
Please provide the password to unlock account `0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6`. []:
Starting contract deployment
Contract address is 0x513a7437d355293ac92d6912d9a8b257a343fb36
CrowdsaleToken constructor arguments is 000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000054d696b6b6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d6f6f0000000000000000000000000000000000000000000000000000000000
Setting release agent to 0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6
Token owner: 0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6
Token minting finished: False
Token released: False
Token release agent: 0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6
All done! Enjoy your decentralized future.

18 changes: 18 additions & 0 deletions docs/source/contracts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=========
Contracts
=========

.. content:: :local:

Introduction
============

This chapter describers Ethereum crowdsale smart contracts.

Preface
=======

You must understand Ethereum blockchain and `Solidity smart contract programming <http://solidity.readthedocs.io/>`_ basics

TODO
====
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This project aims to provide standard, secure smart contracts and tools to creat
:caption: Contents:

intro
contracts
install
commands
test
Expand Down
File renamed without changes
3 changes: 2 additions & 1 deletion ico/deploytoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def main(chain, address, name, symbol, supply, minting_agent, release_agent):
Example:
token --chain=ropsten --address=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --name=Mikko --symbol=MOO --release-agent=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --supply=100000
deploy-token --chain=ropsten --address=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --name="MikkoToken 2.0" --symbol=MOO --release-agent=0x3c2d4e5eae8c4a31ccc56075b5fd81307b1627c6 --supply=100000
"""

project = Project()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
tests_require=test_requirements,
entry_points='''
[console_scripts]
presale=ico.deploypresale:main
token=ico.deploytoken:main
deploy-presale=ico.deploypresale:main
deploy-token=ico.deploytoken:main
''',
)

0 comments on commit 5e250f6

Please sign in to comment.