Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Adds inline documentation for the contracts #13

Merged
merged 9 commits into from
Apr 12, 2018
Merged

Conversation

martriay
Copy link
Contributor

@martriay martriay commented Apr 12, 2018

Solves #12. I left the ZepToken contract out since it's pretty straightforward and we talked about abstracting the vouching token from the kernel.

Before merging, I would like for the reviewer to pay attention to the description of the data argument in the staking functions, especially the one from ZepCore's transferStake which is not defined in the ERC900 spec thus is not required for compliance.

@facuspagnuolo facuspagnuolo added kind:chore Housekeeping tasks topic:kernel Kernel registry management labels Apr 12, 2018
@facuspagnuolo
Copy link
Contributor

@martriay there are some DocstringParsingError errors, could you please fix them?

@martriay
Copy link
Contributor Author

martriay commented Apr 12, 2018 via email

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

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

Thanks @martriay ! Looks really good, left some minor comments :)

@@ -11,23 +11,49 @@ import "zos-core/contracts/upgradeability/UpgradeabilityProxyFactory.sol";
import "zos-core/contracts/ImplementationProvider.sol";
import "zeppelin-solidity/contracts/math/SafeMath.sol";

/**
* @title ZepCore
* @dev This contract controls the kernel distributions and versions for ZeppelinOS
Copy link
Contributor

Choose a reason for hiding this comment

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

what about this contract controls the registry and vouching mechanism of the kernel distributions and versions for ZeppelinOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the vouching mechanism corresponds to KernelStakes, and that this mechanism is an implementation detail of the version management. ZepCore's role and functionality would not change if instead of staking we were manually selecting the versions.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

yea but actually this one exposes an API for it too

* @param staker representing the staker address
* @param instance representing the kernel instance being unstaked for
* @param amount representing the amount being unstaked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

* @param amount representing the staked amount
* @param total representing the new total amount staked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the erc900 part given we are actually not following that standard

Copy link
Contributor Author

@martriay martriay Apr 12, 2018

Choose a reason for hiding this comment

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

If that's the case, why not remove the data parameter along with it?

* @param staker representing the address of the staker
* @param instance representing the kernel staked for
* @param amount representing the staked amount
* @param total representing the new total amount staked
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add for the given address just to be clear

* @param instance representing the kernel unstaked for
* @param amount representing the unstaked amount
* @param total representing the new total amount staked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

* @param staker representing the staker address
* @param instance representing the kernel instance being staked for
* @param amount representing the amount being staked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

* @param developerFraction_ representing the fraction of stakes rewarded to the developer of a kernel instance
* @param _owner representing the address of the owner
* @param _owner representing the address of the owner
* @param _owner representing the address of the owner
Copy link
Contributor

Choose a reason for hiding this comment

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

woooot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And that kids is why reviewing is so important

* @dev Unstakes a given amount for a given kernel instance
* @param instance representing the kernel instance being unstaked for
* @param amount representing the amount being unstaked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

* @param from representing the kernel instance being unstaked for
* @param to representing the kernel instance being staked for
* @param amount representing the amount of stakes being transferred
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

* @param staker representing the address of the staker
* @param instance representing the kernel instance being staked for
* @param amount representing the amount being staked
* @param data representing additional information for complex staking models. Included to comply with the ERC900 staking interface (https://github.com/ethereum/EIPs/pull/910)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@facuspagnuolo facuspagnuolo merged commit 0c330e8 into master Apr 12, 2018
@facuspagnuolo facuspagnuolo deleted the inline-doc branch April 12, 2018 16:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:chore Housekeeping tasks topic:kernel Kernel registry management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants