Skip to content

Instantly share code, notes, and snippets.

View z0r0z's full-sized avatar
💭
codin qualia 🪄

ross z0r0z

💭
codin qualia 🪄
View GitHub Profile
@z0r0z
z0r0z / gist.md
Created November 25, 2026 05:48
Tacit gas relay: pay for a public call in TAC, with no ETH in the wallet

Tacit gas relay: pay for a public call in TAC, with no ETH in the wallet

A wallet that holds TAC (or a token) but no ETH can still swap or enter a pool. It signs one order. A relayer sends the transaction, pays the gas, and is paid a fee out of the user's tokens in the same transaction.

The idea

Gas has to be paid in ETH by whoever sends the transaction. So someone else sends it, and the contract reimburses them in the user's own token. The user never needs ETH, and the relayer is never left holding the risk of a failed trade: the contract pays out only if the whole call lands.

@z0r0z
z0r0z / privacy-pools-ceremony_attestation.log
Created February 26, 2025 12:12
Attestation for Privacy Pools Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm z0r0z-92001561 and I have contributed to the Privacy Pools Ceremony.
The following are my contribution signatures:
Circuit # 1 (withdraw)
Contributor # 372
Contribution Hash:
e01f92d2 0a1e6b64 ffbeddab 3e50e561
aab3797d 593a13cb b1da3dff 211b23eb
b03b8835 5cd6e90a 2dc5cb7c 000c65f9
a37c7357 ce165fcd 354cd11d bd3c0d40
@z0r0z
z0r0z / CTX.sol
Created January 15, 2024 09:30
Dollars-to-donuts exchange. Demo: Circle <> Tether. Smol Swap Lego.
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.19;
/// @notice Dollars-to-donuts exchange.
/// Put in one thing for another thing.
contract CTX {
IERC20 constant C = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // Circle dollars.
IERC20 constant T = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); // Tether dollars.
uint256 constant F = 1; // Fee is just a lil bit. Placeholder. Someone should do the math.
@z0r0z
z0r0z / Account.sol
Last active November 10, 2023 21:04
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.19;
/// @notice Receiver mixin for ETH and safe-transferred ERC721 and ERC1155 tokens.
/// @author Solady (https://github.com/Vectorized/solady/blob/main/src/accounts/Receiver.sol)
///
/// @dev Note:
/// - Handles all ERC721 and ERC1155 token safety callbacks.
/// - Collapses function table gas overhead and code size.
/// - Utilizes fallback so unknown calldata will pass on.
@z0r0z
z0r0z / AssetContractShared.sol
Last active July 12, 2023 14:05
Let us verify the contract source code of the most popular ERC1155 - OpenSea Shared Storefront (OPENSTORE) - 0x495f947276749ce646f68ac8c248420045cb7b5e
pragma solidity ^0.5.12;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
@z0r0z
z0r0z / ERC223ish.sol
Last active July 10, 2023 14:48
ERC223-like token for discussion in Final standard process.
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @dev ERC223ish
/// @author z0r0z
contract ERC223ish {
event Approval(address indexed from, address indexed to, uint amt);
event Transfer(address indexed from, address indexed to, uint amt);
event Transfer(address indexed from, address indexed to, uint amt, bytes data);
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol";
import "https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol";
struct OTC {
address to;
ERC20 tkn0;
uint256 tkn0amt;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
error DeploymentFailed();
address constant TURNSTILE = 0xEcf044C5B4b867CFda001101c617eCd347095B44;
/// @notice Minimal proxy library.
/// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibClone.sol)
library LibClone {
@z0r0z
z0r0z / TheGame.sol
Created December 22, 2022 17:49
Solidity implementation of The Game.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract TheGame {
// Nothing to see here yet.
}
@z0r0z
z0r0z / OwnedWithTimer.sol
Last active December 1, 2022 03:59
Simple single owner authorization mixin with timer for guardianship. 👍
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Simple single owner authorization mixin with timer for guardianship.
/// @author Zolidity (https://github.com/z0r0z/zolidity/blob/main/src/auth/OwnedWithTimer.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
contract OwnedWithTimer {
/// -----------------------------------------------------------------------
/// Events
/// -----------------------------------------------------------------------