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.7.0; | |
contract ERC1271 { | |
bytes4 constant internal MAGICVALUE = 0x1626ba7e; | |
function isValidSignature( | |
bytes32 _hash, | |
bytes memory _signature | |
) public view returns (bytes4 magicValue); | |
} |
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
// 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 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
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 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
#!/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 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
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 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
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 |
OlderNewer