Merge pull request #2841 from nspcc-dev/more-robust-divisible-check

rpcsrv: use more robust NEP-11 divisibility check
This commit is contained in:
Roman Khimov 2022-12-12 14:05:24 +07:00 committed by GitHub
commit 515cbf6a80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/callflag"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest/standard"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm"
@ -931,7 +932,7 @@ contract_loop:
if cs == nil {
continue
}
isDivisible := (cs.Manifest.ABI.GetMethod("balanceOf", 2) != nil)
isDivisible := (standard.ComplyABI(&cs.Manifest, standard.Nep11Divisible) == nil)
lub, ok := lastUpdated[cs.ID]
if !ok {
cfg := s.chain.GetConfig()