How it works
1. Open
A creator calls open(params, terms) and sends the Pons launch fee as a reserve. params is the full launch description Pons needs (name, symbol, logo, links, who receives the creator tax and how much, the economics hash, a salt). The contract stores only its hash and emits the whole thing in the Opened event, so nothing can be changed afterwards and anybody can read it. terms sets the deadline, the size, the minimum, a per-wallet cap and a floor on the price.
2. Join
Until the deadline anyone calls join(id) with ETH (at least 0.001). Deposits can exceed the size: that is fine, see Oversubscription. leave(id) returns a deposit in full, for free, until the deadline. At the deadline the group is frozen.
3. Launch
After the deadline anybody calls launch(id, params). The contract checks that params hashes to the stored value, then does two things in the same transaction:
token, curve = factory.launchToken(params, configId, ETH, [flock]) // the flock is exempt from the snipe tax
curve.buy(used, minOut, flock) // used = min(deposits, size)
Because the token is created by this very call, nothing can buy before the flock: a bot cannot front-run a token that does not exist, and it cannot sit in the same transaction. If the price is worse than the floor you set, the buy reverts and the launch does not happen. Nobody loses anything: the flock stays open until a day after the deadline, then every depositor can take their money back.
4. Claim
claim(id) pays each member tokensOut × deposit / total tokens and returns the unfilled part of the deposit. Anyone can call claimFor to push tokens to the depositors, who are the only ones that can receive them. Claims never expire.
When it does not launch
- The creator can
cancelbefore the deadline. - If the deposits at the deadline are below the minimum, the flock failed.
- If nobody launches within a day after the deadline, or the launch keeps reverting (for example Pons changed its fee beyond the creator's reserve), the flock failed.
In every failed case refund(id) returns every deposit in full, and the creator takes back the fee reserve with reclaim(id).
One block
block N
... other transactions ...
tx launch(id, params)
1 factory.launchToken -> the token and its curve now exist
2 curve.buy(used) -> the flock buys at the start price
... everybody else, from here on, buys a token that already moved ...