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

dutchauction/v0 package

Overview

Package dutchauction ports the classic Solidity Dutch-auction pattern to gno.land: a seller lists an item at a high starting price that decays linearly, block by block, down to a floor price. The first buyer to call Buy pays whatever the price is at that moment — real ugnot, escrowed by the chain with the transaction and forwarded to the seller on settlement. Overpayment is refunded automatically. State-mutating functions are crossing functions (`cur realm`) per the gno 0.9 interrealm convention.

Function

Buy

func Buy(cur realm, id string) int64

Buy purchases auction id at its current price. The caller must send at least that many ugnot with the transaction; any excess is refunded immediately. Only a direct EOA transaction (MsgCall) may buy, so the payment envelope can't be spoofed via an ephemeral MsgRun realm. Returns the price actually paid. Crossing function.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/dutchauction/v0" -func "Buy" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/dutchauction/v0" -func "Buy" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "http://127.0.0.1:26657" call.tx