Skip to content

Instantly share code, notes, and snippets.

View baierjak's full-sized avatar

Jakub Baierl baierjak

View GitHub Profile
import random
my_list = [1, 'a', 32, 'c', 'd', 31]
print(random.choice(my_list))
import { useEthers, useEtherBalance } from '@usedapp/core';
import { formatEther } from '@ethersproject/units';
const { activateBrowserWallet, account } = useEthers();
const etherBalance = useEtherBalance(account);
<p>{parseFloat(formatEther(etherBalance)).toFixed(2)} ETH</p>
import { useContractCall, useContractFunction } from '@usedapp/core';
import { Contract } from '@ethersproject/contracts';
import { ethers } from 'ethers';
import simpleContractAbi from './ABI.json'; // JSON defined interface of methods
// smart contract deployed address
export const simpleContractAddress = '0xa788C207749F123bE722720b6629F6Ac52A1b8C9';
const simpleContractInterface = new ethers.utils.Interface(simpleContractAbi);
import { FC } from 'react';
import { useEthers, useEtherBalance, useContractCall, useContractFunction } from '@usedapp/core';
import { formatEther } from '@ethersproject/units';
import { Contract } from '@ethersproject/contracts';
import { ethers } from 'ethers';
// ABI definition of custom methods in JSON syntax
import simpleContractAbi from './ABI.json';
// smart contract deployed address
import { useContractCall, useContractFunction } from '@usedapp/core';
import { Contract } from '@ethersproject/contracts';
import { ethers } from 'ethers';
import simpleContractAbi from './ABI.json'; // JSON defined interface of methods
export const simpleContractAddress = '0xa788C207749F123bE722720b6629F6Ac52A1b8C9';
const simpleContractInterface = new ethers.utils.Interface(simpleContractAbi);
// RPC call - reading interaction
@baierjak
baierjak / main.tsx
Created December 15, 2021 14:56
Web3 blog
import { DAppProvider } from '@usedapp/core'
return (
<DAppProvider config={{}}>
<App />
</DAppProvider>
)