Skip to content

Instantly share code, notes, and snippets.

View krebernisak's full-sized avatar
🎯
Focusing

Kristijan Rebernisak krebernisak

🎯
Focusing
View GitHub Profile
@krebernisak
krebernisak / mainnet.feature.txt
Last active November 6, 2024 22:51
Solana mainnet feature set
Feature | Status | Description
E3PHP7w8kB7np3CTQ1qQ2tW3KCtjRSXBQgW9vM2mWv2Y | active since slot 41040000 | secp256k1 program
E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv | active since slot 41040000 | spl-token multisig fix
4kpdyrcj5jS47CZb2oJGfVxjYbsMm2Kx97gFyZrxxwXz | active since slot 51408000 | no overflow rent distribution
GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu | active since slot 55728001 | deprecate unused rewards sysvar
4RWNif6C2WCNiKVW7otP4G7dkmkHGyKQWRpuZ1pxKU5m | active since slot 57456000 | pico inflation
GE7fRxmW46K6EmCD9AMZSbnaJ2e3LfqCZzdHi9hmYAgi | active since slot 57888004 | filter stake_delegation_accounts #14062
7XRJcS5Ud5vxGB54JbK9N2vBZVwnwdBNeJW1ibRgD9gx | active since slot 64800004 | full inflation enabled by Certus One
BzBBveUDymEYoYzcMWNQCx3cd4jQs7puaVFHLtsbB6fm | active since slot 64800004 | community vote allowing Certus One to enable full inflation
BL99GYhdjjcv6ys22C9wPgn2aTVERDbPHHo4NbS3hgp7 | active since slot
@krebernisak
krebernisak / devnet.feature.txt
Last active April 2, 2022 12:34
Solana devnet feature set
Feature | Status | Description
E3PHP7w8kB7np3CTQ1qQ2tW3KCtjRSXBQgW9vM2mWv2Y | active since slot 5414912 | secp256k1 program
E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv | active since slot 5414912 | spl-token multisig fix
GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu | active since slot 5414912 | deprecate unused rewards sysvar
4kpdyrcj5jS47CZb2oJGfVxjYbsMm2Kx97gFyZrxxwXz | active since slot 18144000 | no overflow rent distribution
4RWNif6C2WCNiKVW7otP4G7dkmkHGyKQWRpuZ1pxKU5m | active since slot 19008000 | pico inflation
GE7fRxmW46K6EmCD9AMZSbnaJ2e3LfqCZzdHi9hmYAgi | active since slot 25056000 | filter stake_delegation_accounts #14062
BzBBveUDymEYoYzcMWNQCx3cd4jQs7puaVFHLtsbB6fm | active since slot 34560000 | community vote allowing Certus One to enable full inflation
BL99GYhdjjcv6ys22C9wPgn2aTVERDbPHHo4NbS3hgp7 | active since slot 37152000 | spl-token self-transfer fix
3ccR6QpxGYsAbWyfevEtBNGfWV4xBffxRj2tD6A9i39F | active since slot 4147200
@krebernisak
krebernisak / CrossDomainForwarder.sol
Last active September 18, 2021 10:46
Proposal for L2 xDomain Forwarder (with and escape hatch for upgrades)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ConfirmedOwner.v2.sol";
import "./interfaces/ForwarderInterface.sol";
import "./vendor/openzeppelin-solidity/v4.3.1/contracts/utils/Address.sol";
/**
* @title CrossDomainForwarder - L1 xDomain account representation
* @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination.
@krebernisak
krebernisak / ArbitrumCrossDomain.sol
Created August 31, 2021 12:04
Testing L1 initiated L2 ETH withdrawal
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import "./ArbSys.sol";
import "./IInbox.sol";
/// @title ArbitrumCrossDomain test contract
contract ArbitrumCrossDomain {
/// @dev Precompiled contract that exists in every Arbitrum chain at address(100). Exposes a variety of system-level functionality.
@krebernisak
krebernisak / AccessControlledAggregator.json
Created July 23, 2021 13:01
Optimistic Etherscan contract verification issue (OVM solc 0.6.12)
{
"schemaVersion": "2.0.0",
"contractName": "AccessControlledAggregator",
"compilerOutput": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "implementation",
@krebernisak
krebernisak / README.md
Created January 19, 2021 19:40
Optimism OVM integration

Optimism OVM integration

The docs page, while a good resource, is currently out of date.

Solidity support

Solidity source code needs to be compiled using OVM modified solc compiler. Because of the way OVM is architectured, the Optimism team needs to work to support specific Solidity compiler versions. Currently supported are v0.5 & v0.6, while work is started on v0.7 & v0.8.

The JS compiler can be found in ethereum-optimism/solc-js repo. Branches of interest are master-0.5 & master-0.6.

pragma solidity ^0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/IERC20.sol";
contract LinkTokenOnMatic {
IERC20 public token;
@krebernisak
krebernisak / substrate-chainlink.state_getMetadata.json
Created June 3, 2020 17:56
Substrate Metadata response for a chain with a Chainlink pallet
@krebernisak
krebernisak / math_operations.js
Last active June 1, 2020 18:55
A function that accepts as an argument a string of addition/subtraction operations.
// Write a function that accepts as an argument a string of addition/subtraction operations.
// The function should return the result of the operations as an integer
// ex: calculate("1 - 2 + 3") => 2
// will not see: "1 - -2"
/**
* Solution:
* 1. Build a stack using Reverse Polish (Post-fix) notation
* 2. Build a stack machine that reads and executes Reverse Polish (Post-fix) notation
*

System design interview structured approach

Step 1 — Understand the Goals

Make sure you understand the basic requirements and ask clarification questions. Start with the most basic assumptions:

  • What is the goal of the system?
  • Who are the users of the system? What do they need it for? How are they going to use it?
  • What are the inputs and outputs of the system?