LiquidityMining

Verified · Ion Swap Dark Contract · DSOL · Phase D
Contract ID
dc1_ec74be49652127de3dfb1608d34fde8e500ef6ff83566cd4f8413ed66f37
Code hash
ce6d0bccd836acd9b85b57bfaf5924340f99a14160ad9a0be7ba8b780c4e71ec
Deployer
Deploy tx
f71889c9e522c505f6f3e30e3bd9ea48…
Created at block
Source
View .dsol source →
Wallet: detecting…

Entrypoints

Each form below maps directly to a contract entrypoint. Filling it in and clicking Call constructs a typed-argv DSOL call. Your wallet shows an approval modal before broadcasting; nothing fires without your explicit click.

register

checkpoint

claim

Public state

loading…

Contract source Verified

Compiler
build-1261/dark-contracts/compiler v1
Source SHA-256
1de17b84cc123fffdc48e36a5dbf40a10ed0566d07bbf737f95ff2b45c6fdfa2
Bytecode hash
ce6d0bccd836acd9b85b57bfaf5924340f99a14160ad9a0be7ba8b780c4e71ec
Verified by
auto (canonical mirror)
Verified at
Thu, 30 Apr 2026 03:20:40 GMT

The on-chain bytecode hash matches the SHA-256 of LiquidityMining's compiled output. This means the source below was the exact input the deployer used. Anyone can re-derive the same bytecode by compiling the source through build-1261/dark-contracts/compiler.

// LiquidityMining — Phase D of silent-iron-keystone v4.
//
// LP positions earn rewards from a per-pool emission rate. The
// contract tracks share-block accruals tied to LP commitments
// (NOT addresses, preserving privacy). Anti-flash-LP: minimum
// 100-block holding period before any accrual starts.
//
// Privacy: per-position eligibility, no link to long-term identity.
// Claims emit nullifiers + a token-transfer event for the reward.

dark contract LiquidityMining {
  public mapping(bytes => bytes)   eligPool;            // positionId → pool_id
  public mapping(bytes => uint64)  eligRegisteredBlk;   // positionId → register block
  public mapping(bytes => uint64)  eligAccumulated;     // positionId → share-blocks accumulated
  public mapping(bytes => uint64)  eligLastClaimBlock;  // positionId → last claim block
  public mapping(bytes => bool)    claimNullifiers;

  @direct
  entry register(bytes positionId, bytes pool_id) {
    require(eligRegisteredBlk[positionId] == 0,           "MINE_DUPE_REGISTER");
    eligPool[positionId]            = pool_id;
    eligRegisteredBlk[positionId]   = block.number;
    eligAccumulated[positionId]     = 0;
    eligLastClaimBlock[positionId]  = block.number;
  }

  // Anyone can call checkpoint to advance accumulation. Anti-flash-LP:
  // first checkpoint must be >100 blocks after register. After that,
  // checkpoints accrue (current_block - last_claim_block) share-blocks.
  @direct
  entry checkpoint(bytes positionId) {
    require(eligRegisteredBlk[positionId] != 0,                    "MINE_UNREGISTERED");
    require(block.number > eligRegisteredBlk[positionId] + 100,    "MINE_TOO_SOON");
    require(block.number > eligLastClaimBlock[positionId],         "MINE_NO_PROGRESS");
    eligAccumulated[positionId]    = eligAccumulated[positionId] + (block.number - eligLastClaimBlock[positionId]);
    eligLastClaimBlock[positionId] = block.number;
  }

  @direct
  entry claim(bytes positionId, bytes nullifier, uint64 claim_amount) {
    require(eligRegisteredBlk[positionId] != 0,           "MINE_UNREGISTERED");
    require(!claimNullifiers[nullifier],                   "MINE_REPLAY");
    require(claim_amount > 0,                              "MINE_ZERO_CLAIM");
    require(claim_amount <= eligAccumulated[positionId],   "MINE_OVERCLAIM");

    eligAccumulated[positionId] = eligAccumulated[positionId] - claim_amount;
    claimNullifiers[nullifier]  = true;
    syscall(TOKEN_TRANSFER_EMIT_V1, ctx.txHash);
  }
}
Download .dsol