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.

seafish source realm

Package seafish is the tradable person-versus-person sea. CommitMint pays 150 GNOT and the whole fee goes to the wall...

Overview

Package seafish is the tradable 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. The revealed fish is a GRC721 owned by that player. TokenURI is the https portrait. 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. Dust stays with the team. There is no machine fish and no FISH draw. A seated, staked, or healing fish cannot be listed or transferred. List, UpdatePrice, Cancel, and Buy are the Nomaq trade. Buy pays the ask, in full, to the seller. RegisterCollection publishes the slug on bazaarv5. fishsea, fishnft, gnofish, and fishlive stay as deployed. This package does not move them. seafish-1. The mint cap is 10000. One wallet still seats only one fish.

Functions 58

func Approve

crossing Action
1func Approve(cur realm, to address, id int)
source

Approve lets to move this fish once. The caller must own it. The call sends no coins.

func Buy

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

Buy pays the ask, in full, to the seller and gives the fish to the buyer.

func Cancel

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

Cancel returns a listed fish to its seller. The call sends no coins.

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. The player owns the fish. The GRC721 is minted at RevealMint, when the portrait exists.

func Heal

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

Heal clears mustHeal outside the sea so Register, List, and Transfer 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 List

crossing Action
1func List(cur realm, id int, priceUgnot int64)
source

List escrows the fish to this realm and puts it on sale. The caller sends no coins. Refused while the fish is seated, still holds a stake, or must heal.

func Register

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

Register seats one revealed fish the caller still owns. The attached coins are the stake. A listed fish, or a second fish from a wallet that is already seated, is refused.

func RegisterCollection

crossing Action
1func RegisterCollection(cur realm)
source

RegisterCollection publishes this realm on bazaarv5. The caller must be the Init wallet, the same wallet that reserved slug seafish, and must send no coins. Call it once, after Init.

func RevealMint

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

RevealMint assigns rarity, trait, the species name, and the portrait. Entropy is the commit height plus two. The NFT is minted to the caller.

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 SetApprovalForAll

crossing Action
1func SetApprovalForAll(cur realm, operator address, approved bool)
source

SetApprovalForAll lets operator move every fish of the caller, or revokes it.

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.

func TokenMetadata

Action
1func TokenMetadata(tid grc721.TokenID) (string, error)
source

TokenMetadata is the JSON Adena reads. Attribute keys are traitType.

func TokenURI

Action
1func TokenURI(tid grc721.TokenID) (string, error)
source

TokenURI is the https image Adena puts in an img tag.

func Transfer

crossing Action
1func Transfer(cur realm, to address, id int)
source

Transfer moves a fish the caller owns. A seated, staked, healing, or listed fish stays put.

func TransferFrom

crossing Action
1func TransferFrom(cur realm, from, to address, id int)
source

TransferFrom moves a fish. The caller must own it or be approved for it.

func UpdatePrice

crossing Action
1func UpdatePrice(cur realm, id int, priceUgnot int64)
source

UpdatePrice changes the ask of a fish the caller is selling.

Dependencies

Source Files 2