A Wavelet smart contract that implements share purchase and issuance as a simple association of addresses to balances and names.
Implemented to begin learning development of Wavelet contracts using Rust.
Constraints
- Minimum parcel size: Purchaser must request a minimum amount of shares to participate in the sale
- Dummy KYC: Check all potential holders (sale or transfer) against a KYC service - a function that returns true.
- Cool-off Period: Investors can cancel their purchase within a fixed number of rounds following the purchase.
Basic nodejs client demonstrating synchronous transaction submission and confirmation in a structure that will be familiar to trufflejs users.
This client is an initial sketch for implementing a truffle-like framework for Wavelet in order to lower on-boarding friction for Web3 dApp developers.
Before you start
-
You must be running a local Wavelet testnet. Follow Perlin's guide to get up and running.
-
You must also have the rust dependencies specified in the Smart Contract setup.
Ready to roll...
Clone this repository then run the following in your terminal:
cd <path>/share-registry-contract
build cargo build --release --target wasm32-unknown-unknown
cd client
npm run start
- Supply should be checked as invariant
- Should only be allowed one investment inside cool-off
- Safe balance updates using
HashMap.get()
and.insert()
, instead of.or_insert()
- Cancelling investment reverses all parcels purchased
- Cool-off period set at spawn
- Price increases in tranches as round_idx increases and remaining supply decreases