Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line lido/fixed-compiler-version
pragma solidity >=0.4.24 <0.9.0;
library UnstructuredStorageMap {
function getStorageMappingUint256(bytes32 position, uint256 key) internal view returns (uint256 data) {
return getStorageMappingUint256Offset(position, key, 0);
}
@krogla
krogla / MetamorphicContractInitCode.txt
Created May 9, 2023 06:50 — forked from 0age/MetamorphicContractInitCode.txt
Metamorphic Contract Initialization Code
* @title Metamorphic Contract
* @author 0age, derived from cloner contract by @mhswende
* @notice This contract will create a metamorphic contract, or an upgradeable
* contract that does not rely on a transparent proxy, when deployed using
* CREATE2. It expects the deployer to provide a getImplementation() function
* that will return an implementation address, which it will then clone and
* deploy. Unlike with upgradeable transparent proxies, the state of a
* metamorphic contract will be wiped clean with each upgrade. With great power
* comes great responsibility - implement appropriate controls and educate the
* users of your contract if it will be interacted with!
@krogla
krogla / ipv6-pppoe.rsc
Created April 4, 2024 20:59 — forked from ebababi/ipv6-pppoe.rsc
MikroTik RouterOS Script: Configure DHCPv6-PD on the PPPoE interface.
# Configure DHCPv6-PD on the PPPoE interface.
#
# Prior script execution, enable IPv6 package:
# /system
# package enable ipv6
# reboot
#
# Resources:
# https://kb.pentanet.com.au/faq/how-to-configure-a-mikrotik-routerboard-router-to-accept-ipv6
# https://www.netdaily.org/tag/mikrotik-ipv6/