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
using System.Collections; | |
using System.Numerics; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class ERC721BalanceOfExample : MonoBehaviour | |
{ | |
public GameObject insufficient; | |
async void Start() |
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
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 | |
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error | |
} |
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
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" | |
) |
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
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 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
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 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
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 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
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 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
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 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 './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 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
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" |
NewerOlder