Playground
gnomod.toml
module = "gno.land/r/g1zkzjmyveh7euq83h5zhnhj6mg0d7kr35nphzd2/tillsol" gno = "0.9" [addpkg] creator = "g1zkzjmyveh7euq83h5zhnhj6mg0d7kr35nphzd2" height = 1457949 max_deposit = "100000000ugnot"
tillsol.gno
// Package tillsol buys a round with an envelope that never reaches the till.
package tillsol
import (
"chain/runtime/unsafe"
"gno.land/r/g15c02s5hhdny9uvr9za3xsyn9sw8p0klptrh6kf/cellar/hall"
"gno.land/r/g15c02s5hhdny9uvr9za3xsyn9sw8p0klptrh6kf/cellar/till"
)
// Solve must be called with -send 100000ugnot. The coins land here, so this
// realm reads the envelope (the chain refuses a send nobody observes), then
// lets the barkeep read the very same envelope.
func Solve(cur realm) {
if unsafe.OriginSend().AmountOf("ugnot") < till.Price {
panic("send the price of a round with the call")
}
till.BuyRound(cross(cur))
hall.Claim(cross(cur), "till")
}