Skip to content

Instantly share code, notes, and snippets.

View JuanXavier's full-sized avatar

Juan Xavier Valverde JuanXavier

View GitHub Profile
  • arbitrum nova 0x1c5771e96C9d5524fb6e606f5B356d08C40Eb194
  • arbitrum 0xA7caC4207579A179c1069435d032ee0F9F150e5c
  • avax 0xbACEB8eC6b9355Dfc0269C18bac9d6E2Bdc29C4F
  • boba 0x2f686751b19a9d91cc3d57d90150bc767f050066
  • bsc 0xD75F5369724b513b497101fb15211160c1d96550
  • ethereum 0x044b75f554b886A065b9567891e45c79542d7357
  • fantom 0x3e603C14aF37EBdaD31709C4f848Fc6aD5BEc715
  • fuse 0x2f686751b19a9d91cc3d57d90150Bc767f050066
  • gnosis 0x145d82bCa93cCa2AE057D1c6f26245d1b9522E6F
  • moonbeam 0x1838b053E0223F05FB768fa79aA07Df3f0f27480
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19;
import { Script } from "forge-std/Script.sol";
abstract contract BaseScript is Script {
/// @dev Included to enable compilation of the script without a $MNEMONIC environment variable.
string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";
/// @dev Needed for the deterministic deployments.
@zellic-audit
zellic-audit / CheatCar.sol
Created February 1, 2023 14:38
Zellic Cars for 0xtitans
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./../interfaces/ICar.sol";
import "./../utils/SignedWadMath.sol";
import "solmate/utils/SafeCastLib.sol";
import "forge-std/Test.sol";
/*
@vicnaum
vicnaum / EVM_Regex_Decompiler.md
Created December 28, 2022 10:03
EVM Regex Decompiler
@emo-eth
emo-eth / chain_funcs.sh
Last active February 1, 2026 01:37
Helper functions for interacting with chains and Foundry tests. Source from .zshrc etc
###########
# Imports #
###########
# the RPCs file should include RPC URLs and Etherscan API Keys for relevant networks
# (in a separate file so they don't get committed)
source "$(dirname "$0")/rpcs.sh"
# any useful addresses for various networks for easy reference
source "$(dirname "$0")/addresses.sh"
# any useful functions and definitions for interacting with Seaport
object "Contract" {
code {
datacopy(0, dataoffset("runtime"), datasize("runtime"))
return(0, datasize("runtime"))
}
object "runtime" {
code {
if iszero(calledByOwner()) { revert(0, 0) }
switch selector()
case 0x00 {
@0age
0age / MetamorphicContractInitCode.txt
Last active October 5, 2024 17:18
Metamorphic Contract Initialization Code
* @title Metamorphic Contract
* @author 0age, derived from cloner contract by @mhswende
* @notice This contract will create a metamorphic contract, or an upgradeable
* contract that does not rely on a transparent proxy, when deployed using
* CREATE2. It expects the deployer to provide a getImplementation() function
* that will return an implementation address, which it will then clone and
* deploy. Unlike with upgradeable transparent proxies, the state of a
* metamorphic contract will be wiped clean with each upgrade. With great power
* comes great responsibility - implement appropriate controls and educate the
* users of your contract if it will be interacted with!