Skip to content

Instantly share code, notes, and snippets.

@wesleyfsmith
wesleyfsmith / HedgeManger.sol
Last active June 28, 2023 18:23
SureFX v1 contract
//SPDX-License-Identifier:
pragma solidity 0.8.10;
import "hardhat/console.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
@wesleyfsmith
wesleyfsmith / MyFlickyNFT.sol
Last active June 15, 2022 18:51
Flickplay Contract
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "hardhat/console.sol";
contract MyFlickyNFT is ERC721A, Ownable, IERC2981 {
02000000014b42a8736587032be113337f154afbdfa88544d7b9e064f45a26cfd58249687200000000fd270100473044022036ef7c701c0ad841933164c6c004f8982bea8592017d714aec176b138748704a022001edcd0a94841a727ffd9b5a6c0188900b31bef5ee5ac1a9cfd5984aadf855cf01483045022100b2b1b6ef595734afadb12e4322f04173d4603c59f50d4e887ca9c59c8d63b36c022072b81a983864fad20a187e6ac2ee1f5fd3ff3092ded5f8f9615260b2d4fa1c9e01514c926352210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916e2103515c07520b1679ad67865a5d8e4d42c4bbe56e9daa42fe53bd161c0ac9e4aacc21032372aa111bf47cbfd64ab1f4b9714dafe8db01df9f9805467990bf69bb0ca54b53ae675ab275210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916eac680a000000018062ee010000000017a914a9974100aeee974a20cda9a2f545704a0ab54fdc8700000000
02000000012beb9467a3599aa5d7b22a6ee89a85adc5be1a4a1a5d5df9606631ff927aefdb00000000e5483045022100a6e95713548861c99a65d50d6b13d27421d0d83fb62e033e5e8bcaa7ca8fc07f02201bb671ee16b6c15dfd40728d984ecd44513bb536c3917f045bdacaefad23a6b301030bd513004c956352210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916e2103515c07520b1679ad67865a5d8e4d42c4bbe56e9daa42fe53bd161c0ac9e4aacc21032372aa111bf47cbfd64ab1f4b9714dafe8db01df9f9805467990bf69bb0ca54b53ae67030bd513b275210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916eac680bd5130001a8737a000000000017a914a9974100aeee974a20cda9a2f545704a0ab54fdc8700000000
02000000012beb9467a3599aa5d7b22a6ee89a85adc5be1a4a1a5d5df9606631ff927aefdb00000000e100473044022013fa87e2733d8b2216113df1bf4e76d05eeb732cfd8486c4cfc49a0b106be49b02205b35598ac11a22035746245481379df24f1bc4956c4ef23915559a9ff7c5ef3b01004c956352210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916e2103515c07520b1679ad67865a5d8e4d42c4bbe56e9daa42fe53bd161c0ac9e4aacc21032372aa111bf47cbfd64ab1f4b9714dafe8db01df9f9805467990bf69bb0ca54b53ae67030bd513b275210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916eac68ffffffff01a8737a000000000017a914a9974100aeee974a20cda9a2f545704a0ab54fdc8701000000
var hashType = bitcoin.Transaction.SIGHASH_ALL;
var signatureHash = tx.hashForSignature(0, redeemScript, hashType);
console.log('Sig hash: ', signatureHash.toString('hex'));
const redeemScriptSig = bitcoin.script.scriptHash.input.encode([
seller.sign(signatureHash).toScriptSignature(hashType),
buyer.sign(signatureHash).toScriptSignature(hashType),
bitcoin.opcodes.OP_FLASE
], redeemScript)
64fa73f93e2660ea0a52eaf793b272d92624af74c8341cdd57ddad3961f8494f
01000000018afc335f782a5bcc907f274d9fff16656b9ab2eb13b82d5afb46e9866cf2ba0700000000fd2a01483045022100f47a42a2ecd998128adc4159c312552707dbcf0ff883c6fec65821d218e6f77302206e9b9d601443a59acb8b0129d2f8fe365ee7cd82631c42e03e80cf4a293dd1fb01473044022023e297732b6ede62c770b9675ab9c04e1c861aabe6bb2569e8f0857fa480d6bd022024cab55137dbbef3031d587b24974e10c0ce52abb9aa944803266370ef1cbb3001004c966352210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916e2103515c07520b1679ad67865a5d8e4d42c4bbe56e9daa42fe53bd161c0ac9e4aacc21032372aa111bf47cbfd64ab1f4b9714dafe8db01df9f9805467990bf69bb0ca54b53ae6704a954ee5ab275210293446c54a24a865a2f663a35ac21f6872e45aae8980fce121ac95e9c4224916eac68ffffffff01043906000000000017a914a9974100aeee974a20cda9a2f545704a0ab54fdc870b02ed5a
@wesleyfsmith
wesleyfsmith / css_resources.md
Created March 5, 2014 22:16 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@wesleyfsmith
wesleyfsmith / javascript_resources.md
Created March 5, 2014 22:16 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage