Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docs for the Solidity code #799

Merged
merged 22 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ pipeline:
when:
event: [pull_request]

build_solidity_docs:
group: build_artifacts
image: kowalatech/solidoc
commands:
- make dev_solidocs_docker_image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could build this image once and push it to dockerhub instead of building it every time. It could live in a separate repo too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do that

- make build_solidity_docs_with_docker
when:
event: [push,tag]
branch: [master,dev]

go_generate:
group: generate
image: kowalatech/go:1.0.12
Expand Down Expand Up @@ -375,16 +385,6 @@ pipeline:
branch: [dev]
event: [push]

build_solidity_docs:
group: build_artifacts
image: kowalatech/solidoc
commands:
- make dev_docker_images
- make build_solidity_docs_with_docker
when:
event: [push,tag]
branch: [master,dev]

build_docs:
group: build_artifacts
image: kowalatech/mkdocs
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ build_docs_with_docker:

.PHONY: build_solidity_docs_with_docker
build_solidity_docs_with_docker:
@docker run --rm -it -v $(PWD)/client/contracts/truffle/:/src -v $(PWD)/docs:/out kowalatech/solidoc
@docker run --rm -it -v $(PWD)/client/contracts/truffle/:/src -v $(PWD)/docs/docs/smartcontracts:/out kowalatech/solidoc

## Dev docker images

Expand Down
72 changes: 72 additions & 0 deletions docs/docs/smartcontracts/BalanceContract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# BalanceContract.sol

**contract BalanceContract is [TokenReceiver](TokenReceiver.md)**

**BalanceContract**

## Contract Members
**Constants & Variables**

```js
//internal members
address internal owner;
bytes internal data;
//public members
address public from;
uint256 public value;
```

## Functions

- [tokenFallback](#tokenfallback)

### tokenFallback

:small_red_triangle: overrides [TokenReceiver.tokenFallback](TokenReceiver.md#tokenfallback)

```js
function tokenFallback(address _from, uint256 _value, bytes _data) public
```

**Arguments**

| Name | Type | Description |
| ------------- |------------- | -----|
| _from | address | |
| _value | uint256 | |
| _data | bytes | |

## Contracts

- [KNSRegistryV1](KNSRegistryV1.md)
- [ValidatorMgr](ValidatorMgr.md)
- [Math](Math.md)
- [NameHash](NameHash.md)
- [SystemVars](SystemVars.md)
- [Stability](Stability.md)
- [Token](Token.md)
- [TokenMock](TokenMock.md)
- [TokenReceiver](TokenReceiver.md)
- [SafeMath](SafeMath.md)
- [CappedToken](CappedToken.md)
- [FIFSRegistrar](FIFSRegistrar.md)
- [Initializable](Initializable.md)
- [KNSRegistry](KNSRegistry.md)
- [ExchangeMgr](ExchangeMgr.md)
- [KRC223](KRC223.md)
- [PublicResolver](PublicResolver.md)
- [MultiSigWallet](MultiSigWallet.md)
- [DomainResolver](DomainResolver.md)
- [PriceProvider](PriceProvider.md)
- [BalanceContract](BalanceContract.md)
- [MiningToken](MiningToken.md)
- [MintableToken](MintableToken.md)
- [strings](strings.md)
- [Pausable](Pausable.md)
- [Migrations](Migrations.md)
- [Ownable](Ownable.md)
- [Consensus](Consensus.md)
- [OracleMgr](OracleMgr.md)
- [ConsensusMock](ConsensusMock.md)
- [DomainResolverMock](DomainResolverMock.md)
- [KNS](KNS.md)
75 changes: 75 additions & 0 deletions docs/docs/smartcontracts/CappedToken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Capped token (CappedToken.sol)

**contract CappedToken is [MintableToken](MintableToken.md)**

**CappedToken**

Mintable token with a token cap.

## Contract Members
**Constants & Variables**

```js
uint256 public cap;
```

## Functions

- [mint](#mint)

### mint

:small_red_triangle: overrides [MintableToken.mint](MintableToken.md#mint)

Function to mint tokens

```js
function mint(address _to, uint256 _amount) public onlyOwner canMint
returns(bool)
```

**Returns**

A boolean that indicates if the operation was successful.

**Arguments**

| Name | Type | Description |
| ------------- |------------- | -----|
| _to | address | The address that will receive the minted tokens. |
| _amount | uint256 | The amount of tokens to mint. |

## Contracts

- [KNSRegistryV1](KNSRegistryV1.md)
- [ValidatorMgr](ValidatorMgr.md)
- [Math](Math.md)
- [NameHash](NameHash.md)
- [SystemVars](SystemVars.md)
- [Stability](Stability.md)
- [Token](Token.md)
- [TokenMock](TokenMock.md)
- [TokenReceiver](TokenReceiver.md)
- [SafeMath](SafeMath.md)
- [CappedToken](CappedToken.md)
- [FIFSRegistrar](FIFSRegistrar.md)
- [Initializable](Initializable.md)
- [KNSRegistry](KNSRegistry.md)
- [ExchangeMgr](ExchangeMgr.md)
- [KRC223](KRC223.md)
- [PublicResolver](PublicResolver.md)
- [MultiSigWallet](MultiSigWallet.md)
- [DomainResolver](DomainResolver.md)
- [PriceProvider](PriceProvider.md)
- [BalanceContract](BalanceContract.md)
- [MiningToken](MiningToken.md)
- [MintableToken](MintableToken.md)
- [strings](strings.md)
- [Pausable](Pausable.md)
- [Migrations](Migrations.md)
- [Ownable](Ownable.md)
- [Consensus](Consensus.md)
- [OracleMgr](OracleMgr.md)
- [ConsensusMock](ConsensusMock.md)
- [DomainResolverMock](DomainResolverMock.md)
- [KNS](KNS.md)
55 changes: 55 additions & 0 deletions docs/docs/smartcontracts/Consensus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Consensus.sol

**Consensus**

## Functions

- [isSuperNode](#issupernode)

### isSuperNode

```js
function isSuperNode(address identity) public view
returns(bool)
```

**Arguments**

| Name | Type | Description |
| ------------- |------------- | -----|
| identity | address | |

## Contracts

- [KNSRegistryV1](KNSRegistryV1.md)
- [ValidatorMgr](ValidatorMgr.md)
- [Math](Math.md)
- [NameHash](NameHash.md)
- [SystemVars](SystemVars.md)
- [Stability](Stability.md)
- [Token](Token.md)
- [TokenMock](TokenMock.md)
- [TokenReceiver](TokenReceiver.md)
- [SafeMath](SafeMath.md)
- [CappedToken](CappedToken.md)
- [FIFSRegistrar](FIFSRegistrar.md)
- [Initializable](Initializable.md)
- [KNSRegistry](KNSRegistry.md)
- [ExchangeMgr](ExchangeMgr.md)
- [KRC223](KRC223.md)
- [PublicResolver](PublicResolver.md)
- [MultiSigWallet](MultiSigWallet.md)
- [DomainResolver](DomainResolver.md)
- [PriceProvider](PriceProvider.md)
- [BalanceContract](BalanceContract.md)
- [MiningToken](MiningToken.md)
- [MintableToken](MintableToken.md)
- [strings](strings.md)
- [Pausable](Pausable.md)
- [Migrations](Migrations.md)
- [Ownable](Ownable.md)
- [Consensus](Consensus.md)
- [OracleMgr](OracleMgr.md)
- [ConsensusMock](ConsensusMock.md)
- [DomainResolverMock](DomainResolverMock.md)
- [KNS](KNS.md)
62 changes: 62 additions & 0 deletions docs/docs/smartcontracts/ConsensusMock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# ConsensusMock.sol

**ConsensusMock**

## Contract Members
**Constants & Variables**

```js
bool internal superNode;
```

## Functions

- [isSuperNode](#issupernode)

### isSuperNode

```js
function isSuperNode(address identity) public view
returns(bool)
```

**Arguments**

| Name | Type | Description |
| ------------- |------------- | -----|
| identity | address | |

## Contracts

- [KNSRegistryV1](KNSRegistryV1.md)
- [ValidatorMgr](ValidatorMgr.md)
- [Math](Math.md)
- [NameHash](NameHash.md)
- [SystemVars](SystemVars.md)
- [Stability](Stability.md)
- [Token](Token.md)
- [TokenMock](TokenMock.md)
- [TokenReceiver](TokenReceiver.md)
- [SafeMath](SafeMath.md)
- [CappedToken](CappedToken.md)
- [FIFSRegistrar](FIFSRegistrar.md)
- [Initializable](Initializable.md)
- [KNSRegistry](KNSRegistry.md)
- [ExchangeMgr](ExchangeMgr.md)
- [KRC223](KRC223.md)
- [PublicResolver](PublicResolver.md)
- [MultiSigWallet](MultiSigWallet.md)
- [DomainResolver](DomainResolver.md)
- [PriceProvider](PriceProvider.md)
- [BalanceContract](BalanceContract.md)
- [MiningToken](MiningToken.md)
- [MintableToken](MintableToken.md)
- [strings](strings.md)
- [Pausable](Pausable.md)
- [Migrations](Migrations.md)
- [Ownable](Ownable.md)
- [Consensus](Consensus.md)
- [OracleMgr](OracleMgr.md)
- [ConsensusMock](ConsensusMock.md)
- [DomainResolverMock](DomainResolverMock.md)
- [KNS](KNS.md)
59 changes: 59 additions & 0 deletions docs/docs/smartcontracts/DomainResolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# DomainResolver.sol

**DomainResolver**

## Functions

- [addr](#addr)

### addr

```js
function addr(bytes32 node) public view
returns(address)
```

**Returns**

The associated address.

**Arguments**

| Name | Type | Description |
| ------------- |------------- | -----|
| node | bytes32 | The KNS node to query. |

## Contracts

- [KNSRegistryV1](KNSRegistryV1.md)
- [ValidatorMgr](ValidatorMgr.md)
- [Math](Math.md)
- [NameHash](NameHash.md)
- [SystemVars](SystemVars.md)
- [Stability](Stability.md)
- [Token](Token.md)
- [TokenMock](TokenMock.md)
- [TokenReceiver](TokenReceiver.md)
- [SafeMath](SafeMath.md)
- [CappedToken](CappedToken.md)
- [FIFSRegistrar](FIFSRegistrar.md)
- [Initializable](Initializable.md)
- [KNSRegistry](KNSRegistry.md)
- [ExchangeMgr](ExchangeMgr.md)
- [KRC223](KRC223.md)
- [PublicResolver](PublicResolver.md)
- [MultiSigWallet](MultiSigWallet.md)
- [DomainResolver](DomainResolver.md)
- [PriceProvider](PriceProvider.md)
- [BalanceContract](BalanceContract.md)
- [MiningToken](MiningToken.md)
- [MintableToken](MintableToken.md)
- [strings](strings.md)
- [Pausable](Pausable.md)
- [Migrations](Migrations.md)
- [Ownable](Ownable.md)
- [Consensus](Consensus.md)
- [OracleMgr](OracleMgr.md)
- [ConsensusMock](ConsensusMock.md)
- [DomainResolverMock](DomainResolverMock.md)
- [KNS](KNS.md)
Loading