Skip to content

Instantly share code, notes, and snippets.

View pynchmeister's full-sized avatar
📚
Designing the Future of Education

Etch pynchmeister

📚
Designing the Future of Education
View GitHub Profile
@pynchmeister
pynchmeister / MiniZapDirectorV2.sol
Created March 30, 2022 20:31
Solidity contract to accompany failing test (revert 0x32)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
pragma experimental ABIEncoderV2;
import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol";
import "@boringcrypto/boring-solidity/contracts/BoringBatchable.sol";
import "@boringcrypto/boring-solidity/contracts/BoringOwnable.sol";
import "./libraries/SignedSafeMath.sol";
import "contracts/interfaces/IRewarder.sol";
@pynchmeister
pynchmeister / MiniZapDirectorV2.test.ts
Created March 30, 2022 20:29
reverted with panic code 0x32 (Array accessed at an out-of-bounds or negative index)
import { ADDRESS_ZERO, advanceBlock, advanceBlockTo, advanceTime, advanceTimeAndBlock, deploy, getBigNumber, prepare } from "./utilities"
import { assert, expect } from "chai"
import { ethers } from "hardhat"
const { BigNumber } = require("ethers")
describe("MiniZapDirectorV2", function () {
before(async function () {
await prepare(this, ["MiniZapDirectorV2", "GZapToken", "ERC20Mock", "RewarderMock", "RewarderBrokenMock"])
@pynchmeister
pynchmeister / ZapDirector.test.ts
Created March 28, 2022 19:42
Stack Exchange Arithmetic Overflow/Underflow Error Raw Test
import { ethers } from "hardhat";
import { expect } from "chai";
import { advanceBlockTo } from "./utilities"
describe("ZapDirector", function () {
before(async function () {
this.signers = await ethers.getSigners()
this.alice = this.signers[0]
this.bob = this.signers[1]
@pynchmeister
pynchmeister / ZapDirector.sol
Created March 28, 2022 19:41
Stack Exchange Arithmetic Overflow/Underflow Error
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./GZapToken.sol";
@pynchmeister
pynchmeister / VestedERC20Factory.sol
Created March 22, 2022 22:21
vested tokens factory
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.11;
import {ClonesWithImmutableArgs} from "./ClonesWithImmutableArgs.sol";
import {ERC20} from "./lib/ERC20.sol";
import {VestedERC20} from "./VestedERC20.sol";
/// @title VestedERC20Factory
@pynchmeister
pynchmeister / GovernorBravoDelegatorFlattened.sol
Created March 21, 2022 21:03
Flattened version of COMP's GovernorBravoDelegator
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./GovernorBravoInterfaces.sol";
contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents {
constructor(
address timelock_,
address comp_,
address admin_,
@pynchmeister
pynchmeister / public-stun-list.txt
Created June 13, 2019 04:16 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@pynchmeister
pynchmeister / dwrtcPeerError
Last active May 25, 2019 20:55
Javascript Console Logs of DWRTC Demo Errors with Peer
Browser(s) in use: Chrome on both ends:
Follows is the console log of the host:
Failed to load resource: net::ERR_CERT_DATE_INVALID
simplepeer-9.0.0.min.js:1 Uncaught Error: Ice connection failed.
at u._onIceStateChange (simplepeer-9.0.0.min.js:1)
at RTCPeerConnection.t._pc.oniceconnectionstatechange (simplepeer-9.0.0.min.js:1)
-------New Session Attempted-------
@pynchmeister
pynchmeister / dwrtcSafariError
Last active May 25, 2019 20:36
Javascript Console Logs of DWRTC Demo Errors within Safari
Browser 1:
[Log] partner id: f5872bac-8c19-4f74-82ea-e916dc50548f (videocall.js, line 31)
[Debug] initialize dwrtc (videocall.js, line 48)
[Error] Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “node2.dwrtc.net” which could put your confidential information at risk. (px.png, line 0)
[Log] Started DWRTC with isInitiator: true, partnerId: f5872bac-8c19-4f74-82ea-e916dc50548f, (dwrtc.js, line 41)
ice servers: [{"urls":["turns:node1.dwrtc.net","turn:node1.dwrtc.net","stun:node1.dwrtc.net"],"username":"user","credential":"dwrtc"}]
[Debug] Websocket set up (dwrtc.js, line 134)
[Debug] New message, type: WebSocketIdMessage (dwrtc.js, line 154)
[Debug] got id message: 981379cd-1c43-4732-a4ff-94a49d93efe3 (videocall.js, line 68)
@pynchmeister
pynchmeister / kerassequentialmodelexample.ipynb
Created April 16, 2019 16:05
KerasSequentialModelExample.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.