Chapter 1: Making the Kernel
Defining the kernel
// SPDX-License-Identifier: MIT License
pragma solidity ^0.8.13;
contract Walnut {
suint256 kernel; // The shielded kernel (number inside the Walnut)
// Constructor to initialize the kernel
constructor(suint256 _kernel) {
kernel = _kernel;
}
}function shake(suint256 _numShakes) public {
kernel += _numShakes; // Increment the kernel value using the shielded parameter.
emit Shake(msg.sender); // Log the shake event.
}PreviousWriting, testing and deploying the contractNextChapter 2: Making the Shell and revealing the Kernel
Last updated

