Skip to content

DSS (DysnomiaSelfSnipe)

Overview

DSS is a utility contract that allows users to chat and purchase their own LAU tokens atomically. It's designed for users who want to interact with the chat system while accumulating LAU tokens.

  • License: Not specified
  • Solidity: ^0.8.2

What This Means For Players

Plain English Summary: DSS is a convenience tool that lets you chat and buy LAU tokens in a single transaction. Instead of sending two separate transactions (one to chat, one to buy), DSS bundles them together. This saves gas and ensures both actions succeed or fail together.

Real-World Analogy: It's like a coffee shop loyalty program where every time you buy a coffee, you automatically get a stamp. DSS makes it so every chat message you send also triggers a small LAU purchase, helping you accumulate tokens effortlessly.

How It Affects Your Gameplay: - Atomic actions - Chat and purchase happen together in one transaction - Token accumulation - Automatically builds your LAU holdings with every chat - Batched withdrawals - Accumulate tokens over time, then withdraw in bulk - Owner only - Only the contract owner can use these functions

State Variables

Variable Type Visibility Description
ownerAddress address private Contract owner
LAUAddress address private Target LAU token
AffectionAddress address private AFFECTION token address
LAUContract ILAU private LAU interface
LAUContractERC20 IERC20 private LAU as ERC20
AffectionContract IERC20 private AFFECTION interface

Write Functions

setLAU

function setLAU(address tokenAddress) public onlyOwner
- Access: onlyOwner - Description: Change target LAU token - In Plain English: Switch which LAU token the contract targets. Useful if you want to accumulate a different LAU than the one set during deployment.

withdrawLAU

function withdrawLAU(uint256 amount) public payable onlyOwner
- Access: onlyOwner - Description: Withdraw accumulated LAU tokens - In Plain English: Cash out the LAU tokens that have built up in this contract. Transfer your accumulated holdings to your wallet so you can use them elsewhere.

chatAndSnipe

function chatAndSnipe(string calldata text) public onlyOwner
- Access: onlyOwner - Description: Send chat and purchase 1 LAU atomically - In Plain English: Send a chat message AND buy 1 LAU token in a single transaction. Both happen together - either both succeed or both fail. Great for accumulating LAU while participating in chat.

chat

function chat(string calldata text) public onlyOwner
- Access: onlyOwner - Description: Send chat only (no purchase) - In Plain English: Send a chat message through your LAU without buying additional tokens. Use this when you just want to chat without triggering a purchase.

Errors

Error Parameters Description
Unauthorized - Caller is not owner
InsufficientLAUBalance - Not enough LAU to withdraw

Interfaces

IERC20

Standard ERC20 interface for token operations.

ILAU

interface ILAU {
    function Chat(string calldata text) external;
    function Purchase(address token, uint256 amount) external;
}

Usage Pattern

Deployment

// Deploy with your LAU token address
DSS sniper = new DSS(myLauAddress);

// Approve AFFECTION spending
IERC20(AFFECTIONContract).approve(address(sniper), type(uint256).max);

Chat and Snipe

// Chat and buy 1 LAU in one transaction
sniper.chatAndSnipe("Hello world!");

// Withdraw accumulated LAU
sniper.withdrawLAU(10 * 10**18);

Just Chat

sniper.chat("Just chatting, no purchase");

chatAndSnipe Flow

1. Call LAU.Chat(text)
2. Transfer 1 AFFECTION from caller to contract
3. Call LAU.Purchase(AFFECTION, 1e18)
4. Transfer 1 LAU back to caller

Purpose

This contract allows users to: 1. Chat in the Dysnomia system 2. Automatically purchase LAU tokens with each chat 3. Build up LAU holdings over time 4. Batch withdraw accumulated tokens

Security Notes

  • Only owner can call functions
  • Requires AFFECTION approval before use
  • Constructor approves max AFFECTION to LAU
  • No reentrancy concerns (simple flow)

Source

Original Gist: https://gist.github.com/as-helios/cc9bb3679d03eff83b000635c45e0451


Contract Verification

Property Value
Keccak256 Hash 0x234f62eb8b6749b2fdf8b09778352c7ae9303d80cc7283aa1c7eb12b0aded29f
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/etc/DysnomiaSelfSnipe.sol
Hash Generated 2026-02-08T00:29:08Z