web3-n3/commands.sh
Denis Kirillov 190d272daa NFT lecture material
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2024-12-16 17:29:49 +03:00

56 lines
5.7 KiB
Bash

#!/bin/bash
# d2a4cff31913016155e38e474a2c06d08be276cf
neo-go wallet nep17 balance --token GAS -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json
####################
# Custom NFT nep11 #
####################
neo-go contract compile -i nep11/contract.go -o nep11/contract.nef -m nep11/contract.manifest.json -c nep11/contract.yml
neo-go contract deploy -i nep11/contract.nef -m nep11/contract.manifest.json -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json [ NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk ] # d9ab2450c7cc775f747cde591a65c4735c97831c NNWjkFL2TneXjgbHbNPEooiEpxb9KqDnoF
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c symbol | jq -r '.stack[0].value' | base64 -d && echo
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c decimals
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c totalSupply
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c balanceOf NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk # NivQRezLwGP8xFPr87DD5XaYGUKK3BMsTa
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c tokensOfList NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk | jq -r '.stack[].value | .[].value' | base64 -d | xxd -ps -c 32
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c properties bytes:55d14c99e63092ecd8492180de6e672b539e8dc23eebea5708722a4458e04270 | jq -r '.stack[].value | .[] .value.value' | while IFS=$'\n' read -r line; do echo $line |base64 -d && echo ; done
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c ownerOf bytes:55d14c99e63092ecd8492180de6e672b539e8dc23eebea5708722a4458e04270 | jq -r '.stack[0].value' | base64 -d | xxd -ps -c 32
neo-go contract testinvokefunction -r http://localhost:30333 d9ab2450c7cc775f747cde591a65c4735c97831c tokensList | jq -r '.stack[].value | .[] .value' | base64 -d | xxd -ps -c 32
neo-go wallet nep17 transfer -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json --from NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk --to NNWjkFL2TneXjgbHbNPEooiEpxb9KqDnoF --amount 20 --token GAS nft-name --await
neo-go wallet nep11 transfer -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json --from NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk --to NivQRezLwGP8xFPr87DD5XaYGUKK3BMsTa --token NICENAMES --id 79aef731091472c4395b63b32b2c00c919b9d9538dc1c990381cc8c4609fe9f8 --await
######################
# Custom Token nep17 #
######################
neo-go contract compile -i nep17/contract.go -o nep17/contract.nef -m nep17/contract.manifest.json -c nep17/contract.yml
neo-go contract deploy -i nep17/contract.nef -m nep17/contract.manifest.json -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json [ NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk 100 ] # 7724e3048f013163e97015f00850da015154af18
neo-go contract testinvokefunction -r http://localhost:30333 7724e3048f013163e97015f00850da015154af18 symbol | jq -r '.stack[0].value' | base64 -d && echo
neo-go contract testinvokefunction -r http://localhost:30333 7724e3048f013163e97015f00850da015154af18 decimals
neo-go contract testinvokefunction -r http://localhost:30333 7724e3048f013163e97015f00850da015154af18 totalSupply
neo-go contract testinvokefunction -r http://localhost:30333 7724e3048f013163e97015f00850da015154af18 balanceOf NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk # NivQRezLwGP8xFPr87DD5XaYGUKK3BMsTa
neo-go wallet nep17 transfer -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json --from NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk --to NivQRezLwGP8xFPr87DD5XaYGUKK3BMsTa --amount 20 --token MYTKN --await
##########
# Market #
##########
#LE ScriptHash to Address NNAwRTMyVYpvJY2bYuM1qruvQaBXuAxyPR for transfer
neo-go contract compile -i market/contract.go -o market/contract.nef -m market/contract.manifest.json -c market/contract.yml
neo-go contract deploy -i market/contract.nef -m market/contract.manifest.json -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json [ NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk 7724e3048f013163e97015f00850da015154af18 d9ab2450c7cc775f747cde591a65c4735c97831c ] # 7724e3048f013163e97015f00850da015154af18
neo-go contract testinvokefunction -r http://localhost:30333 84adbcd44b941e9446a331f12cf2bfecc504c518 list | jq -r '.stack[0].value | .[] .value | .[] .value.value' | while IFS=$'\n' read -r line; do echo $line |base64 -d && echo ; done
neo-go wallet nep11 transfer -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json --from NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk --to NNAwRTMyVYpvJY2bYuM1qruvQaBXuAxyPR --token d9ab2450c7cc775f747cde591a65c4735c97831c --id cec6d08d9f18169e74e4540566994ea81cac2df30a298229f50262459b4cd3fc --await
neo-go wallet nep17 transfer -r http://localhost:30333 -w /path/to/frostfs-aio/wallets/wallet1.json --from NhCHDEtGgSph1v6PmjFC1gtzJWNKtNSadk --to NNAwRTMyVYpvJY2bYuM1qruvQaBXuAxyPR --amount 10 --token 7724e3048f013163e97015f00850da015154af18 bytes:cec6d08d9f18169e74e4540566994ea81cac2df30a298229f50262459b4cd3fc --await
############
# Wrappers #
############
neo-go contract generate-rpcwrapper -o wrappers/nep11/rpc_wrapper.go -m nep11/contract.manifest.json -c nep11/contract.yml --hash d9ab2450c7cc775f747cde591a65c4735c97831c
neo-go contract generate-rpcwrapper -o wrappers/nep11/rpc_wrapper.go -m nep11/contract.manifest.json -c nep11/contract.yml
neo-go contract generate-rpcwrapper -o wrappers/nep17/rpc_wrapper.go -m nep17/contract.manifest.json -c nep17/contract.yml
neo-go contract generate-rpcwrapper -o wrappers/market/rpc_wrapper.go -m market/contract.manifest.json -c market/contract.yml