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
#!/usr/bin/env python3 | |
import os | |
import re | |
import sys | |
import requests | |
import calendar | |
from datetime import datetime, timedelta, date | |
from typing import TypedDict | |
from collections import defaultdict |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Triangle</title> | |
</head> | |
<body> | |
<canvas id="canvas" width=500 height=500></canvas> | |
<script> |
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; | |
contract RandomStorage { | |
mapping(bytes32 => bytes32) internal data; | |
event ReadEvent(bytes32 k, bytes32 v); | |
constructor() {} |
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.18; | |
contract SapphireShuffle { | |
address private constant RANDOM_BYTES = 0x0100000000000000000000000000000000000001; | |
error ErrorGeneratingRandom(); | |
function _random_bytes32() |
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: AGPL-3.0-or-later | |
pragma solidity ^0.8.9; | |
contract WW | |
{ | |
event EncryptedResponse(bytes32 nonce, bytes data); | |
event PublicKey(bytes32 x25519_public); | |
struct Coupon { |
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 z3 | |
s = z3.Solver() | |
bvp = 256 | |
bvs = 2**bvp | |
balanceOf_signer = z3.BitVec('balanceOf_signer', bvp) | |
wad = z3.BitVec('wad', bvp) | |
reward = z3.BitVec('reward', bvp) | |
contract_balance = z3.Int('contract_balance') # z3.IntVal((10**18) * 4.48) | |
# Calculate balance of user after performing withdrawal |
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.8.9; | |
contract E2Example | |
{ | |
event EncryptedResponse(bytes32 nonce, bytes data); | |
event DecryptedInput(uint256 a, uint256 b, uint256 c); | |
event PublicKey(bytes32 x); |
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
#!/usr/bin/env bash | |
if [[ -z $1 ]]; then | |
>&2 echo "Usage: `basename $0` [N.M|latest]" | |
>&2 echo "" | |
>&2 echo "Example to download v0.7.2:" | |
>&2 echo "" | |
>&2 echo ' $' "`basename $0` 7.2" | |
>&2 echo "" | |
>&2 echo "Example to download latest version:" |
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 once | |
#include <functional> | |
template<typename... ArgsT> | |
struct EventHook; | |
template<typename... ArgsT> |
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
/// Conditionally enable a function if they share the same CurveT type | |
/// e.g. template<IsSameCurve<CurveT,OtherType> = 0> | |
template<typename MyCurve, typename OtherType> | |
using IsSameCurve = std::enable_if_t<std::is_same<MyCurve,typename OtherType::CurveT>::value,int>; | |
/// Conditionally enable a function if the are of the same types and curves | |
/// Uses CanonicalSelfT to determine if they're the same general type | |
/// e.g. template<IsSameCurve<CurveT,OtherType> = 0> |
NewerOlder