This file contains 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: MIT | |
pragma solidity 0.8.10; | |
import "https://github.com/aave/aave-v3-core/blob/master/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol"; | |
import "https://github.com/aave/aave-v3-core/blob/master/contracts/interfaces/IPoolAddressesProvider.sol"; | |
import "https://github.com/aave/aave-v3-core/blob/master/contracts/dependencies/openzeppelin/contracts/IERC20.sol"; | |
import "https://github.com/Synthetixio/synthetix/blob/develop/contracts/interfaces/ISynthetix.sol"; | |
import "https://github.com/Uniswap/v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol"; | |
contract SnxFlashLoan is FlashLoanSimpleReceiverBase { |
This file contains 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
select | |
replace(encode("marketKey", 'escape'), '\000', '') as market, | |
replace(encode("parameter", 'escape'), '\000', '') as setting, | |
( | |
array_agg( | |
value | |
order by | |
evt_block_time desc | |
) | |
) [1] / 1e18 as value, |
This file contains 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 Web3 = require('web3'); | |
const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io/v3/YOUR_API_KEY'); | |
const web3 = new Web3(provider); | |
// Generate a new Ethereum account | |
const account = web3.eth.accounts.create(); | |
console.log('Your Ethereum wallet address is:', account.address); | |
console.log('Your private key is:', account.privateKey); |
This file contains 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 fs = require('fs'); | |
const path = require('path'); | |
const axios = require('axios'); | |
const { table } = require('table'); | |
require('dotenv').config(); | |
const DEPLOYMENT_FILENAME = 'deployment.json'; | |
const NETWORK = 'mainnet'; |
This file contains 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 { ethers } = require("ethers"); | |
const { wei } = require("@synthetixio/wei"); | |
const { Solo, Networks } = require("@dydxprotocol/solo"); | |
require("dotenv").config(); | |
// Init DYDX Solo instance. | |
const solo = new Solo( | |
"http://YOUR_PROVIDER_URL", | |
Networks.MAINNET, |
This file contains 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: MIT | |
pragma solidity ^0.8.0; | |
/** | |
* @dev Interface of the ERC165 standard, as defined in the | |
* https://eips.ethereum.org/EIPS/eip-165[EIP]. | |
* | |
* Implementers can declare support of contract interfaces, which can then be | |
* queried by others ({ERC165Checker}). |
This file contains 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
// | |
// Function definition | |
// | |
class func saveCardInfo(id: String, completion: (NSDictionary?, NSError?) -> Void) -> NSURLSessionTask { | |
// Prepare the request parameters. | |
let email = form["email"] as! String | |
let cardNumber = form["card"] as! String | |
let expiration = form["expiration"] as! String | |
let cvc = form["cvc"] as! String |
This file contains 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
import UIKit | |
extension UIView { | |
func startRotating(duration: Double = 1.0) { | |
let kAnimationKey = "rotation" | |
if self.layer.animation(forKey: kAnimationKey) == nil { | |
let animate = CABasicAnimation(keyPath: "transform.rotation") | |
animate.duration = duration | |
animate.repeatCount = Float.infinity | |
animate.fromValue = 0.0 |
This file contains 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
for family: String in UIFont.familyNames | |
{ | |
print(family) | |
for names: String in UIFont.fontNames(forFamilyName: family) | |
{ | |
print("== \(names)") | |
} | |
} |
This file contains 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.0; | |
/* | |
Temporary Hash Registrar | |
======================== | |
This is a simplified version of a hash registrar. It is purporsefully limited: | |
names cannot be six letters or shorter, new auctions will stop after 4 years. |
NewerOlder