Skip to content

Instantly share code, notes, and snippets.

@kyriediculous
kyriediculous / contracts...Interfaces.sol
Created October 1, 2021 02:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.8+commit.dddeac2f.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IRoundsManager {
// Events
event NewRound(uint256 indexed round, bytes32 blockHash);
// Deprecated events
@kyriediculous
kyriediculous / [email protected]
Created October 1, 2021 02:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.8+commit.dddeac2f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@kyriediculous
kyriediculous / [email protected]
Created October 1, 2021 02:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.8+commit.dddeac2f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
{
"contractName": "Wallet",
"abi": [
{
"inputs": [
{
"name": "_master",
"type": "address"
}
],
'use strict'
const TestHarness = require('../src/index')
let th = new TestHarness()
th.run({
name: 'testnet', // specify unique config name here
discordUserId: null, // id of Discord user to send alert from Prometheus to (use `Copy ID` on profile to get)
// should be string
// listCmd represents the read command
var listCmd = &cobra.Command{
Use: "list",
Short: "List all blog posts",
RunE: func(cmd *cobra.Command, args []string) error {
// Create the request (this can be inline below too)
req := &blogpb.ListBlogsReq{}
// Call ListBlogs that returns a stream
stream, err := client.ListBlogs(context.Background(), req)
// Check for errors
var deleteCmd = &cobra.Command{
Use: "delete",
Short: "Delete a Blog post by its ID",
Long: `Delete a blog post by it's mongoDB Unique identifier.
If no blog post is found for the ID it will return a 'Not Found' error`,
RunE: func(cmd *cobra.Command, args []string) error {
id, err := cmd.Flags().GetString("id")
if err != nil {
return err
var updateCmd = &cobra.Command{
Use: "update",
Short: "Find a Blog post by its ID",
Long: `Find a blog post by it's mongoDB Unique identifier.
If no blog post is found for the ID it will return a 'Not Found' error`,
RunE: func(cmd *cobra.Command, args []string) error {
// Get the flags from CLI
id, err := cmd.Flags().GetString("id")
author, err := cmd.Flags().GetString("author")
var readCmd = &cobra.Command{
Use: "read",
Short: "Find a Blog post by its ID",
Long: `Find a blog post by it's mongoDB Unique identifier.
If no blog post is found for the ID it will return a 'Not Found' error`,
RunE: func(cmd *cobra.Command, args []string) error {
id, err := cmd.Flags().GetString("id")
if err != nil {
return err
func init() {
readCmd.Flags().StringP("id", "i", "", "The id of the blog")
readCmd.MarkFlagRequired("id")
rootCmd.AddCommand(readCmd)
}