Skip to content

Instantly share code, notes, and snippets.

View panukettu's full-sized avatar
🎯
Focusing

panu panukettu

🎯
Focusing
View GitHub Profile
@panukettu
panukettu / Mocks.sol
Created September 22, 2023 18:42
Smock API Example
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {MyContract} from "./MyContract.sol";
library MockMyContract {
function mockCall(
function(address) external view returns (uint256),
uint256 mockReturnValue
) internal {
// do the thing to return mockReturnValue
@panukettu
panukettu / Logic.sol
Last active June 6, 2022 17:27
Diamond with free function storage
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import {s} from './Storage.sol';
contract Logic {
function setFoo(string memory newFoo) external {
s()._setFoo(newFoo);
}