Skip to content

Repository files navigation

RedDuck

Equitify Platform

An IDO launchpad on NEAR where a vesting position is an NFT — and can be insured, transferred and settled on-chain.


A token launchpad built on NEAR. When a user buys into a sale, their allocation and its vesting schedule are minted as an NFT, so the position can be held, transferred or used as collateral. On top of that, the platform contract runs a market where guarantee providers and position holders enter fixed-term protection agreements over those positions.

Built with

Area Technology
Contracts TypeScript, near-sdk-js, compiled to WASM
Chain NEAR
Frontend React 18, TypeScript, Vite
Web3 near-api-js, NEAR Wallet Selector
State Redux Toolkit
Styling Sass modules, styled-components
Testing AVA + near-workspaces (local NEAR sandbox)
Tooling Yarn 1 workspaces, ESLint, Prettier, husky + commitlint

The contracts

Contract What it does
launchpad Runs a sale: hard/soft cap, price, sale window, vesting and cliff. Handles purchases, refunds and claim accounting
launchpadFactory Registry of deployed launchpads — add_ido makes a sale discoverable by the frontend
nft The vesting position itself (NEP-171). Holds the claimable balance for an IDO; make_claim releases vested tokens to the holder
ft NEP-141 token used as the launched asset
equitifyPlatform The protection market over positions — offers, escrow and settlement

How the protection market works

  1. Either side posts an offer: a guarantee provider (create_offer_from_guarantee_provider) or an NFT holder (create_offer_from_nft_provider). It names the NFT, a NEAR guarantee amount, a fee and a duration.
  2. The counterparty accepts (accept_offer_from_nft_provider / accept_offer_from_guarantee_provider). The NFT and the NEAR guarantee are escrowed by the platform contract. An unaccepted offer can be pulled with cancel_order.
  3. When the term ends, the NFT provider settles it one way or the other: protection_claim_guarantee pays the guarantee out and passes the position to the guarantee provider, protection_claim_nft returns the position and releases the guarantee back.

get_offers and get_protections expose the open book and active protections to the frontend.

Getting started

Requires Node.js 20+ and Yarn 1 (classic).

yarn install
yarn build:contracts
yarn dev

Configuration

All settings live in .env at the repo root — copy .env.example and fill it in. Every value is optional except the deployer credentials.

  • Contract addresses and network. VITE_PLATFORM_ADDRESS, VITE_LAUNCHPAD_FACTORY_ADDRESS and VITE_NEAR_NETWORK default to the current testnet deployment.
  • RPC endpoint. VITE_NEAR_RPC_URL defaults to FastNEAR's public node. The legacy rpc.<network>.near.org endpoints do not send CORS headers, so the browser cannot read the chain through them.
  • Deployment. yarn deploy reads NEAR_DEPLOYER_ACCOUNT_ID and NEAR_DEPLOYER_PRIVATE_KEY, and takes the keystore from ~/.near-credentials unless NEAR_KEY_STORE_PATH says otherwise.

Scripts

yarn dev                       # frontend dev server (Vite)
yarn build                     # contracts (WASM) + production web build
yarn build:contracts           # contracts only
yarn test                      # build contracts, then run integration tests
yarn test:integration:noBuild  # integration tests against the existing build
yarn typecheck                 # frontend type checking
yarn codestyle                 # ESLint + Prettier
yarn codestyle:fix
yarn deploy                    # deploy contracts (needs .env)

Integration tests: AVA spins up a local NEAR sandbox via near-workspaces, deploys the freshly built WASM and drives full offer lifecycles end to end.

Project structure

├── contracts/          # near-sdk-js contracts + deployment scripts
│   └── src/
│       ├── launchpad.ts, launchpadFactory.ts, nft.ts, ft.ts
│       ├── equitifyPlatform.ts
│       └── scripts/deploy/
├── frontend/           # Vite + React app
│   └── src/
│       ├── components/, pages/, routes/
│       ├── contracts/  # typed contract clients
│       ├── store/      # Redux Toolkit slices and NEAR calls
│       └── near-wallet.ts
└── integration-tests/  # AVA + near-workspaces sandbox tests

The contracts build against near-sdk-js 0.6 and TypeScript 4.x, while the frontend runs a newer TypeScript and Vite. The two toolchains are kept separate through yarn nohoist — see the comment in package.json.

License

MIT © RedDuck Software

About

IDO launchpad on NEAR where a vesting position is minted as an NFT, plus an on-chain market for insuring those positions through fixed-term guarantee agreements.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages