From ec1ff42872c4a44345386cb0565160de13f3b555 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 10 Dec 2020 18:04:49 +0300 Subject: [PATCH] manifest: add `Safe` flag for NEP-17 methods --- examples/token-sale/token_sale.yml | 1 + examples/token/token.yml | 1 + pkg/smartcontract/manifest/standard/nep17.go | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/examples/token-sale/token_sale.yml b/examples/token-sale/token_sale.yml index bda6ba182..20ea78365 100644 --- a/examples/token-sale/token_sale.yml +++ b/examples/token-sale/token_sale.yml @@ -1,5 +1,6 @@ name: "My awesome token" supportedstandards: ["NEP-17"] +safemethods: ["balanceOf", "decimals", "symbol", "totalSupply"] events: - name: Transfer parameters: diff --git a/examples/token/token.yml b/examples/token/token.yml index 32fd428b5..071976019 100644 --- a/examples/token/token.yml +++ b/examples/token/token.yml @@ -1,5 +1,6 @@ name: "Awesome NEO Token" supportedstandards: ["NEP-17"] +safemethods: ["balanceOf", "decimals", "symbol", "totalSupply"] events: - name: Transfer parameters: diff --git a/pkg/smartcontract/manifest/standard/nep17.go b/pkg/smartcontract/manifest/standard/nep17.go index ff76c4199..098ce6cfc 100644 --- a/pkg/smartcontract/manifest/standard/nep17.go +++ b/pkg/smartcontract/manifest/standard/nep17.go @@ -14,18 +14,22 @@ var nep17 = &manifest.Manifest{ {Type: smartcontract.Hash160Type}, }, ReturnType: smartcontract.IntegerType, + Safe: true, }, { Name: "decimals", ReturnType: smartcontract.IntegerType, + Safe: true, }, { Name: "symbol", ReturnType: smartcontract.StringType, + Safe: true, }, { Name: "totalSupply", ReturnType: smartcontract.IntegerType, + Safe: true, }, { Name: "transfer",