web3-course/l4/lottery/lottery_contract.go

14 lines
218 B
Go
Raw Normal View History

package lottery
import (
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
)
func IsWinner(playerName string) bool {
if playerName == "demo" {
return true
}
random := runtime.GetRandom()
return random < 100
}