native: replace NEP-5 with NEP-17

This commit is contained in:
Evgenii Stratonikov 2020-11-19 18:01:42 +03:00
parent a5914f89fa
commit b97dfae8d8
27 changed files with 195 additions and 134 deletions

View file

@ -15,11 +15,11 @@ func Init() bool {
h := runtime.GetExecutingScriptHash()
amount := totalSupply
storage.Put(ctx, h, amount)
runtime.Notify("transfer", []byte{}, h, amount)
runtime.Notify("Transfer", []byte{}, h, amount)
return true
}
func Transfer(from, to []byte, amount int) bool {
func Transfer(from, to []byte, amount int, data interface{}) bool {
ctx := storage.GetContext()
if len(from) != 20 {
runtime.Log("invalid 'from' address")
@ -54,7 +54,7 @@ func Transfer(from, to []byte, amount int) bool {
toBalance += amount
storage.Put(ctx, to, toBalance)
runtime.Notify("transfer", from, to, amount)
runtime.Notify("Transfer", from, to, amount)
return true
}
@ -74,10 +74,6 @@ func BalanceOf(addr []byte) int {
return amount
}
func Name() string {
return "Rubl"
}
func Symbol() string {
return "RUB"
}