Skip to content

Instantly share code, notes, and snippets.

View MayowaObisesan's full-sized avatar
😐
Focused...

Mayowa Obisesan MayowaObisesan

😐
Focused...
View GitHub Profile
pragma ...
contract StakingContract {
...
}
@MayowaObisesan
MayowaObisesan / IMultisig.sol
Last active September 8, 2023 13:36
This are the files needed to create and interact with a multisigFactory contract
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.19;
import {Transaction} from "../multisig.sol";
interface IMultisig {
function createTransaction(uint _amount, address _spender) external;
function getTransaction(uint id) external view returns (Transaction memory);
}
@MayowaObisesan
MayowaObisesan / airDropSim.sol
Created August 19, 2023 16:02
This is a basic solidity contract that simulates how airDrops work. i.e., only eligible addresses will get the token to be airdropped. This is a sim, not an actual implementation.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// Create a contract called token where you will specify the name of the token, the total number of token
// that can be in circulation and have an allowList for addresses that can get your token.
contract Token {
@MayowaObisesan
MayowaObisesan / usdc_details.ts
Last active August 10, 2023 19:11
This script fetches the USDC token details from the ethereum mainnet and returns: the total_supply, the name, the token symbol and the balance
/*
TODO:
Locate the address of USDC on ethereum mainnet,
1. Query the balance, the token decimal, the name, and the token symbol.
*/
/*
// 3 things are needed to interact with a Smart contract:
1. Address
2. ABI
@MayowaObisesan
MayowaObisesan / account_details.ts
Last active August 10, 2023 19:26
This script queries your ethereum account balance, transaction count and blockNumber on the ethereum mainnet, sepolia testnet and goerli testnet
// Mayowa Obisesan
// A script that queries an ethereum account balance, transaction count and blockNumber on ethereum's mainnet,
// sepolia and goerli testnet
import { ethers } from 'ethers';
const address: string = "0x298AAA9A0822eB8117F9ea24D28c897E83415440";
const accountDetails = async (networkType: string) => {
const provider = ethers.getDefaultProvider(networkType);
@MayowaObisesan
MayowaObisesan / account_type.js
Last active August 5, 2023 17:06
web3-weekone-assessment
import {ethers} from 'ethers';
const nodeProvider = "";
const getAccountType = (code) => {
const provider = ethers.getDefaultProvider(nodeProvider);
const code = provider.getCode(code);
return code;
}