Skip to content

Instantly share code, notes, and snippets.

View xcyxiner's full-sized avatar

xcyxiner xcyxiner

View GitHub Profile
@xcyxiner
xcyxiner / .deps...remix-tests...remix_accounts.sol
Created May 6, 2024 13:16
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@xcyxiner
xcyxiner / .git...HEAD
Created April 24, 2024 12:56
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.25+commit.b61c2a91.js&optimize=false&runs=200&gist=
ref: refs/heads/main
const basicAuthParser = require('basic-auth')
var basicAuth = function (req, res, next) {
const user = basicAuthParser(req)
const validUser = user &&
user.name === process.env.BASIC_AUTH_USER &&
user.pass === process.env.BASIC_AUTH_PASS
if (!validUser) {
res.set('WWW-Authenticate', 'Basic realm=Authorization Required')