Skip to content

Instantly share code, notes, and snippets.

View moodmosaic's full-sized avatar

Nikos Baxevanis moodmosaic

View GitHub Profile
@obycode
obycode / bootup.md
Last active March 8, 2024 14:12
Epoch 3 testnet boot up
  1. The stacks-node mines blocks up to epoch 2.5 height at which point, pox-4 is deployed (along with other new boot contracts)
  • Look for:
    Applying epoch transition, new_epoch_id: 2.5, old_epoch_id: 2.4
    
  • Note: This happens during reward cycle 6 with the default test config (20 block cycles with 5 block prepare phases)
  1. Before the prepare phase starts, stackers must successfully call stack-stx
  • Look for something similar to:
    Contract-call successfully processed, txid: adc91171be4f7edb614f80d3707f75f3cc29650f88ff791133f55ebd71e24108, origin: STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP, origin_nonce: 0, contract_name: ST000000000000000000002AMW42H.pox-4, function_name: stack-stx, function_args: [u1000080000000000, (tuple (hashbytes 0x31ef5ee9a226a792b93f2bfbfbc54f523eba7818) (version 0x00)), u109, u2, (some 0x331cb6e41dcb335f6851bb42e6dc39816ad4a2fe3bda4c8836f43e51fec9c2e401a35ef7b676af27214716ce8e22e57fdc60b1a29f087b031a6486e2989d5fcc01), 0x038e3c4529395611be9abf6fa3b6
    
@cryptoscopia
cryptoscopia / dydxFlashLoanTemplate.sol
Created October 21, 2020 06:42
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }
@owickstrom
owickstrom / HiggledyHedgehog.hs
Created July 1, 2019 19:37
Defining overridable default generators for Hedgehog using Higgledy
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeApplications #-}
module HiggledyHedgehog where
import Control.Lens
import Data.Generic.HKD
import GHC.Generics (Generic)
import Hedgehog