Skip to content

Instantly share code, notes, and snippets.

@rainydio
rainydio / log
Created May 27, 2020 13:48
ark node14
~/w/ark-core!$ nodenv global 14.3.0
~/w/ark-core $ rm -rf node_modules/; and yarn; and yarn build
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
@rainydio
rainydio / f.html
Last active December 23, 2019 18:39
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
#lines {
position: fixed;
top: 0;
left: 0;
white-space: pre;
@rainydio
rainydio / states.ts
Last active November 19, 2019 21:16
import { createAction, getType, ActionType } from "typesafe-actions";
import { runSaga, stdChannel } from "redux-saga";
import { fork, put, takeEvery, select } from "redux-saga/effects";
const setWalletAttribute = createAction("STATE/SET_WALLET_ATTRIBUTE",
(address: string, attr: string, value: any) => ({ address, attr, value }),
)();
type StateAction = ActionType<typeof setWalletAttribute>;
"TonUtil.fif" include
"015f364a-msg-init.boc" file>B B>boc
<s 7 u@+ nip 8 i@+ 256 u@
2dup 7 smca>$ type cr
<b b{1000100} s, -rot addr, 0 Gram, b{00} s, <b b> <s s, b>
2 boc+>B "015f364a-msg-drain.boc" B>file
"015f364a-msg-init.boc" file>B B>boc
@rainydio
rainydio / Wallet3.fif
Created October 21, 2019 02:06
Rather simple 2/3 multi-sig wallet. Intended to be used by a single person.
"Asm.fif" include
"TonUtil.fif" include
16 @Sreg s16
-1 constant MSG_TYPE_EXTERNAL
101 constant EXT_MSG_ORDER
100 constant EXT_MSG_ORDER_CANCEL
"Asm.fif" include
"TonUtil.fif" include
<{
DUP -1 INT EQUAL <{
2DROP
PUSHROOT CTOS 32 PLDU
DUP 5 INT LEQ <{
ACCEPT
}> PUSHCONT IF
// No exception should be thrown handling external message after it was accepted.
//
// Throwing exception reverts contract state, including replay protection
// mechanisms (such as seqno). It's trivial to spot external message that
// raised exception. That message then can be replayed as many times as one
// would like draining contract out of funds.
//
// Due to limited resources available it might be impossible to perform
// all neccessary actions until message is accepted. This particular problem
// was discussed in paper. And suggested approach is to use external message
"Asm.fif" include
0 constant OK
34 constant ERR_SIGNATURE_INVALID
35 constant ERR_SIGNATURE_KEY_INVALID
36 constant ERR_SIGNATURE_PROOF_INVALID
37 constant ERR_SIGNATURE_MISSING
38 constant ERR_SIGNATURE_REPLAY
40 constant ERR_ORDER_NOT_FOUND
41 constant ERR_ORDER_EXPIRED
@rainydio
rainydio / init.coffee
Last active January 28, 2016 09:43
Hide tree view when entering full screen mode
do () ->
restoreTreeView = false
hasTreeView = () ->
return document.getElementsByClassName "tree-view"
.length isnt 0
atom.commands.onDidDispatch (e) ->
if e.type is "window:toggle-full-screen"
if atom.isFullScreen()