Skip to content

Instantly share code, notes, and snippets.

View UkemeSkywalker's full-sized avatar

Ukeme David Eseme UkemeSkywalker

View GitHub Profile
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: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Swapper{
struct Order{
address ofSwaper;
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./IERC20.sol";
contract swap{
IERC20 token;
@UkemeSkywalker
UkemeSkywalker / template.md
Created August 17, 2022 15:38 — forked from EnebeliEmmanuel/template.md
for reference

🏗 scaffold-eth | 🏰 BuidlGuidl

🚩 Challenge 3: Minimum Viable Exchange

This challenge will help you build/understand a simple decentralized exchange, with one token-pair (ERC20 BALLOONS ($BAL) and ETH). This repo is an updated version of the original tutorial and challenge repos before it. Please read the intro for a background on what we are building first!

❗️ NOTE: functions outlined within the DEXTemplate.sol are what works with the front end of this branch/repo. Also return variable names may need to be specified exactly as outlined within the Solutions/DEX.sol file. If you are confused, see solutions folder in this repo and/or cross reference with front-end code.

There is also a Youtube video that may help you understand the concepts covered within this challenge too:

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
error notEnoughLiquidity(uint256 requested, uint256 liquidity);
/**
import { ethers } from "hardhat";
async function main() {
//interact with uniswap swapTokenforExactToken function
//swap usdt to dai
//TO-DO
//erc20 token interface
//Approve the uniswap contract
//check balance of signer before swap
//swap token caling the function
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"
async function main() {
const _value = ethers.utils.parseEther("1");
"0x7A3E0DFf9B53fA0d3d1997903A48677399b22ce7",
"0x9ee15CF9EC4B3830bBedA501d85F5329Ea3C595C",
"0x9ee15CF9EC4B3830bBedA501d85F5329Ea3C595C",
"0x85f20a6924A61904AB44243C7e2c771B3bE46734",
"0x85f20a6924A61904AB44243C7e2c771B3bE46734",
"0x2DBdd859D9551b7d882e9f3801Dbb83b339bFFD7",
"0x88538EE7D25d41a0B823A7354Ea0f2F252AD0fAf",
"0x5D63564EeF4657F360343196A7bd86ae18d3a92A",
"0x12896191de42EF8388f2892Ab76b9a728189260A",
"0x924843c0c1105b542c7e637605f95F40FD07b4B0",
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
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
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"
async function main() {
let provider = {
PrivateKey: process.env.PRIVATE_KEY as BytesLike,