Загрузить файлы в «/»
This commit is contained in:
parent
a5e739d1d0
commit
8cf5528c0c
1 changed files with 13 additions and 3 deletions
16
contract.go
16
contract.go
|
@ -6,7 +6,6 @@ import (
|
|||
"github.com/go-resty/resty/v2"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/gas"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
||||
"strconv"
|
||||
|
@ -119,8 +118,19 @@ func Transfer(address interop.Hash160, amount int, fromToken string, toToken str
|
|||
|
||||
UpdateWallet(address, wallet)
|
||||
|
||||
runtime.Log("Exchange successful: " + std.Itoa10(amount) + " " + fromToken +
|
||||
" exchanged for " + std.Itoa10(int(convertedAmount)) + " " + toToken)
|
||||
runtime.Log("Exchange successful: " + strconv.Itoa(amount) + " " + fromToken +
|
||||
" exchanged for " + strconv.Itoa(int(convertedAmount)) + " " + toToken)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func printBalance(address interop.Hash160) bool {
|
||||
wallet := GetWallet(address)
|
||||
runtime.Log("Balance: ")
|
||||
|
||||
for key, value := range wallet.Tokens {
|
||||
runtime.Log(key + ": " + strconv.Itoa(value))
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue