kkrt-labs / kakarot

Kakarot is a zkEVM written in Cairo, leveraging the STARK proof system.

Home Page:https://kakarot.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dev: add to tests end-to-end a new solidity contract: keccak for testing keccak step/builtin consumption

Eikix opened this issue · comments

Tasks

Note: you can modify the sol contract to store the hash instead of emitting an event, your choice.

Keccak.sol:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract KeccakTransaction {
    // Event declaration for logging the hash and sender
    event HashComputed(address indexed sender, bytes32 hash);

    // Function to compute and store the keccak256 hash of a given input
    function computeAndStoreHash(string memory input) public {
        bytes32 hash = keccak256(abi.encodePacked(input));
        // Emitting an event with the sender and the hash
        emit HashComputed(msg.sender, hash);
    }
}

See #1071 before