Skip to content

Instantly share code, notes, and snippets.

require("dotenv").config({ path: ".env" });
import { BytesLike } from "ethers";
import { ethers } from "hardhat";
// import * as dotenv from "dotenv";
// import IMultiSig from "../typechain-types/Imultisig.sol"
// deployed contract address = 0x6e828b59fc799b6ef92e42d2f39e438a7477f469
async function main() {
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract MultiSig {
///A contract that allows 70% of validSigner to Approve before a withdrawal can be succesful
address[] validSigner;
uint256 ID = 1;
uint256 public Quorum = 3;
//maping of trnsaction Id to number of approval to status
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Swapper{
struct Order{
address ofSwaper;
@Jesserc
Jesserc / demo.js
Created September 6, 2022 16:00 — forked from okeken/JS File
let animal = {
name:"cat",
type:"mammal",
color:"black",
class:'carnivorous',
gender:'female',
legs:{
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-ethers");
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
@Jesserc
Jesserc / axios.js
Created October 31, 2022 22:31 — forked from apow2/axios.js
use axios to get data from IPFS
import axios from "axios";
let myContract;
let init = async () => {
await ethStore.setProvider("https://api.avax-test.network/ext/bc/C/rpc");
await ethStore.setBrowserProvider();
let contract = await new $web3.eth.Contract(abi, contractAddress);
if ($chainId != 43113) {
alert("Warning: You are not connected to Avalanche Fuji test-net!");
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract rejectContracts {
function isContract(address account) public view returns (bool) {
 uint256 size;
 assembly {
 size := extcodesize(account)
 }
 return size > 0;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract rejectContracts {
function isContract(address account) public view returns (bool) {
 uint256 size;
 assembly {
 size := extcodesize(account)
 }
 return size > 0;
 }
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract Bidder {
 uint256 highestBid;
 address currentHighestBidder;
function bid() external payable {
 require(msg.value > highestBid, "Bid higher");
 require(payable(currentHighestBidder).transfer(highestBid)); // ensure the bid is sent back, else revert the transaction
 highestBid = msg.value;
 currentHighestBidder = msg.sender;
contract BidderTwo {
 uint256 highestBid;
 address currentHighestBidder;
 mapping(address => uint) bidBalances;
function bid() external payable {
 require(msg.value > highestBid, "Bid higher");
 bidBalances[msg.sender] += msg.value;
 highestBid = msg.value;
 currentHighestBidder = msg.sender;
 }