logoAcademy

Interact with Precompile

Interact with the MD5 precompile we just deployed.

Call Precompile from Foundry

Now we will call our MD5 precompile to generate a bytes16 hash of the input string.

MD5 Precompile Address: 0x0300000000000000000000000000000000000002

cast call --rpc-url myblockchain --private-key $PK 0x0300000000000000000000000000000000000002 "hashWithMD5(string)(bytes16)" "test"

You should see the bytes16 hash of the input string test as the output.

0x098f6bcd4621d373cade4e832627b4f6

On this page