This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
interface tokenRecipient { | |
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; | |
} | |
contract TokenERC20 { | |
// Public variables of the token | |
string public name; | |
string public symbol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clone the repo and install the dependencies | |
``` | |
git clone https://github.com/fuseio/fuse-bridge | |
cd fuse-bridge | |
git checkout feature/find-not-relayed-messages | |
cd fuse-bridge/native-to-erc20/oracle | |
npm install | |
``` | |
Fuse and Ethereum networks are connected via the bridge that relay messages from Fuse network to Ethereum. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stop the container | |
docker stop fuseoracle-initiate-change | |
# open the redis CLI | |
sudo docker-compose exec redis redis-cli | |
# check that the redis key is correct (should be not nil) | |
GET native-erc-initiate-change:lastProcessedBlock | |
# set to a new value. 5831273 is currently the last relayed block on Mainnet. | |
SET native-erc-initiate-change:lastProcessedBlock 5831273 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stop the container | |
docker stop fuseoracle-initiate-change | |
# open the redis CLI | |
sudo docker-compose exec redis redis-cli | |
# check that the redis key is correct (should be not nil) | |
GET native-erc-initiate-change:lastProcessedBlock | |
# set to a new value. 5831273 is currently the last relayed block on Mainnet. | |
SET native-erc-initiate-change:lastProcessedBlock 5831273 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#docker stop $CONTAINER_NAME | |
# open the redis CLI | |
sudo docker-compose exec redis redis-cli | |
# check the current blocknumber of the $CONRAINER_ID:lastProcessedBlock | |
GET $CONRAINER_ID:lastProcessedBlock | |
# set to a new value. 5831273 is the current last relayed block on Mainnet. | |
SET $CONRAINER_ID:lastProcessedBlock 5831273 | |
# close the redis CLI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { request } = require('graphql-request') | |
const axios = require('axios') | |
const getAccountCharacters = async accountName => { | |
var options = { | |
method: 'POST', | |
url: 'https://www.pathofexile.com/character-window/get-characters', | |
headers: { | |
authority: 'www.pathofexile.com', | |
accept: 'application/json, text/javascript, */*; q=0.01', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xD418c5d0c4a3D87a6c555B7aA41f13EF87485Ec6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getAddressString() | |
require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getPrivateKeyString() | |
for (let i = 0; i < 15; i++) { | |
console.log(`${i}: ${require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getAddressString()}`) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isArray = require('lodash/isArray') | |
const logsToEvents = (logs, contract) => { | |
if (isArray(logs)) { | |
const events = {} | |
logs.forEach((log, index) => { | |
log = contract.events.allEventsLogDecoder.decode(contract.abiModel, log) | |
if (log.event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Specify a directory for plugins | |
" - For Neovim: ~/.local/share/nvim/plugged | |
" - Avoid using standard Vim directory names like 'plugin' | |
set number | |
let g:typescript_indent_disable = 1 | |
call plug#begin('~/.vim/plugged') | |
Plug 'scrooloose/nerdtree' |
NewerOlder