Skip to content

Hooknomics/swinghook-smartcontract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwingHook

SwingHook is a trading-centered onchain protocol built around Uniswap v4 Hooks. Alongside standard Uniswap swaps, users can choose SwingBuy or SwingSell, where the Uniswap base quote is combined with verifiable Chainlink VRF input and contract-defined rules to produce variable settlement.

Protocol value remains in the ETH and SWING Settlement Vaults. Active SWING stakers can participate in Echo distributions, while the rule-based Sunset mechanism gives retained ETH a defined terminal clearing path when protocol activity remains low. The core contracts are non-upgradeable and have no admin withdrawal path.

This public repository intentionally contains only the contract sources, mainnet deployment scripts, and the configuration required to build or reproduce a deployment. See the whitepaper for the complete mechanism and risk details.

Links

Mainnet deployment

  • Network: Ethereum Mainnet (chainId = 1)
  • Deployment block: 25488722
  • Official pool ID: 0x7e208b310571bde49b511c496e9c33062134626b4c7d1cc56a8eb5d971903929
Contract Address
SystemDeployer 0xa8D76832D9977a832EA306FfD920E5b85fcCC40e
SWING 0x89Cf5C1b3bc04ea54795B37A85258F1dfC9c31dF
SwingHook 0xAd3cc8eb9D34AbEB3b0cA9B98Cbfd3837B7D40C8
SwingRouter 0x6964A40148Ee51E4B4fC2290FeD6AD2B7Df4dd2f
RandomnessManager 0xe30F27f1357B6Fca917cCbD86b00dF9207dB19D5
ETHSettlementVault 0xa22aB327373EF932239FF0AEC7E0BB746eD00Da2
SWINGSettlementVault 0x08ef64a29BED66d5F15B1c1361C34239b4cBCA14
HolderVault 0x2e6970112417dd28341976Cb5E1Fc479dd5d2F58
FeeKeep 0x538177Ab16B34Ff5ce95BebFdeA5f0A2A16313D3
ProtocolLiquidityManager 0x0eF500466b6AD8c533ed91916C9e341E0d16c4ee

Build

Install Foundry, then run:

forge build

Deployment

Copy the example configuration and fill the blank secret values locally. Never commit your private key, RPC URL, API key, generated broadcast data, or local .env files.

cp .env.example .env.mainnet
set -a && source .env.mainnet && set +a

# Dry run
forge script script/DeploySwingHook.s.sol:DeploySwingHook \
  --sig "run()" \
  --rpc-url "$ETH_MAINNET_RPC_URL"

# Broadcast only after reviewing the dry run
forge script script/DeploySwingHook.s.sol:DeploySwingHook \
  --sig "run()" \
  --rpc-url "$ETH_MAINNET_RPC_URL" \
  --broadcast --slow

The helper scripts in script/ can re-check Chainlink VRF pricing/callback behavior and verify a completed deployment on Etherscan.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors