Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./multisig.sol";
contract MultiSigFactory {
//a factory contract that create multiple clones of multisig.sol
//a function that create a new multisig
//an array that holds contract addresses created
//a function that calls the approve function in multisig.sol
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,
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
struct Data{
string name;
uint Id;
uint age;
string gender;
bool status;
}
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
//users stake usdt
//user get 20% APY CVIII as reward;
// tken ratio 1: 1
contract stakERC20 is Ownable {
@Falilah
Falilah / IUSDT.sol
Last active February 16, 2023 13:16
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface IUSDT {
function approve(address _spender, uint256 _value) external;
function balanceOf(address who) external view returns (uint256);
function allowance(address _owner, address _spender)
external
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface IToken {
function approve(address _spender, uint256 _value) external;
function balanceOf(address who) external view returns (uint256);
function allowance(address _owner, address _spender)
external
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {Test, console} from 'forge-std/Test.sol';
import {DePayForwarderV2} from '../contracts/DePayForwarderV2.sol';
import {DePayRouterV2} from '../contracts/DePayRouterV2.sol';
import {TestReceiver} from '../contracts/TestReceiver.sol';
import {IDePayRouterV2} from '../contracts/interfaces/IDePayRouterV2.sol';
import {Test, console} from 'forge-std/Test.sol';
import {DePayForwarderV2} from '../contracts/DePayForwarderV2.sol';
import {DePayRouterV2} from '../contracts/DePayRouterV2.sol';
import {TestReceiver} from '../contracts/TestReceiver.sol';
import {IDePayRouterV2} from '../contracts/interfaces/IDePayRouterV2.sol';
contract DePayRouterV2Test is Test {
DePayForwarderV2 public forwarder;
DePayRouterV2 public router;
/ SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {Test, console} from 'forge-std/Test.sol';
import {DePayForwarderV2} from '../contracts/DePayForwarderV2.sol';
import {DePayRouterV2} from '../contracts/DePayRouterV2.sol';
import {IDePayRouterV2} from '../contracts/interfaces/IDePayRouterV2.sol';
contract DePayRouterV2Test is Test {
DePayForwarderV2 public forwarder;
import { ethers } from 'hardhat'
async function main() {
const currentTimestampInSeconds = Math.round(Date.now() / 1000)
const unlockTime = currentTimestampInSeconds + 60
const lockedAmount = ethers.parseEther('0.001')
const lock = await ethers.deployContract('Lock', [unlockTime], {
value: lockedAmount,