Skip to content

Instantly share code, notes, and snippets.

@tokdaniel
tokdaniel / indexcoop-coverage.txt
Last active November 12, 2024 08:26
IndexCoop Tokenlist Coverage
coverage
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "./interfaces/IMetaData.sol";
import "./interfaces/IPrizePools.sol";
import "./utils/RandomUtils.sol";
name: Deploy Superfluid VestingScheduler Subgraphs
on:
workflow_dispatch:
push:
branches:
- "release-v1/*"
paths:
- "packages/subgraph/vesting-scheduler/**"
@tokdaniel
tokdaniel / contracts...PrizePools.sol
Created March 20, 2023 15:21
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "./interfaces/IMetaData.sol";
import "./interfaces/IPrizePools.sol";
@tokdaniel
tokdaniel / contracts...PrizePools.sol
Created March 20, 2023 08:24
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "./interfaces/IMetaData.sol";
import "./interfaces/IPrizePools.sol";
@tokdaniel
tokdaniel / .prettierrc.json
Created March 15, 2023 20:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
@tokdaniel
tokdaniel / contracts...Raffle.sol
Created March 15, 2023 08:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "./interfaces/IMetaData.sol";
from functools import reduce
def compose2(f, g):
return lambda *a, **kw: f(g(*a, **kw))
def compose(*fs):
return reduce(compose2, fs)
def safeMod(input, divider):
return input % divider if type(input) == int else input
const range = (m: number, n: number): number[] => Array.from(Array(n - m + 1).keys()).map(n => n + m)
const isEvil = (n: number): boolean => (
n.toString(2).split('').filter((x) => x === '1').length % 2 == 0
)
range(0, 50).filter(isEvil)
// print
console.log(range(0,50).filter(isEvil).join('\n'))
.hamburger {
display: flex;
flex-direction: column;
cursor: pointer;
}
.bar {
margin: 2px;
width: 24px;
height: 4px;