Skip to content

Instantly share code, notes, and snippets.

@froyobin
froyobin / task.md
Last active September 1, 2021 10:31

task

构建一个简单的网站,允许用户可以stake, waithdraw 他们的token。 可以不用考虑UI部分,只要有功能就行,网站css,排版都不重要,当然能做好一点排版是最好的。

为了简单,可以不考虑链接钱包插件或者和钱包插件的通信。 可以将用户的secret key 写死(hard code)在你的测试网站中。 如果有时间能做到和metamas等钱包的链接/调用,那是最好的。

主要功能如下:

  1. 用户可以stake他们的币到指定的合约中。
  2. 用户可以forcewithdraw他们的全部或者部分deposit。
./ethminer -U -P stratum1+tcp://0xeeDCBCB4009AD5989BC34e27a8b7c46D26572698.bintest@eth.2miners.com:2020
@froyobin
froyobin / monero tss test.go
Created February 11, 2021 04:16
monero tss test.go
package main
import (
"fmt"
"log"
set "github.com/deckarep/golang-set"
"gitlab.com/thorchain/tss/monero-wallet-rpc/wallet"
)
@froyobin
froyobin / ed25519.go
Created August 18, 2020 06:47
mnemonic to ed25519.go
package main
import (
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/binary"
"errors"
"fmt"
"math/big"
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"time"
package main
import (
"bytes"
"crypto/sha256"
"fmt"
"math"
"time"
)
package main
import (
"encoding/base64"
"flag"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/tendermint/libs/bech32"
"gitlab.com/thorchain/bepswap/thornode/cmd"
package main
import (
"fmt"
)
type testA struct {
a int
b []int
}
@froyobin
froyobin / tss.log
Created November 25, 2019 11:42
error log of Tss nodes
>>>>>>>>>>>>>>>>>node 1>>>>>>>>>>>>>>>>>>>>
{"level":"info","module":"tss","time":"2019-11-25T11:31:49Z","message":"is it possible it has finished?"}
{"level":"info","module":"tss","time":"2019-11-25T11:31:49Z","message":"{\"pub_key\":\"thorpub1addwnpep28r58g400v9jpp95t7huxh09qehttvcnvqsjfkhp9ep6q223az5sqxpy60z\",\"bnb_address\":\"bnb1ypqjc53cer57pa4v9w8vjft2gv20uzr0hga2mp\",\"status\":0}"}
{"level":"debug","module":"communication","time":"2019-11-25T11:32:25Z","message":"handle stream from peer: Qmeh5Ycjub11WmyYDsrTYmED4TeqXeFxwPKgu4n6yWPLNU"}
{"level":"debug","module":"communication","time":"2019-11-25T11:32:25Z","message":"reading from stream of peer: Qmeh5Ycjub11WmyYDsrTYmED4TeqXeFxwPKgu4n6yWPLNU"}
{"level":"info","module":"tss","time":"2019-11-25T11:32:25Z","message":"<<<<<<<<< inbound"}
{"level":"debug","module":"communication","time":"2019-11-25T11:32:35Z","message":"handle stream from peer: QmVCrmyym2Gx684q72EVXwhCgcej1VrFgacHCDYhYrr3m5"}
{"level":"debug","module":"communication","time":"2019-11-25T11
@froyobin
froyobin / keygen.go
Last active November 22, 2019 22:27
source code
package main
import (
"crypto/rand"
"fmt"
"github.com/binance-chain/tss-lib/ecdsa/keygen"
"github.com/binance-chain/tss-lib/common"
"github.com/binance-chain/tss-lib/tss"
"github.com/decred/dcrd/dcrec/secp256k1"
logging "github.com/ipfs/go-log"