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
blueprint: | |
name: Low Power Detection | |
description: > | |
Send a notification when low power is detected for a certain amount of time. | |
Useful for sending notifications when the washing machine or drying machine | |
is finished, for example. | |
domain: automation | |
input: | |
power_consumption: | |
name: Power Consumption |
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
blueprint: | |
name: Motion Light | |
description: > | |
Turn on a light when motion is detected, and the luminance in the room is | |
below the specified value. Keeps the light on for a specified amount of | |
time, before dimming it, and eventually turning it off. | |
domain: automation | |
input: | |
motion_sensor: | |
name: Motion Sensor |
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/env zsh | |
# To create an alias for the script, use: | |
# alias dev="source /path/to/dev.sh" | |
# | |
# Then you can use it as follows: | |
# dev user/repo | |
# dev https://github.com/user/repo | |
# dev https://github.com/user/repo/pull/123 |
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 type { ERC20 } from './erc-20'; | |
import type { InputTypeMap, OutputTypeMap, TypeMapper } from './types'; | |
/** | |
* This creates an interface with all ERC-20 functions, strictly typed with TypeScript types. It does not require any | |
* code generation or pre-formatting of the ERC-20 ABI, simply pass in the standard ERC-20 as type, and it will work. | |
* | |
* For example: | |
*/ | |
type ERC20Contract = Contract<ERC20>; |
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; | |
contract SignatureVerifier { | |
/** | |
* @notice Recovers the address for an ECDSA signature and message hash, note that the hash is automatically prefixed with "\x19Ethereum Signed Message:\n32" | |
* @return address The address that was used to sign the message | |
*/ | |
function recoverAddress (bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (address) { | |
bytes memory prefix = "\x19Ethereum Signed Message:\n32"; |
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
pragma solidity ^0.7.0; | |
contract ERC1271 { | |
bytes4 constant internal MAGICVALUE = 0x1626ba7e; | |
function isValidSignature( | |
bytes32 _hash, | |
bytes memory _signature | |
) public view returns (bytes4 magicValue); | |
} |
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
{ | |
"title": "Asset Metadata", | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"description": "Identifies the asset to which this NFT represents" | |
}, | |
"description": { | |
"type": "string", |
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
pragma solidity ^0.5.7; | |
interface ERC777TokensSender { | |
function tokensToSend( | |
address operator, | |
address from, | |
address to, | |
uint256 amount, | |
bytes calldata userData, | |
bytes calldata operatorData |
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
pragma solidity ^0.5.7; | |
interface ERC777TokensRecipient { | |
function tokensReceived( | |
address operator, | |
address from, | |
address to, | |
uint256 amount, | |
bytes calldata data, | |
bytes calldata operatorData |
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
pragma solidity ^0.5.7; | |
interface ERC777 { | |
function name() external view returns (string memory); | |
function symbol() external view returns (string memory); | |
function totalSupply() external view returns (uint256); | |
function granularity() external view returns (uint256); | |
function balanceOf(address owner) external view returns (uint256); | |
function send(address to, uint256 amount, bytes calldata data) external; |
NewerOlder