Skip to content

Instantly share code, notes, and snippets.

{
name: 'EOS Knights',
description: 'EOS Knights is the first game on EOS blockchain. You can play the most interactive RPG on any blockchain with EOS Knights',
shortDescription: 'EOS Knights is the most interactive RPG on any blockchain and the first game on EOS.',
symbol: '',
partner: true,
accounts: [
'eosknightsio'
],
logo: 'https://eosknights.io/img/icon.png',
@jafri
jafri / Transfers.json
Last active February 22, 2019 11:11
EOS Transfers
[
{
"from":"gm3dcnqgenes",
"to":"newdexmobapp",
"symbol":"EOS",
"chain":"EOS",
"quantity":20923955356,
"count":3
},
{
@jafri
jafri / votedecay.js
Created February 6, 2019 06:17
Vote Decay
async calculateVoteDecay () {
let stake = this.voterInfo.staked
let parsedStake = (stake / 10000).toFixed(4)
let lastVoteWeight = Number(this.voterInfo.last_vote_weight)
let block_timestamp_epoch = 946684800
let unixCurrentTime = moment().unix()
let doubleWeight = parseInt((unixCurrentTime - block_timestamp_epoch) / (24 * 60 * 60 * 7)) * parseFloat(1 / 52)
var ed25519 = require('ed25519');
var jwt = require('jsonwebtoken-ed25519')
let secret = 'CNC8888888888888888888888888888888888888888888888888888888888888'
let payload = '{"key":"cnc6666666666666", "iat":1599999999}';
console.log(jwt.sign(payload, Buffer.from(secret), { algorithm: 'Ed25519'}))
@jafri
jafri / lynx.js
Created January 7, 2019 00:10
Lynx Integration
export const state = () => ({
})
export const actions = {
async CONNECT_LYNX ({ dispatch }) {
window.addEventListener('lynxMobileLoaded', function () {
dispatch('GET_LYNX')
})
},
@jafri
jafri / dex.vue
Created December 25, 2018 03:52
dex
<template>
<iframe src="https://iframe.findex.pro?projectname=bloksio" :style="`height: ${iframeHeight}px;`"/>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'DEX',
@jafri
jafri / patch.md
Created December 13, 2018 11:09
Exploit Path

The gist of the exploit change for developers is:

When you call an inline_action or a deferred_tx from contract Y to contract X with permission X@A, ensure that X@A has Y@eosio.code set to satisfy permission

Example

Calling therealkarma::transfer from therealkarma::issue with permission therealkarma@active, therealkarma@active must be satisfied by therealkarma@eosio.code

@jafri
jafri / bloks.js
Created December 6, 2018 18:09
Bloks Provider
import B1AuthUser from './b1/B1AuthUser.js'
export default {
namespaced: true,
state: {
user: null,
manifest: require('../../../constants/b1/chain-manifests.json')
},
@jafri
jafri / lynx.js
Created December 6, 2018 15:45
Lynx
export default {
namespaced: true,
state: {
},
actions: {
async CONNECT_LYNX ({ dispatch }) {
window.addEventListener('lynxMobileLoaded', function () {
@jafri
jafri / dex.vue
Created November 5, 2018 18:22
DEX
<template>
<iframe src="https://bloksiframe.findex.pro/" :style="`height: ${iframeHeight}px;`"/>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'DEX',