Skip to content

Instantly share code, notes, and snippets.

@nerderlyne
nerderlyne / madv.sol
Created June 20, 2024 10:03
calculate key, slot and value
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
contract MADV {
function getKey(address validator) public pure returns (uint192) {
return uint192(uint160(validator));
}
function getSlotAndValue(address validator) public pure returns (bytes32 slot, bytes32 value) {
slot = bytes32(abi.encodePacked(getKey(validator)));
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.14;
import {IProjectManagement} from "https://github.com/SporosDAO/sweat-token/blob/dev/contracts/src/interfaces/IProjectManagement.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "hardhat/console.sol";
/**
did:3:kjzl6cwe1jw147gb6tlonf9oesja8u48qwiggpr7idnfhbqnkuwj7ey8ao08gu0
@nerderlyne
nerderlyne / LexRegistry.sol
Last active February 5, 2024 04:31
LexDAO Lawyer Registry Contract
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
contract LexRegistry {
address public owner;
mapping(address => lawyer) lawyers;
struct lawyer {