license.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. LICENSE
  2. =============================================
  3. **Welcome to Zeppelin-Solidity!** Get familiar with the Zeppelin Smart Contracts.
  4. Documentation
  5. ^^^^^^^^^^^^^^
  6. Smart Contr
  7. ---
  8. ### Stoppable
  9. Base contract that provides an emergency stop mechanism.
  10. Inherits from contract Ownable.
  11. #### emergencyStop( ) external onlyOwner
  12. Triggers the stop mechanism on the contract. After this function is called (by the owner of the contract), any function with modifier stopInEmergency will not run.
  13. #### modifier stopInEmergency
  14. Prevents function from running if stop mechanism is activated.
  15. #### modifier onlyInEmergency
  16. Only runs if stop mechanism is activated.
  17. #### release( ) external onlyOwner onlyInEmergency
  18. Deactivates the stop mechanism.
  19. ---
  20. ### Killable
  21. Base contract that can be killed by owner.
  22. Inherits from contract Ownable.
  23. #### kill( ) onlyOwner
  24. Destroys the contract and sends funds back to the owner.
  25. ___
  26. ### Claimable
  27. Extension for the Ownable contract, where the ownership needs to be claimed
  28. #### transfer(address newOwner) onlyOwner
  29. Sets the passed address as the pending owner.
  30. #### modifier onlyPendingOwner
  31. Function only runs if called by pending owner.
  32. #### claimOwnership( ) onlyPendingOwner
  33. Completes transfer of ownership by setting pending owner as the new owner.
  34. ___
  35. ### Migrations
  36. Base contract that allows for a new instance of itself to be created at a different address.
  37. Inherits from contract Ownable.
  38. #### upgrade(address new_address) onlyOwner
  39. Creates a new instance of the contract at the passed address.
  40. #### setCompleted(uint completed) onlyOwner
  41. Sets the last time that a migration was completed.
  42. ___
  43. ### SafeMath
  44. Provides functions of mathematical operations with safety checks.
  45. #### assert(bool assertion) internal
  46. Throws an error if the passed result is false. Used in this contract by checking mathematical expressions.
  47. #### safeMul(uint a, uint b) internal returns (uint)
  48. Multiplies two unisgned integers. Asserts that dividing the product by the non-zero multiplicand results in the multiplier.
  49. #### safeSub(uint a, unit b) internal returns (uint)
  50. Checks that b is not greater than a before subtracting.
  51. #### safeAdd(unit a, unit b) internal returns (uint)
  52. Checks that the result is greater than both a and b.
  53. ___
  54. ### LimitBalance
  55. Base contract that provides mechanism for limiting the amount of funds a contract can hold.
  56. #### LimitBalance(unit _limit)
  57. Constructor takes an unisgned integer and sets it as the limit of funds this contract can hold.
  58. #### modifier limitedPayable()
  59. Throws an error if this contract's balance is already above the limit.
  60. ___
  61. ### PullPayment
  62. Base contract supporting async send for pull payments.
  63. Inherit from this contract and use asyncSend instead of send.
  64. #### asyncSend(address dest, uint amount) internal
  65. Adds sent amount to available balance that payee can pull from this contract, called by payer.
  66. #### withdrawPayments( )
  67. Sends designated balance to payee calling the contract. Throws error if designated balance is 0, if contract does not hold enough funds ot pay the payee, or if the send transaction is not successful.
  68. ___
  69. ### StandardToken
  70. Based on code by FirstBlood: [FirstBloodToken.sol]
  71. Inherits from contract SafeMath. Implementation of abstract contract ERC20 (see https://github.com/ethereum/EIPs/issues/20)
  72. [FirstBloodToken.sol]: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
  73. #### approve(address _spender, uint _value) returns (bool success)
  74. Sets the amount of the sender's token balance that the passed address is approved to use.
  75. ###allowance(address _owner, address _spender) constant returns (uint remaining)
  76. Returns the approved amount of the owner's balance that the spender can use.
  77. ###balanceOf(address _owner) constant returns (uint balance)
  78. Returns the token balance of the passed address.
  79. ###transferFrom(address _from, address _to, uint _value) returns (bool success)
  80. Transfers tokens from an account that the sender is approved to transfer from. Amount must not be greater than the approved amount or the account's balance.
  81. ###function transfer(address _to, uint _value) returns (bool success)
  82. Transfers tokens from sender's account. Amount must not be greater than sender's balance.
  83. ___
  84. ### BasicToken
  85. Simpler version of StandardToken, with no allowances
  86. #### balanceOf(address _owner) constant returns (uint balance)
  87. Returns the token balance of the passed address.
  88. ###function transfer(address _to, uint _value) returns (bool success)
  89. Transfers tokens from sender's account. Amount must not be greater than sender's balance.
  90. ___
  91. ### CrowdsaleToken
  92. Simple ERC20 Token example, with crowdsale token creation.
  93. Inherits from contract StandardToken.
  94. #### createTokens(address recipient) payable
  95. Creates tokens based on message value and credits to the recipient.
  96. #### getPrice() constant returns (uint result)
  97. Returns the amount of tokens per 1 ether.
  98. .. toctree::
  99. :maxdepth: 2
  100. :caption: Contents:
  101. * :ref:`genindex`
  102. * :ref:`modindex`
  103. * :ref:`search`