This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://medium.com/pinata/how-to-build-substack-on-ipfs-a940a5caf812 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const util = require('ethereumjs-util') | |
| const Wallet = require('ethereumjs-wallet') | |
| var possible = 'abcdef1234567890' | |
| var basePrivateKey = '1cd3b30424316919712c48359829787eefa0d724a78274a506530dbb72' | |
| var charsMissing = 64 - basePrivateKey.length | |
| var targetPublicAddress = ' 0xe8Ca70C909905Ebbbe6a49c34797beF31d895241' | |
| var missingPart = ''; | |
| for (var i = 0; i < charsMissing; i++) { | |
| missingPart = missingPart.concat('f'); |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Note: For the actual contract source codes use the api endpoints at https://etherscan.io/apis#contracts | |
| "Txhash","ContractAddress","ContractName" | |
| "0x85da5f1e3d93f380674e2210416a552dd5520ec2785c16261f950e66c4321209","0x4b4701f3f827e1331fb22ff8e2beac24b17eb055","DISTX" | |
| "0xd9bfae78b0dc777897a0e99bef998f1a3e89317e4849c9379a9c7c6613ace799","0xf58f90cb329f812f6d7c5a7b14ffccacbe9c034e","CurveVestingAdapter" | |
| "0xacc4508639baad1b5d420948c1bca652df2f23e24af441d319b8f90ad4c1e15d","0xb2133d170b3bcab71358fc4eb2f95a384e5d328a","NexusStakingAdapter" | |
| "0xf663b37dc0d975b1cb5f3bf74f476553da87bbf5fbd1573a2ede00f6ed18d847","0x303baa149efc0b3b47136177f27637f2c491e457","WalletImpl" | |
| "0x18d1bff8ef51ffbbd388603b7550dc3de7ee99029569b65978bceb32b1f09778","0x8fd3d838ffceeb4ff4dd5b0221a99c3b1ddb9ac9","UniswapV2PriceOracle" | |
| "0xd4bf1b6d87efa8d80dbce498113e7439cd901779ff2e23903204ff7456be11b6","0x7f628bdabde2c6c4cfc57f3f7683cd6034054e3a","OfficialGuardian" | |
| "0xb2f9b7791021bca921f9ba9f3d9bc1513a637796fa8fe6de73b91c86f2585fef","0x035f99A18114621 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// @dev given a number get a slice of any bits, at certain offset | |
| /// @param _n a number to be sliced | |
| /// @param _nbits how many bits long is the new number | |
| /// @param _offset how many bits to skip | |
| function _sliceNumber(uint256 _n, uint256 _nbits, uint256 _offset) private pure returns (uint256) { | |
| // mask is made by shifting left an offset number of times | |
| uint256 mask = uint256((2**_nbits) - 1) << _offset; | |
| // AND n with mask, and trim to max of _nbits bits | |
| return uint256((_n & mask) >> _offset); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.2; | |
| contract ethernalSale { | |
| struct order { | |
| uint amount; | |
| address buyer; | |
| } | |
| mapping (uint => order) orderBook; | |
| mapping (address => uint) balanceOf; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import requests | |
| data = [] | |
| timestamp = 1530367200 # 2018-07-01 00:00 AEST | |
| for t in range(1530367200, 1530367200-365*24*60*60, -2001*60*60): | |
| data = requests.get( | |
| 'https://min-api.cryptocompare.com/data/histohour?fsym=BTC&tsym=AUD&toTs=%s&limit=%s' \ | |
| % (t, min(365*24-len(data), 2000)) | |
| ).json()['Data'] + data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: AGPL-3.0-or-later | |
| // The ABI encoder is necessary, but older Solidity versions should work | |
| pragma solidity ^0.7.0; | |
| pragma experimental ABIEncoderV2; | |
| // These definitions are taken from across multiple dydx contracts, and are | |
| // limited to just the bare minimum necessary to make flash loans work. | |
| library Types { | |
| enum AssetDenomination { Wei, Par } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| echo "waiting for the following arguments: username + max-page-number" | |
| exit 1 | |
| else | |
| name=$1 | |
| fi | |
| if [ -z "$2" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Call redeem based on a cToken amount | |
| const amount = web3.utils.toHex(cTokenBalance * 1e8); | |
| const redeemType = true; // true for `redeem` | |
| // Call redeemUnderlying based on an underlying amount | |
| // const amount = web3.utils.toHex(balanceOfUnderlying); | |
| // const redeemType = false; //false for `redeemUnderlying` | |
| // Retrieve your asset by exchanging cTokens | |
| console.log('Redeeming the cDAI for DAI...'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Mint some cDAI by sending DAI to the Compound Protocol | |
| console.log('MyContract is now minting cDAI...'); | |
| let supplyResult = await myContract.methods.supplyErc20ToCompound( | |
| daiMainNetAddress, | |
| compoundCDaiContractAddress, | |
| web3.utils.toHex(10e18) // 10 DAI to supply | |
| ).send({ | |
| from: myWalletAddress, | |
| gasLimit: web3.utils.toHex(5000000), // posted at compound.finance/developers#gas-costs | |
| gasPrice: web3.utils.toHex(20000000000), // use ethgasstation.info (mainnet only) |