This file contains 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
import 'dart:io' | |
show RawDatagramSocket, RawSocketEvent, InternetAddress, Datagram; | |
import 'dart:convert' show utf8; | |
main() => | |
// UDP server | |
RawDatagramSocket.bind(InternetAddress.anyIPv4, 8000) | |
.then((datagramSocket) { | |
datagramSocket.readEventsEnabled = true; | |
datagramSocket.listen((RawSocketEvent event) { |
This file contains 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
import 'dart:io' | |
show RawDatagramSocket, RawSocketEvent, InternetAddress, Datagram; | |
import 'dart:convert' show utf8; | |
main() => | |
// UDP client | |
RawDatagramSocket.bind(InternetAddress.anyIPv4, 0).then((datagramSocket) { | |
datagramSocket.broadcastEnabled = true; | |
datagramSocket.readEventsEnabled = true; | |
datagramSocket.listen((RawSocketEvent event) { |
This file contains 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
#!/usr/bin/python3 | |
from requests import get | |
from sys import argv | |
from json import dump | |
from os.path import dirname, abspath, join | |
from urllib.parse import urljoin | |
from dateutil.parser import parse | |
from itertools import chain | |
from functools import reduce |
This file contains 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
#!/usr/bin/python3 | |
''' | |
Strictly use python version >=3.7.0, because script uses type hinting | |
Note that : This script doesn't work on Windows/ Mac i.e. notification | |
service will work only on Linux, having dependeny on `notify-send` program; | |
though extraction of battery status ( from router management portal ) | |
can be done by this script on any platfrom, given that machine is | |
connected to JioFi router ( tested to be working on JioFi 3 ) |
This file contains 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
*.sol linguist-language=Solidity |
This file contains 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
// File: contracts/child/ChildToken/ChildERC20.sol | |
pragma solidity 0.6.6; | |
contract ChildERC20 is | |
ERC20, | |
IChildToken, | |
AccessControlMixin, | |
NativeMetaTransaction, | |
ChainConstants, |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.0; | |
contract Decoder { | |
bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); | |
bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); | |
enum SyncType {Deposit, TokenMapping, Unsupported} |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract DecodeCheckpointSignerList { | |
// Slice specified number of bytes from arbitrary length byte array, starting from certain index | |
function slice(bytes memory payload, uint256 start, uint256 length) internal pure returns (bytes memory) { | |
require(length + 31 >= length, "slice_overflow"); |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
// Here's v1 of this contract : https://gist.github.com/itzmeanjan/5b7c6e973bc0785018cce100ee68fee7 | |
// | |
// 👆 used for decoding checkpoint submission data previously, after recent change in the way | |
// checkpoints are to be submitted to Ethereum, 👇 is supposed to be used | |
// | |
// Call `decode` pure function with `txInput` of `submitHeaderBlock(bytes data, uint256[3][] sigs)` tx |
This file contains 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 { ApiPromise, WsProvider, Keyring } = require('@polkadot/api') | |
const { Buffer } = require('buffer') | |
const { createWriteStream } = require('fs') | |
const BATCH = process.env.BATCH || 100 // these many tx(s) to be attempted to be submitted | |
const PAYLOAD = process.env.PAYLOAD || 512 // in terms of bytes | |
const WSURL = process.env.WSURL || 'ws://localhost:9944' | |
// To be initialized, after `setUp` is called | |
let handle |
OlderNewer