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

Azavalla feature/inheritable contract #680

Merged
merged 25 commits into from
Jan 18, 2018
Merged

Azavalla feature/inheritable contract #680

merged 25 commits into from
Jan 18, 2018

Conversation

theethernaut
Copy link
Contributor

Manual merge for PR #595

Applies styling to tests.

uint public heartbeatTimeout;

// Timestamp of the owner's death, as pronounced by the heir.
uint public timeOfDeath;
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about using uint256 explicitly?

require(newHeir != owner);
heartbeat();
HeirChanged(owner, newHeir);
heir = newHeir;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we provide a setter, I would go with a private visibility for the heir and providing a getter as well. This will ensure that inheriting contracts can not modify the heir in another way than the one proposed.

Copy link
Contributor

Choose a reason for hiding this comment

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

we may want the same thing for heartbeatTimeout and timeOfDeath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, but this is not something we're implementing in general in OZ. Eg. Ownable has:
address public owner

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually we are caring about this from now on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great. I won't be changing it in this PR tho.
I will create an issue instead and ping @azavalla

}

function setHeartbeatTimeout(uint newHeartbeatTimeout) internal onlyOwner {
require(ownerLives());
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want a heartbeat to be greater than 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? Do you mean that we should check for newHeartbeatTimeout > 0?
If so, isn't that implied in the uint type?

facuspagnuolo
facuspagnuolo previously approved these changes Jan 16, 2018
contract SimpleSavingsWallet is Heritable {

event Sent(address payee, uint amount, uint balance);
event Received(address payer, uint amount, uint balance);
Copy link
Contributor

Choose a reason for hiding this comment

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

2 things:

  • addresses may be indexed?
  • we should use uint256 here too

@facuspagnuolo
Copy link
Contributor

LGTM

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.

LGTM

@theethernaut theethernaut merged commit ff9e9c4 into OpenZeppelin:master Jan 18, 2018
@theethernaut theethernaut deleted the azavalla-feature/inheritable-contract branch January 18, 2018 20:41
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
…/inheritable-contract

Azavalla feature/inheritable contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants