Upload BlueChip contract to Osmosis

BlueChip decentralizes creator and content subscriptions. Creators are able to launch a CW20 token that gets paired with OSMO in their own liquidity pool. The liqudity pool itself has two distinct phases.

Phase 1, Funding Phase: The creator creates their token and their pool is deployed. No tokens are minted yet, and the pool itslef is given full minting abilities over the token. At first, the pool is only able to accept a specefic type of transaction, the commit. The commit can only be carried out by using OSMO. When committing to the creator pool, the committer DOES NOT make a swap. They are committing to the pools ledger. The ledger tracks the amount of OSMO committed to it priced in dollars. Once the contract obtain $25,000 in OSMOS, the pool begins to transition to phase 2.

Crossing the $25,000 Threshold: Once the threshold is crossed, the pool officially mints the creators token, and uses the initial $25,000 of OSMO to seed the pools liquidity. The pool sends the minted creator tokens to 4 sepearte locations: the pool itself (350,000 tokens used as liquidity), to each committer in relation to how much they commited (500,000 total tokens), to BlueChip protocol wallet (25,000), and then finally an amount back to the creator themselves (325,000).

Phase 3, Pool is no longer dormant: After the threshold is crossed, the pool behaves as normal and wallets are able to freely commit, swap, provide liquidity etc with the pool. When committing to the pool now, the committer will recieve creator tokens in return for their commit just like any other swap.

A final note, the commit transaction sends a 5% and 1% fee to the creator and BlueChip protocol wallets respectively. The commit transaction emits different messages than a normal swap allowing creators and others to seemlessly sync it to their front ends.

Github: GitHub - Bluechip23/bluechip-osmosis-contract · GitHub

Testnet evidence:
The protocol is deployed and has been exercised end-to-end on Osmosis
testnet. The stored code’s on-chain hashes match the reproducible
cosmwasm/optimizer 0.16.0 artifacts in the repo (byte-for-byte).

Deployed contracts

  • Factory: `osmo1xchfk3t6xzl7t5jyr408p3waxxwftyl7kp7muw2w4rujt3h49h3qq0s54s`
  • Router: `osmo1cyry2qx80dzsttudgqf76vlkp7p6822ujc3kcfge4pzdu3dq6srs9cpa6d`
  • Example commit pool (factory-instantiated): `osmo15uxs9xun2zrrdr2s7sq4vlmapuhqfxttpuusz66783c67kktc3cqaxw7cs`
    • Creator token (CW20): `osmo1zulz5faktmtpgfvu3yfvz3v9uksqurmvqavdxa93j6mctzr8pe6q8slnkc`
    • LP position NFT (CW721): `osmo14f89kkfen9zmkdnq4ykras88mqjczezp22uf38g534pycrq4sqwqk7cr6s`

Full lifecycle, on-chain (tx hashes)

  1. Create commit pool (factory spawns the pool) — `E738927A1BD35B3287E0DA738746C16CF4AD19DCADEA5C3B445BE4391B651656`
  2. Pre-threshold commit — `D22FA4ED9E20DA0328E1C17C37C995488B95FF62052E6CE49DB28FB63780C34A`
  3. Cross USD threshold → AMM self-seeds — `DAFA628AFFF5B6E77D47087903BED3964F2C8DD397C44358B01E303DA914BA51`
  4. Pro-rata committer distribution (CW20 payout) — `5F0FE86C741C2802C124BD4976EE17C762C5EBA62FB676E0B1CCDCF10D57659E`
  5. Swap OSMO → creator token — `2BA2594A169346914FC6013E4E769F20A78F45F74CD88B4B2612D54EF9AF7096`
  6. Swap creator token → OSMO — `7E063677DF4F5B09563D5DC266B0914D094D9CC327CD1BFCDABBAF0502AC20A5`
  7. Add liquidity (mints position NFT) — `F7A2B85D40E543B79740A18C1C70DAE8BCFE59436D30063582E84E90CA47F71F`
  8. Remove liquidity — `03E1F8D094D05BA253C41BD0FA897ACBA69A98CD95118DFFA1833CE045CBC580`
  9. Router single-hop swap — `32BCF044979AD9F08294C3C34B4CDA9FD4BF4A55E3C4344608D3A62ECC3FDB7B`