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

Add sha256 function #1327

Closed
jacqueswww opened this issue Mar 6, 2019 · 1 comment
Closed

Add sha256 function #1327

jacqueswww opened this issue Mar 6, 2019 · 1 comment
Labels
VIP: Approved VIP Approved VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting

Comments

@jacqueswww
Copy link
Contributor

jacqueswww commented Mar 6, 2019

Simple Summary

Currently Vyper doesn't

Abstract

Add sha256 function, which hcalls

Motivation

Currently sha256 precompile isn't exposed as a function, this VIP adds the functionality.

Specification

def sha256(bytelike: string) -> bytes32:
      # bytelike can be one of  byte_literal, str_literal, bytes, string, bytes32
      # ...

This function will make a call to the pre-compile at address 0x000...0002, and return the output as bytes.

Backwards Compatibility

Feature, forwards compatible.

Dependencies

No dependencies.

Copyright

Copyright and related rights waived via CC0

@jacqueswww jacqueswww added the VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting label Mar 6, 2019
@jacqueswww
Copy link
Contributor Author

There is currently workaround on the deposit contract: ethereum/deposit_contract#14 using raw call, so quite keen on getting this in on b9 or b10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Approved VIP Approved VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting
Projects
None yet
Development

No branches or pull requests

1 participant