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: UNLICENSED | |
pragma solidity ^0.8.9; | |
// Uncomment this line to use console.log | |
import "hardhat/console.sol"; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract Benchmark { | |
mapping (uint => uint) onchainStorage; | |
mapping (uint => uint) params; | |
address bridge; | |
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
{ | |
"name": "test-multisend-test", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@gnosis.pm/safe-core-sdk": "^2.3.2", | |
"@gnosis.pm/safe-core-sdk-types": "^1.4.0", | |
"@gnosis.pm/safe-ethers-lib": "^1.4.0", | |
"@gnosis.pm/safe-service-client": "^1.2.0", | |
"@testing-library/jest-dom": "^5.16.5", |
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 logo from './logo.svg'; | |
import './App.css'; | |
import { ethers } from "ethers"; | |
import EthersAdapter from '@gnosis.pm/safe-ethers-lib' | |
import SafeServiceClient from '@gnosis.pm/safe-service-client' | |
import Safe, { SafeFactory } from '@gnosis.pm/safe-core-sdk' | |
import { SafeTransactionOptionalProps } from '@gnosis.pm/safe-core-sdk' | |
import { MetaTransactionData } from '@gnosis.pm/safe-core-sdk-types' | |
function App() { |
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 hashlib | |
from web3 import Web3 | |
def bytes_to_u64_4(hex): | |
# to u64[4] | |
return [str(int(hex[i:i+16], 16)) for i in range(0,64, 16)] | |
def zokrates_sha3(hex): | |
hash = Web3.sha3(hexstr=hex).hex()[:64] | |
return bytes_to_u64_4(hash) |
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 "utils/casts/u64_to_bits" as unpack64 | |
from "hashes/sha3/256bit" import sha3_256 as hash | |
import "utils/casts/u8_from_bits" as pack8 | |
def bits_to_u8_array<N, P>(bool[N] bits) -> u8[P]: | |
assert(N == 8 * P) | |
u8[P] res = [0; P] | |
for u32 i in 0..P do |
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.7.0 <0.9.0; | |
contract MetaTx { | |
event Executed(address relayer, address behalfOf); | |
function execute(address from, address to, uint value, uint gas, bytes memory data, bytes32 txHash, uint8 v, bytes32 r, bytes32 s) public returns(address){ | |
address a = ecrecover(txHash, v,r,s); | |
emit Executed(msg.sender, a); | |
} | |
} |
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
string[9] memory parts; | |
parts[0] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">'; | |
parts[1] = Strings.toString(1); | |
parts[2] = '</text><text x="10" y="40" class="base">'; | |
parts[3] = "to"; | |
parts[4] = '</text><text x="10" y="60" class="base">'; |
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
library Base64 { | |
bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
/// @notice Encodes some bytes to the base64 representation | |
function encode(bytes memory data) internal pure returns (string memory) { | |
uint256 len = data.length; | |
if (len == 0) return ""; | |
// multiply by 4/3 rounded up | |
uint256 encodedLen = 4 * ((len + 2) / 3); |
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 logo from './logo.svg'; | |
import './App.css'; | |
import React, { useState, useEffect } from 'react'; | |
const SuperfluidSdk = require('@superfluid-finance/js-sdk'); | |
const {Web3Provider} = require('@ethersproject/providers'); | |
function App() { | |
const [subscribed, setSubscribed] = useState(); | |
const init = async () => { |
NewerOlder