Skip to content

Instantly share code, notes, and snippets.

View aesedepece's full-sized avatar
🦾
Building!

Adán SDPC // asdpc.eth aesedepece

🦾
Building!
View GitHub Profile
### Keybase proof
I hereby claim:
* I am aesedepece on github.
* I am adansdpc (https://keybase.io/adansdpc) on keybase.
* I have a public key ASAfEB51Bdz3wr9JBigahMsauaTwDndd9-epmHFcSmrYoQo
To claim this, I am signing this object:
0x7c3D5B476dBe5592dC71533E31cf635740e72394
0xaf59127c395d71af0736ec48a0bc1eadc704a460
0x7F4635Fa1CA8C967Dc22E92F2c73f2CddC42b434
0x14134469FC42421C61FC1411e3bEBbb4A0F49d41
0x38fdb15a87de55804e8c78f1e7538852b88f4053
@aesedepece
aesedepece / kvSwap.ts
Last active June 13, 2018 14:11
Safely reverting keys and values in a JS object
const enum ChainType {
test,
main
}
const prefixToChainType: stringToNumber = {
"wit": ChainType.main,
"twit": ChainType.test
}
const types: {[key: string]: string} = {
Object: "Object",
String: "String",
Float: "Float"
}
const ops: {[key: string]: string} = {
parseJSON: "parseJSON",
get: "get",
asFloat: "asFloat"
@aesedepece
aesedepece / witnet-docker-resync.sh
Created March 27, 2020 12:18
Quick and dirty script for wiping the local chain and resynchronizing a Witnet node running on Docker (see comments)
#!/bin/bash
# If your Docker container is named differently, change it here
CONTAINER="witnet_node"
# If your Witnet storage path is not the default, change it here
STORAGE_PATH="/home/$USER/.witnet"
echo "[ Trying to wipe local chain and resync ]";
echo "1. Making sure the node is running..."
docker start $CONTAINER;
@aesedepece
aesedepece / witnet-bitcoin-price-feed-example.sol
Last active December 20, 2021 14:12
Witnet example: read Bitcoin price from Witnet price feed on Ethereum Rinkeby
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.9.0;
import "witnet-solidity-bridge/contracts/interfaces/IWitnetPriceFeed.sol";
contract MyContract {
function readBitcoinPriceFromWitnetPriceFeed() external view returns(int256) {
// The address below shall be different for each price feed and blockchain
IWitnetPriceFeed IWitnetPriceFeed = IERC2362(address("0xccAe308C9b91a3e3De8E0Dd4136Ce0Bb608e6ea4"));