Skip to content

Commit

Permalink
precompile RIPEMD-160 + Tests (kkrt-labs#421)
Browse files Browse the repository at this point in the history
## Pull request type

Please check the type of change your PR introduces:

- [ ] Bugfix
- [X] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

no precompile RIPEMD-160

Resolves kkrt-labs#359 

## What is the new behavior?

precompile RIPEMD-160 🚀  

## Other information

<!-- Give an estimate of the time you spent on this PR in terms of work
days. Did you spend 0.5 days on this PR or rather 2 days? -->
Time spent on this PR:  1 day

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Co-authored-by: kakarot CI <[email protected]>
  • Loading branch information
zarboq and kakarot CI authored Jan 12, 2023
1 parent 8ee4617 commit 36a6d32
Show file tree
Hide file tree
Showing 6 changed files with 1,065 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ setproctitle = "^1.3.2"
pysha3 = "^1.0.2"
web3 = "^5.31.1"
python-dotenv = "^0.21.0"
pycrypto = "2.6.1"
eth-utils = "<2.0.0"
eth-abi = "<3.0.0"
eth-account = "<0.8.0"
Expand Down Expand Up @@ -107,6 +108,7 @@ markers = [
"INVALID: Opcode Value 0xfe - Designated invalid instruction",
"Precompiles",
"EC_RECOVER: Precompile Value 0x01 - Elliptic curve digital signature algorithm (ECDSA) public key recovery function",
"RIPEMD160: Precompile Value 0x03 - Hash function",
"Counter",
"PlainOpcodes",
"SolmateERC20",
Expand Down
3 changes: 2 additions & 1 deletion src/kakarot/precompiles/precompiles.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from kakarot.model import model
from kakarot.precompiles.datacopy import PrecompileDataCopy
from kakarot.precompiles.ecadd import PrecompileEcAdd
from kakarot.precompiles.ec_recover import PrecompileEcRecover
from kakarot.precompiles.ripemd160 import PrecompileRIPEMD160
from kakarot.stack import Stack

// @title Precompile related functions.
Expand Down Expand Up @@ -113,7 +114,7 @@ namespace Precompiles {
ret;
call not_implemented_precompile; // 0x2
ret;
call not_implemented_precompile; // 0x3
call PrecompileRIPEMD160.run; // 0x3
ret;
call PrecompileDataCopy.run; // 0x4
ret;
Expand Down
Loading

0 comments on commit 36a6d32

Please sign in to comment.