Skip to content

Instantly share code, notes, and snippets.

View ilovelili's full-sized avatar
🏠
Working from home

min ju ilovelili

🏠
Working from home
View GitHub Profile
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "attach",
"name": "Attach",
"pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes
},
{
[
{
"constant":true,
"inputs":[
{
"name":"",
"type":"address"
}
],
"name":"owners",
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "@studydefi/money-legos/dydx/contracts/DydxFlashloanBase.sol";
import "@studydefi/money-legos/dydx/contracts/ICallee.sol";
import {KyberNetworkProxy as IKyberNetworkProxy} from "@studydefi/money-legos/kyber/contracts/KyberNetworkProxy.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IUniswapV2Router02.sol";
import "./IWeth.sol";
require("dotenv").config();
const Web3 = require("web3");
const Flashloan = require("../build/contracts/TestableFlashloan.json");
const DaiFaucet = require("../build/contracts/DaiFaucet.json");
const VaultManager = require("../build/contracts/VaultManager.json");
const abis = require("../abis");
const {mainnet: addresses} = require("../addresses");
pragma solidity ^0.4.10;
// Enables event logging of the format `console.log('descriptive string', variable)`,
// without having to worry about the variable type (as long as an event has been declared for that type in the
// Console contract.
contract Console {
event LogUint(string, uint);
function log(string s , uint x) {
LogUint(s, x);
@ilovelili
ilovelili / git-clear-history.sh
Created August 9, 2020 07:03
git clear history
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@ilovelili
ilovelili / storage vs memory
Created August 30, 2020 12:33
solidity storage vs memory
// SPDX-License-Identifier: ISC
pragma solidity ^0.7.0;
contract Storage {
struct Test {
uint256 id;
uint256 count;
}
uint256 public storageId;
@ilovelili
ilovelili / kaka
Created September 25, 2020 14:23
const c = (x) => console.log(x);
// Declare a variable named challenge and assign it to an initial value '30 Days Of JavaScript'
let cha = "30 Days Of JavaScript";
// What is the character code of J in '30 Days Of JavaScript' string using charCodeAt()
const index = cha.indexOf("J");
c(cha.charCodeAt(index));
<html>
<head>
<title>kaka learns JS</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<style>
span {
color: purple;
}
</style>
</head>
<html>
<body>
<script>
function leapYear(year) {
return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}
function checkDaysinMonth(month) {
const year = new Date().getFullYear();