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.7.0 <0.9.0; | |
import "witnet-solidity-bridge/contracts/interfaces/IWitnetRNG.sol"; | |
contract MyContract { | |
bytes32 public randomness; | |
uint256 public latestRandomizingBlock; | |
IWitnetRNG witnet; |
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.7.0 <0.9.0; | |
import "witnet-solidity-bridge/contracts/interfaces/IWitnetRNG.sol"; | |
contract MyContract { | |
uint32 public randomness; | |
uint256 public latestRandomizingBlock; | |
IWitnetRNG witnet; |
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.7.0 <0.9.0; | |
import "witnet-solidity-bridge/contracts/interfaces/IWitnetRNG.sol"; | |
contract DieContract { | |
uint32 sides; | |
struct Guess { | |
uint32 guessedNumber; |
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.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")); |
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
#!/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; |
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 types: {[key: string]: string} = { | |
Object: "Object", | |
String: "String", | |
Float: "Float" | |
} | |
const ops: {[key: string]: string} = { | |
parseJSON: "parseJSON", | |
get: "get", | |
asFloat: "asFloat" |
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 enum ChainType { | |
test, | |
main | |
} | |
const prefixToChainType: stringToNumber = { | |
"wit": ChainType.main, | |
"twit": ChainType.test | |
} |
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
0x38fdb15a87de55804e8c78f1e7538852b88f4053 |
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
0x14134469FC42421C61FC1411e3bEBbb4A0F49d41 |
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
0x7F4635Fa1CA8C967Dc22E92F2c73f2CddC42b434 |
NewerOlder