Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Use sha3 has for snative addresses for future-proofing #507

Merged

Conversation

silasdavis
Copy link
Contributor

No description provided.

Copy link
Contributor

@benjaminbollen benjaminbollen left a comment

Choose a reason for hiding this comment

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

This minimally needs to change; other comments can come later

// hash of its name
func (contract *SNativeContractDescription) Address() abi.Address {
var address abi.Address
copy(address[:], sha3.Sha3([]byte(contract.Name))[:abi.AddressLength])
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's of a public key though, so it's kind of unrelated... We could copy, but I can't see how it will make any difference. The point is just to have a uniform hash over the 20 bytes.

@benjaminbollen
Copy link
Contributor

Overall nice improvement

Copy link
Contributor

@VoR0220 VoR0220 left a comment

Choose a reason for hiding this comment

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

This works quite nicely. Waiting on last bits to come in, and then should be ready for merge.

@VoR0220 VoR0220 merged commit 32dd82d into hyperledger-archives:release-0.16 Feb 23, 2017
@silasdavis silasdavis deleted the snative-templates branch February 23, 2017 21:21
@benjaminbollen
Copy link
Contributor

Yes, I reviewed it last thing before I left, but forgot to merge. lgtm

silasdavis pushed a commit to silasdavis/burrow that referenced this pull request Mar 9, 2019
…emplates

Use sha3 has for snative addresses for future-proofing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants