Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

fishsea source realm

Package fishsea is the person-versus-person sea. CommitMint pays 150 GNOT and the whole fee goes to the wallet that c...

Overview

Package fishsea is the person-versus-person sea. CommitMint pays 150 GNOT and the whole fee goes to the wallet that called Init. RevealMint, once the chain is at least two blocks later, rolls rarity and trait from sha256 of the caller, the commit height, that fixed height plus two, and the id. Waiting longer does not change the roll. The player does not pass trait, size, or rarity. Swim stays off chain. Register locks at least 10 GNOT. Leave returns it after 5 seconds. Settle pays one covered stake: 80% winner, 10% liquidity, 10% team. There is no machine fish and no FISH draw. A seated wallet can settle any other seated fish. The realm does not replay the bite. fishlive stays as deployed. This package does not move it. fishsea-1.

Functions 33

func CommitMint

crossing Action
1func CommitMint(cur realm) int
source

CommitMint sells one unrevealed fish for 150 GNOT. The fee leaves this realm in the same call.

func Heal

crossing Action
1func Heal(cur realm, id int)
source

Heal clears mustHeal outside the sea so Register can run again.

func Init

crossing Action
1func Init(cur realm, lp, crew address)
source

Init records the caller as the mint wallet, plus liquidity and team. Those three must be distinct. Call once, from an EOA, with no coins.

func Leave

crossing Action
1func Leave(cur realm, id int)
source

Leave returns the seated stake once 5 seconds have passed since Register.

func Register

crossing Action
1func Register(cur realm, id int, stake int64)
source

Register seats one revealed fish. The attached coins are the stake.

func RevealMint

crossing Action
1func RevealMint(cur realm, id int)
source

RevealMint assigns rarity, trait, and the species name. Entropy is the commit height plus two.

func Roll

Action
1func Roll(caller address, commitH int64, entropyH int64, id int) (rarity string, trait string, bite int, hp int, speed int)
source

Roll is the reveal hash. entropyH must be commitH+2. Trait adds 12%, half up.

func Settle

crossing Action
1func Settle(cur realm, id int, target int)
source

Settle pays the smaller stake. The NFT stays. HP falls to 30% and must heal. The caller has to own the killer. This realm does not check who bit whom.

Dependencies

Source Files 2