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.

fishduel source realm

Package fishduel is a two-person trial. Swim stays off chain. Settle pays one covered stake from three sealed samples...

Overview

Package fishduel is a two-person trial. Swim stays off chain. Settle pays one covered stake from three sealed samples. Each player binds an ed25519 mark key at Register. The realm cannot check a loose secp256k1 wallet signature. There is no machine fish and no FISH draw. shoal/fish stays the live collection. Mint is 1 GNOT and the stake floor is 1 GNOT. A sample note is bout:seq:height:id:x:z:time:secret:sig The mark signs the sha256 of bout,seq,height,id,x,z,time,secret joined by commas. secret is 32 lowercase hex chars. sig is 128 lowercase hex chars. The public key is 64.

Functions 21

func Init

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

Init records three GNOT sinks. They must be distinct. Call once, from an EOA, with no coins. The mint fee is 60/20/10 and the last tenth joins team. Kill cheer also joins team.

func Leave

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

Leave returns the seated stake. While the other fish is seated, Leave waits 60 seconds.

func Mint

crossing Action
1func Mint(cur realm, name string) int
source

Mint sells one trial fish for 1 GNOT. The fee leaves this realm in the same call.

func Register

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

Register seats a fish and binds its mark key. The attached coins are the stake.

func Settle

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

Settle pays a kill from six notes, killer then victim, three samples, separated by slashes.

func Strike

Action
1func Strike(bite, hpMax int) int
source

Strike is floor(bite * 100 / (hpMax + 100)), at least 1.

Dependencies

Source Files 2