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 the required libraries | |
import pandas as pd | |
import numpy as np | |
import requests | |
import re | |
import csv | |
import itertools | |
BEARER_TOKEN = "Bearer Token" |
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
from collections import defaultdict | |
from test_framework.blocktools import (create_block, create_coinbase) | |
from test_framework.messages import CInv, MSG_BLOCK | |
from test_framework.p2p import ( | |
P2PInterface, | |
msg_block, | |
msg_getdata, | |
p2p_lock, | |
) |
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 ethers = require("ethers"); | |
const { parseUnits } = require("@ethersproject/units"); | |
const provider = new ethers.providers.JsonRpcProvider(`https://rinkeby.infura.io/v3/id`); | |
const encode = require('./byteEncoder'); | |
const abi = require('./getABI.js'); | |
let nonce; | |
(async () => { | |
const etherscanApiKey = "" | |
const contractAddress = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88" |
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 './App.css'; | |
import { useState } from 'react'; | |
import { providers, ethers } from 'ethers'; | |
import detectEthereumProvider from '@metamask/detect-provider'; | |
import { SwapWidget } from '@uniswap/widgets'; | |
const infuraId = process.env.REACT_APP_INFURA_ID; | |
const jsonRpcEndpoint = `https://mainnet.infura.io/v3/${infuraId}`; | |
const jsonRpcProvider = new providers.JsonRpcProvider(jsonRpcEndpoint); | |
const provider = new ethers.providers.Web3Provider(jsonRpcProvider); |
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 { ethers } = require('ethers'); | |
require('dotenv').config() | |
const abi = require('./abi.json') | |
const contractAddress = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88" | |
const signer = new ethers.Wallet( | |
process.env.PRIVATE_KEY, | |
ethers.getDefaultProvider('mainnet') | |
); |
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
package keeper | |
import ( | |
"context" | |
"github.com/cosmonaut/gofundme/x/gofundme/types" | |
sdk "github.com/cosmos/cosmos-sdk/types" | |
) | |
func (k msgServer) CreateGofundme(goCtx context.Context, msg *types.MsgCreateGofundme) (*types.MsgCreateGofundmeResponse, error) { | |
ctx := sdk.UnwrapSDKContext(goCtx) | |
// Start a gofundme with the following user inputs |
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
func (msg *MsgCreateGofundme) ValidateBasic() error { | |
// Validate the creator | |
_, err := sdk.AccAddressFromBech32(msg.Creator) | |
if err != nil { | |
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) | |
} | |
// Get the goal amount | |
goal := sdk.NewIntFromUint64(msg.Goal) | |
// Ensure that the goal amount is greater than 0 | |
if goal.IsZero() { |
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
package keeper | |
import ( | |
"context" | |
"github.com/cosmonaut/gofundme/x/gofundme/types" | |
sdk "github.com/cosmos/cosmos-sdk/types" | |
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | |
) | |
func (k msgServer) DonateFund(goCtx context.Context, msg *types.MsgDonateFund) (*types.MsgDonateFundResponse, error) { |
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
type BankKeeper interface { | |
SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins | |
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error | |
} |
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
package keeper | |
import ( | |
"context" | |
"fmt" | |
"strconv" | |
"github.com/cosmonaut/gofundme/x/gofundme/types" | |
sdk "github.com/cosmos/cosmos-sdk/types" | |
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | |
) |
OlderNewer