This file contains hidden or 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 subprocess | |
import os | |
import time | |
import json | |
# Constants for the benchmark | |
model = "Qwen/Qwen2-72B-Instruct-GPTQ-Int4" | |
max_completed_requests = 100 | |
mean_input_tokens = 2000 | |
stddev_input_tokens = 500 |
This file contains hidden or 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
const webpack = require("webpack"); | |
module.exports = function override(config) { | |
const fallback = config.resolve.fallback || {}; | |
Object.assign(fallback, { | |
stream: require.resolve("stream-browserify"), | |
crypto: require.resolve("crypto-browserify"), | |
http: require.resolve('stream-http'), | |
https: require.resolve('https-browserify'), |
This file contains hidden or 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 React, { useState, useEffect } from 'react'; | |
import { Connector as Connector$1, useClient, useConnect, useDisconnect, mainnet as mainnet$1, configureChains, createClient, WagmiConfig } from 'wagmi'; | |
import { publicProvider } from 'wagmi/providers/public'; | |
import { useDynamicContext } from '@dynamic-labs/sdk-react'; | |
import { getAddress, hexValue } from 'ethers/lib/utils.js'; | |
import { mainnet, optimism, gnosis, polygon, arbitrum, bsc } from 'wagmi/chains'; | |
import { providers } from 'ethers'; | |
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; |
This file contains hidden or 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 "./styles.css"; | |
import { useEffect, useState } from "react"; | |
import { UseGasBit } from "./lib/useGasBit"; | |
import { UseContractReader } from "./lib/useContractReader"; | |
import Button from "@mui/material/Button"; | |
import Typography from "@mui/material/Typography"; | |
import Container from "@mui/material/Container"; |
This file contains hidden or 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 { TransactionSender } from "gasbit-alpha-sdk"; | |
export function UseGasBit() { | |
async function sendGasLessTransaction() { | |
await TransactionSender.sendTransaction({ | |
from: "0x229489a43b66A3949027B5b6578Edd9e546A4720", // Your user wallet address | |
to: "0x030aFcc742F0DEBb4fdC164Df0D738731b5E3BeE", | |
provider: window.ethereum, | |
method: "capture", | |
params: null |
This file contains hidden or 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; | |
import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; | |
contract CaptureTheFlag is ERC2771Context { | |
constructor( | |
address trustedForwarder_ | |
) ERC2771Context(trustedForwarder_){} |
This file contains hidden or 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 { TransactionSender } from '@gasbit/metatx'; | |
const txReceipt = await TransactionSender.send({ | |
appId: '192d4b19-0d6a-4389-8c99-79ca73087587', | |
signer: transactionSigner, | |
method: 'mint', | |
params: { | |
tokenURI: 'ipfs://QmcmCZ7dx8qn16967eExinxa3hkY4rADxmQFpKYcp43Tb7', | |
amount: 1, | |
account: '0x8a9c67fee641579deba04928c4bc45f66e26343a', |
This file contains hidden or 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 { ethers } from "ethers"; | |
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_ADDRESS); | |
/** | |
* Prepare data to be signed | |
*/ | |
// The Trusted Forwarder address | |
const trustedForwarderAddress = process.env.TRUSTED_FORWARDER_ADDRESS; |
This file contains hidden or 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 { Biconomy } from "@biconomy/mexa"; | |
import { ethers } from "ethers"; | |
import fs from "fs"; | |
import sigUtil from "eth-sig-util"; | |
import dotenv from "dotenv"; | |
dotenv.config(); | |
const { abi } = JSON.parse(fs.readFileSync("./artifacts/contracts/LastCaller.sol/LastCaller.json")); |
This file contains hidden or 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
... | |
function _msgSender() internal view virtual override returns (address sender) { | |
if (isTrustedForwarder(msg.sender)) { | |
// The assembly code is more direct than the Solidity version using `abi.decode`. | |
/// @solidity memory-safe-assembly | |
assembly { | |
sender := shr(96, calldataload(sub(calldatasize(), 20))) | |
} | |
} else { | |
return super._msgSender(); |
NewerOlder