Skip to content

Conversation

@come-maiz
Copy link

Fixes #15

}

function validate() public {
jurisdiction.addAttribute(msg.sender, "VALID", 1);
Copy link
Author

Choose a reason for hiding this comment

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

I found this weird, because the Registry doesn't have addAttribute, just hasAttribute.
Maybe, the idea is to have a checker that just checks hasAttribute, and a validator that calls addAttribute.
Or maybe we should include addAttribute to Registry, so it's nicer to do both on the same validator.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Registry seems to be the read-only interface of Jurisdiction. 🤷‍♂️

It looks good to me like this.

Copy link
Author

Choose a reason for hiding this comment

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

What's weird is that now the validator has a variable called registry and another called jurisdiction, and they point to the same instance.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, right. I don't see a way out of this. We can't cast the registry variable safely because we don't know if TransactionChecker ever changes it to be something different.

@come-maiz come-maiz requested a review from frangio June 2, 2018 06:56
returns (bool)
{
require(jurisdiction.hasAttribute(_to, "VALID"));
require(validator.transferAllowed(msg.sender, _to, _amount));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not clear in the TPL spec, but I think we should be checking transferAllowed(0x0, _to, _amount), i.e. from = 0x0 which is usually how minting is thought of.

}

function validate() public {
jurisdiction.addAttribute(msg.sender, "VALID", 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Registry seems to be the read-only interface of Jurisdiction. 🤷‍♂️

It looks good to me like this.

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.

2 participants