slot, roulette done
This commit is contained in:
parent
ee2b93df77
commit
441a0f8692
15 changed files with 20 additions and 22 deletions
|
@ -1 +1 @@
|
||||||
{"name":"Craps","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":313,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playCraps","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"firstSum","type":"Integer"},{"name":"secondSum","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
{"name":"Craps","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":313,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playCraps","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"firstSum","type":"Integer"},{"name":"secondSum","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"BK6YPJGG/GLKsVxdPra+Ti4p7Q2D502dzz8FXV8kYntGrd4IigAyXR4do0pUPLRBnZHUqZXpPo7+jkQko/hCIQ=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
|
@ -9,8 +9,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
gasDecimals = 1_0000_0000
|
|
||||||
initialBalance = 3000
|
|
||||||
zaCoinHashKey = "zaCoinHash"
|
zaCoinHashKey = "zaCoinHash"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,3 @@ module Craps
|
||||||
go 1.21.4
|
go 1.21.4
|
||||||
|
|
||||||
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2
|
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2
|
||||||
|
|
||||||
require github.com/nspcc-dev/neo-go v0.104.0 // indirect
|
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
github.com/nspcc-dev/neo-go v0.104.0 h1:FGj3Z46yABcFIAI1SCLd1jQSoh+B00h/2VAgEgY1JKQ=
|
|
||||||
github.com/nspcc-dev/neo-go v0.104.0/go.mod h1:omsUK5PAtG2/nQ3/evs95QEg3wtkj3LH53e0NKtXVwQ=
|
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5 h1:09CpI5uwsxb1EeFPIKQRwwWlfCmDD/Dwwh01lPiQScM=
|
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2 h1:hPVF8iMmsQ15GSemj1ma6C9BkwfAugEXsUAVTEniK5M=
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2 h1:hPVF8iMmsQ15GSemj1ma6C9BkwfAugEXsUAVTEniK5M=
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
||||||
|
|
|
@ -8,8 +8,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
gasDecimals = 1_0000_0000
|
|
||||||
initialBalance = 3000
|
|
||||||
zaCoinHashKey = "zaCoinHash"
|
zaCoinHashKey = "zaCoinHash"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,8 +42,9 @@ func PlayRoulette(bet int, selectedNumber int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isWinner(selectedNumber int) bool {
|
func isWinner(selectedNumber int) bool {
|
||||||
|
rouletteNumberMes := "Roulette number: "
|
||||||
rouletteNumber := (runtime.GetRandom() % 36) + 1
|
rouletteNumber := (runtime.GetRandom() % 36) + 1
|
||||||
runtime.Notify("Roulette number:", rouletteNumber)
|
runtime.Notify(rouletteNumberMes, rouletteNumber)
|
||||||
|
|
||||||
return rouletteNumber == selectedNumber
|
return rouletteNumber == selectedNumber
|
||||||
}
|
}
|
||||||
|
|
1
Roulette/config.json
Executable file
1
Roulette/config.json
Executable file
|
@ -0,0 +1 @@
|
||||||
|
{"name":"Roulette","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":225,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playRoulette","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"selectedNumber","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"FcCvRQaSYi8vaeDWGYxyHVclTxuuvTX5SagRGaoz018rX579K1GGi13EVJHix9iADDni/QSYOPNxH6Y2RzxXpA=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
5
Roulette/go.mod
Normal file
5
Roulette/go.mod
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module Roulette
|
||||||
|
|
||||||
|
go 1.21.5
|
||||||
|
|
||||||
|
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a
|
2
Roulette/go.sum
Normal file
2
Roulette/go.sum
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a h1:1AVlB7TD9HC+PutOO1rzNhJ/6t1ieGX1ULIj2ReH+g4=
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
BIN
Roulette/roulette.nef
Executable file
BIN
Roulette/roulette.nef
Executable file
Binary file not shown.
5
Roulette/roulette.yml
Normal file
5
Roulette/roulette.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
name: Roulette
|
||||||
|
supportedstandards: []
|
||||||
|
events:
|
||||||
|
permissions:
|
||||||
|
- methods: '*'
|
2
SlotMashine/config.json
Normal file → Executable file
2
SlotMashine/config.json
Normal file → Executable file
|
@ -1 +1 @@
|
||||||
{"name":"SlotMashine","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":273,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"roll","offset":146,"parameters":[],"returntype":"Integer","safe":false},{"name":"rollSlot","offset":95,"parameters":[{"name":"bet","type":"Integer"}],"returntype":"Void","safe":false}],"events":[{"name":"Hello world!","parameters":[{"name":"args","type":"Array"}]}]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"BJ8mav1w7idePc0nfCF0RnL07oO9nzJMoAfG5dPpKyFAcnb0ucTLPQLZUD/bkvH0F/oG3DlCHPscCEMz2b2wGg=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
{"name":"SlotMashine","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":273,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"roll","offset":146,"parameters":[],"returntype":"Integer","safe":false},{"name":"rollSlot","offset":95,"parameters":[{"name":"bet","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"rdrreY3/upr3A2Qr3TgakxBqywlvj6JVQ8TAy3g9ZPbV5hfoMJt/h9+g1XaF+P03dF8FVy6oir17GPrWSldGVw=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
|
@ -1,11 +1,5 @@
|
||||||
name: SlotMashine
|
name: SlotMashine
|
||||||
sourceurl: http://example.com/
|
|
||||||
safemethods: []
|
|
||||||
supportedstandards: []
|
supportedstandards: []
|
||||||
events:
|
events:
|
||||||
- name: Hello world!
|
|
||||||
parameters:
|
|
||||||
- name: args
|
|
||||||
type: Array
|
|
||||||
permissions:
|
permissions:
|
||||||
- methods: '*'
|
- methods: '*'
|
||||||
|
|
|
@ -2,4 +2,4 @@ module SlotMashine
|
||||||
|
|
||||||
go 1.21.5
|
go 1.21.5
|
||||||
|
|
||||||
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5
|
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5 h1:09CpI5uwsxb1EeFPIKQRwwWlfCmDD/Dwwh01lPiQScM=
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a h1:1AVlB7TD9HC+PutOO1rzNhJ/6t1ieGX1ULIj2ReH+g4=
|
||||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
||||||
|
|
BIN
SlotMashine/slot.nef
Normal file → Executable file
BIN
SlotMashine/slot.nef
Normal file → Executable file
Binary file not shown.
Loading…
Reference in a new issue