Skip to content

Commit

Permalink
migrate content to format for new docs site
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit fcf35eb806100de300bd9803ce3150dde1ecc424
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 17 17:16:04 2019 -0300

    remove all docsite dependency

commit eeaee9a9d43d70704f6ab17b5126ddbd52b93a50
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 17 17:15:23 2019 -0300

    update solidity-docgen

commit f021ff9
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 17 17:05:06 2019 -0300

    update docsite script for new setup

commit ff88769
Merge: c938aa1 84f85a4
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 17 16:46:46 2019 -0300

    Merge branch 'master' into antora

commit c938aa1
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jul 16 18:24:29 2019 -0300

    make component name shorter

commit 5bbd693
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 20:16:17 2019 -0300

    add all info to docs templates

commit 39682c4
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 20:13:49 2019 -0300

    fix npm docsite script

commit 7ae46bd
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 18:48:05 2019 -0300

    convert inline docs to asciidoc

commit cfdfd3d
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 17:34:52 2019 -0300

    add missing contract names in readmes

commit 15b6a2f
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 17:16:47 2019 -0300

    fix script path

commit 80d82b9
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 17:13:53 2019 -0300

    update version of solidity-docgen

commit a870b6c
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 17:03:53 2019 -0300

    add nav generation of api ref

commit 069cff4
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Wed Jul 10 16:32:14 2019 -0300

    initial migration to asciidoc and new docgen version

commit 55216ee
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 20:39:35 2019 -0300

    add basic api doc example

commit 0cbe50c
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 19:31:31 2019 -0300

    add sidebars

commit 256fc94
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 15:22:38 2019 -0300

    add page titles

commit f4d0eff
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 15:19:41 2019 -0300

    add contracts index file

commit b73b063
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 15:14:52 2019 -0300

    fix header levels

commit fb57d9b
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 15:11:47 2019 -0300

    switch format to preferred asciidoctor format

commit 032181d
Author: Francisco Giordano <frangio.1@gmail.com>
Date:   Tue Jun 25 15:05:38 2019 -0300

    initialize antora component and convert docs to asciidoc
  • Loading branch information
frangio committed Jul 17, 2019
1 parent 84f85a4 commit 7552af9
Show file tree
Hide file tree
Showing 82 changed files with 3,209 additions and 8,160 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -41,6 +41,6 @@ build/
# IntelliJ IDE
.idea

# docsite artifacts
docsite-build
docs/api
# docs artifacts
docs/modules/api
openzeppelin-docs
21 changes: 21 additions & 0 deletions contracts/access/README.adoc
@@ -0,0 +1,21 @@
= Access

NOTE: This page is incomplete. We're working to improve it for the next release. Stay tuned!

== Library

{{Roles}}

== Roles

{{CapperRole}}

{{MinterRole}}

{{PauserRole}}

{{SignerRole}}

{{WhitelistAdminRole}}

{{WhitelistedRole}}
9 changes: 0 additions & 9 deletions contracts/access/README.md

This file was deleted.

35 changes: 35 additions & 0 deletions contracts/crowdsale/README.adoc
@@ -0,0 +1,35 @@
= Crowdsales

NOTE: This page is incomplete. We're working to improve it for the next release. Stay tuned!

== Core

{{Crowdsale}}

== Emission

{{AllowanceCrowdsale}}

{{MintedCrowdsale}}

== Validation

{{CappedCrowdsale}}

{{IndividuallyCappedCrowdsale}}

{{PausableCrowdsale}}

{{TimedCrowdsale}}

{{WhitelistCrowdsale}}

== Distribution

{{FinalizableCrowdsale}}

{{PostDeliveryCrowdsale}}

{{RefundableCrowdsale}}

{{RefundablePostDeliveryCrowdsale}}
13 changes: 0 additions & 13 deletions contracts/crowdsale/README.md

This file was deleted.

10 changes: 5 additions & 5 deletions contracts/cryptography/ECDSA.sol
Expand Up @@ -15,15 +15,15 @@ library ECDSA {
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* (.note) This call _does not revert_ if the signature is invalid, or
* NOTE: This call _does not revert_ if the signature is invalid, or
* if the signer is otherwise unable to be retrieved. In those scenarios,
* the zero address is returned.
*
* (.warning) `hash` _must_ be the result of a hash operation for the
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise)
* be too long), and then calling `toEthSignedMessageHash` on it.
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Check the signature length
Expand Down Expand Up @@ -69,10 +69,10 @@ library ECDSA {
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* replicates the behavior of the
* [`eth_sign`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign)
* https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
* JSON-RPC method.
*
* See `recover`.
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
Expand Down
@@ -1,9 +1,9 @@
---
sections:
- title: Libraries
contracts:
- ECDSA
- MerkleProof
---
= Cryptography

This collection of libraries provides simple and safe ways to use different cryptographic primitives.

== Libraries

{{ECDSA}}

{{MerkleProof}}
2 changes: 1 addition & 1 deletion contracts/drafts/Counters.sol
Expand Up @@ -9,7 +9,7 @@ import "../math/SafeMath.sol";
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
* Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath
* Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
* overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
* directly accessed.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/ERC1046/ERC20Metadata.sol
Expand Up @@ -5,7 +5,7 @@ import "../../token/ERC20/IERC20.sol";
/**
* @title ERC-1047 Token Metadata
* @dev See https://eips.ethereum.org/EIPS/eip-1046
* @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047
* @dev {tokenURI} must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047
*/
contract ERC20Metadata {
string private _tokenURI;
Expand Down
5 changes: 3 additions & 2 deletions contracts/drafts/ERC20Migrator.sol
Expand Up @@ -14,8 +14,8 @@ import "../math/Math.sol";
* migration to the new token contract. In this way, token holders "turn in"
* their old balance and will be minted an equal amount in the new token.
* The new token contract must be mintable. For the precise interface refer to
* OpenZeppelin's ERC20Mintable, but the only functions that are needed are
* `isMinter(address)` and `mint(address, amount)`. The migrator will check
* OpenZeppelin's {ERC20Mintable}, but the only functions that are needed are
* {MinterRole-isMinter} and {ERC20Mintable-mint}. The migrator will check
* that it is a minter for the token.
* The balance from the legacy token will be transferred to the migrator, as it
* is migrated, and remain there forever.
Expand All @@ -24,6 +24,7 @@ import "../math/Math.sol";
* version of it using ZeppelinOS. To read more about how this can be done
* using this implementation, please follow the official documentation site of
* ZeppelinOS: https://docs.zeppelinos.org/docs/erc20_onboarding.html
*
* Example of usage:
* ```
* const migrator = await ERC20Migrator.new(legacyToken.address);
Expand Down
14 changes: 8 additions & 6 deletions contracts/drafts/ERC20Snapshot.sol
Expand Up @@ -7,14 +7,16 @@ import "../token/ERC20/ERC20.sol";

/**
* @title ERC20 token with snapshots.
* @dev Inspired by Jordi Baylina's MiniMeToken to record historical balances:
* https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol
* When a snapshot is made, the balances and totalSupply at the time of the snapshot are recorded for later
* @dev Inspired by Jordi Baylina's
* https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol[MiniMeToken]
* to record historical balances.
*
* When a snapshot is made, the balances and total supply at the time of the snapshot are recorded for later
* access.
*
* To make a snapshot, call the `snapshot` function, which will emit the `Snapshot` event and return a snapshot id.
* To get the total supply from a snapshot, call the function `totalSupplyAt` with the snapshot id.
* To get the balance of an account from a snapshot, call the `balanceOfAt` function with the snapshot id and the
* To make a snapshot, call the {snapshot} function, which will emit the {Snapshot} event and return a snapshot id.
* To get the total supply from a snapshot, call the function {totalSupplyAt} with the snapshot id.
* To get the balance of an account from a snapshot, call the {balanceOfAt} function with the snapshot id and the
* account address.
* @author Validity Labs AG <info@validitylabs.org>
*/
Expand Down
23 changes: 23 additions & 0 deletions contracts/drafts/README.adoc
@@ -0,0 +1,23 @@
= Drafts

NOTE: This page is incomplete. We're working to improve it for the next release. Stay tuned!

== ERC 20

{{ERC20Migrator}}

{{ERC20Snapshot}}

{{TokenVesting}}

== Miscellaneous

{{Counters}}

{{SignatureBouncer}}

{{SignedSafeMath}}

== ERC 1046

{{ERC1046}}
16 changes: 0 additions & 16 deletions contracts/drafts/README.md

This file was deleted.

8 changes: 1 addition & 7 deletions contracts/drafts/Strings.sol
Expand Up @@ -6,13 +6,7 @@ pragma solidity ^0.5.0;
*/
library Strings {
/**
* Concatenates two strings.
* string(abi.encodePacked(a, b))
* https://solidity.readthedocs.io/en/latest/types.html?highlight=concatenate
*/

/**
* @dev Converts a uint256 to a string.
* @dev Converts a `uint256` to a `string`.
* via OraclizeAPI - MIT licence
* https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
*/
Expand Down
8 changes: 4 additions & 4 deletions contracts/introspection/ERC165.sol
Expand Up @@ -3,9 +3,9 @@ pragma solidity ^0.5.0;
import "./IERC165.sol";

/**
* @dev Implementation of the `IERC165` interface.
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call `_registerInterface` to declare
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
contract ERC165 is IERC165 {
Expand All @@ -26,7 +26,7 @@ contract ERC165 is IERC165 {
}

/**
* @dev See `IERC165.supportsInterface`.
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
Expand All @@ -39,7 +39,7 @@ contract ERC165 is IERC165 {
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See `IERC165.supportsInterface`.
* See {IERC165-supportsInterface}.
*
* Requirements:
*
Expand Down
14 changes: 7 additions & 7 deletions contracts/introspection/ERC165Checker.sol
@@ -1,7 +1,7 @@
pragma solidity ^0.5.0;

/**
* @dev Library used to query support of an interface declared via `IERC165`.
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
Expand All @@ -17,7 +17,7 @@ library ERC165Checker {
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

/**
* @dev Returns true if `account` supports the `IERC165` interface,
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function _supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
Expand All @@ -28,9 +28,9 @@ library ERC165Checker {

/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for `IERC165` itself is queried automatically.
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See `IERC165.supportsInterface`.
* See {IERC165-supportsInterface}.
*/
function _supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
Expand All @@ -40,12 +40,12 @@ library ERC165Checker {

/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for `IERC165` itself is queried automatically.
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* `IERC165` support.
* {IERC165} support.
*
* See `IERC165.supportsInterface`.
* See {IERC165-supportsInterface}.
*/
function _supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
Expand Down
12 changes: 6 additions & 6 deletions contracts/introspection/ERC1820Implementer.sol
Expand Up @@ -3,11 +3,11 @@ pragma solidity ^0.5.0;
import "./IERC1820Implementer.sol";

/**
* @dev Implementation of the `IERC1820Implementer` interface.
* @dev Implementation of the {IERC1820Implementer} interface.
*
* Contracts may inherit from this and call `_registerInterfaceForAddress` to
* Contracts may inherit from this and call {_registerInterfaceForAddress} to
* declare their willingness to be implementers.
* `IERC1820Registry.setInterfaceImplementer` should then be called for the
* {IERC1820Registry-setInterfaceImplementer} should then be called for the
* registration to be complete.
*/
contract ERC1820Implementer is IERC1820Implementer {
Expand All @@ -16,7 +16,7 @@ contract ERC1820Implementer is IERC1820Implementer {
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;

/**
* See `IERC1820Implementer.canImplementInterfaceForAddress`.
* See {IERC1820Implementer-canImplementInterfaceForAddress}.
*/
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32) {
return _supportedInterfaces[interfaceHash][account] ? ERC1820_ACCEPT_MAGIC : bytes32(0x00);
Expand All @@ -26,8 +26,8 @@ contract ERC1820Implementer is IERC1820Implementer {
* @dev Declares the contract as willing to be an implementer of
* `interfaceHash` for `account`.
*
* See `IERC1820Registry.setInterfaceImplementer` and
* `IERC1820Registry.interfaceHash`.
* See {IERC1820Registry-setInterfaceImplementer} and
* {IERC1820Registry-interfaceHash}.
*/
function _registerInterfaceForAddress(bytes32 interfaceHash, address account) internal {
_supportedInterfaces[interfaceHash][account] = true;
Expand Down
8 changes: 4 additions & 4 deletions contracts/introspection/IERC165.sol
Expand Up @@ -2,18 +2,18 @@ pragma solidity ^0.5.0;

/**
* @dev Interface of the ERC165 standard, as defined in the
* [EIP](https://eips.ethereum.org/EIPS/eip-165).
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others (`ERC165Checker`).
* queried by others ({ERC165Checker}).
*
* For an implementation, see `ERC165`.
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
Expand Down

0 comments on commit 7552af9

Please sign in to comment.