package native_test

import (
	"bytes"
	"encoding/json"
	"fmt"
	"slices"
	"strings"
	"testing"

	ojson "git.marketally.com/tutus-one/tutus-ordered-json"
	"git.marketally.com/tutus-one/tutus-chain/internal/contracts"
	"git.marketally.com/tutus-one/tutus-chain/pkg/compiler"
	"git.marketally.com/tutus-one/tutus-chain/pkg/config"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/chaindump"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/interop/interopnames"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/native"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/native/nativehashes"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/native/nativenames"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/state"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/storage"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/storage/dbconfig"
	"git.marketally.com/tutus-one/tutus-chain/pkg/core/transaction"
	"git.marketally.com/tutus-one/tutus-chain/pkg/crypto/keys"
	"git.marketally.com/tutus-one/tutus-chain/pkg/io"
	"git.marketally.com/tutus-one/tutus-chain/pkg/tutustest"
	"git.marketally.com/tutus-one/tutus-chain/pkg/tutustest/chain"
	"git.marketally.com/tutus-one/tutus-chain/pkg/smartcontract"
	"git.marketally.com/tutus-one/tutus-chain/pkg/smartcontract/callflag"
	"git.marketally.com/tutus-one/tutus-chain/pkg/smartcontract/manifest"
	"git.marketally.com/tutus-one/tutus-chain/pkg/smartcontract/nef"
	"git.marketally.com/tutus-one/tutus-chain/pkg/smartcontract/trigger"
	"git.marketally.com/tutus-one/tutus-chain/pkg/util"
	"git.marketally.com/tutus-one/tutus-chain/pkg/vm/emit"
	"git.marketally.com/tutus-one/tutus-chain/pkg/vm/opcode"
	"git.marketally.com/tutus-one/tutus-chain/pkg/vm/stackitem"
	"git.marketally.com/tutus-one/tutus-chain/pkg/vm/vmstate"
	"github.com/stretchr/testify/require"
)

var (
	// defaultCSS holds serialized native contract states built for genesis block (with UpdateCounter 0)
	// under assumption that all hardforks are disabled.
	defaultCSS = map[string]string{
		nativenames.Management:  `{"id":-1,"hash":"0xfffdc93764dbaddd97c48f252a53ea4643faa3fd","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1094259016},"manifest":{"name":"ContractManagement","abi":{"methods":[{"name":"deploy","offset":0,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"}],"returntype":"Array","safe":false},{"name":"deploy","offset":7,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Array","safe":false},{"name":"destroy","offset":14,"parameters":[],"returntype":"Void","safe":false},{"name":"getContract","offset":21,"parameters":[{"name":"hash","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getContractById","offset":28,"parameters":[{"name":"id","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getContractHashes","offset":35,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getMinimumDeploymentFee","offset":42,"parameters":[],"returntype":"Integer","safe":true},{"name":"hasMethod","offset":49,"parameters":[{"name":"hash","type":"Hash160"},{"name":"method","type":"String"},{"name":"pcount","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"setMinimumDeploymentFee","offset":56,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"update","offset":63,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"update","offset":70,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[{"name":"Deploy","parameters":[{"name":"Hash","type":"Hash160"}]},{"name":"Update","parameters":[{"name":"Hash","type":"Hash160"}]},{"name":"Destroy","parameters":[{"name":"Hash","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.StdLib:      `{"id":-2,"hash":"0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1991619121},"manifest":{"name":"StdLib","abi":{"methods":[{"name":"atoi","offset":0,"parameters":[{"name":"value","type":"String"}],"returntype":"Integer","safe":true},{"name":"atoi","offset":7,"parameters":[{"name":"value","type":"String"},{"name":"base","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"base58CheckDecode","offset":14,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58CheckEncode","offset":21,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base58Decode","offset":28,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58Encode","offset":35,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base64Decode","offset":42,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base64Encode","offset":49,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"deserialize","offset":56,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"itoa","offset":63,"parameters":[{"name":"value","type":"Integer"}],"returntype":"String","safe":true},{"name":"itoa","offset":70,"parameters":[{"name":"value","type":"Integer"},{"name":"base","type":"Integer"}],"returntype":"String","safe":true},{"name":"jsonDeserialize","offset":77,"parameters":[{"name":"json","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"jsonSerialize","offset":84,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"memoryCompare","offset":91,"parameters":[{"name":"str1","type":"ByteArray"},{"name":"str2","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":98,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":105,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":112,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"},{"name":"backward","type":"Boolean"}],"returntype":"Integer","safe":true},{"name":"serialize","offset":119,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"strLen","offset":126,"parameters":[{"name":"str","type":"String"}],"returntype":"Integer","safe":true},{"name":"stringSplit","offset":133,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"}],"returntype":"Array","safe":true},{"name":"stringSplit","offset":140,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"},{"name":"removeEmptyEntries","type":"Boolean"}],"returntype":"Array","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.CryptoLib:   `{"id":-3,"hash":"0x726cb6e0cd8628a1350a611384688911ab75f51b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":2135988409},"manifest":{"name":"CryptoLib","abi":{"methods":[{"name":"bls12381Add","offset":0,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Deserialize","offset":7,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Equal","offset":14,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"Boolean","safe":true},{"name":"bls12381Mul","offset":21,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"mul","type":"ByteArray"},{"name":"neg","type":"Boolean"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Pairing","offset":28,"parameters":[{"name":"g1","type":"InteropInterface"},{"name":"g2","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Serialize","offset":35,"parameters":[{"name":"g","type":"InteropInterface"}],"returntype":"ByteArray","safe":true},{"name":"murmur32","offset":42,"parameters":[{"name":"data","type":"ByteArray"},{"name":"seed","type":"Integer"}],"returntype":"ByteArray","safe":true},{"name":"ripemd160","offset":49,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"sha256","offset":56,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"verifyWithECDsa","offset":63,"parameters":[{"name":"message","type":"ByteArray"},{"name":"pubkey","type":"ByteArray"},{"name":"signature","type":"ByteArray"},{"name":"curve","type":"Integer"}],"returntype":"Boolean","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Ledger:      `{"id":-4,"hash":"0xda65b600f7124ce6c79950c1772a36403104f2be","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1110259869},"manifest":{"name":"LedgerContract","abi":{"methods":[{"name":"currentHash","offset":0,"parameters":[],"returntype":"Hash256","safe":true},{"name":"currentIndex","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"getBlock","offset":14,"parameters":[{"name":"indexOrHash","type":"ByteArray"}],"returntype":"Array","safe":true},{"name":"getTransaction","offset":21,"parameters":[{"name":"hash","type":"Hash256"}],"returntype":"Array","safe":true},{"name":"getTransactionFromBlock","offset":28,"parameters":[{"name":"blockIndexOrHash","type":"ByteArray"},{"name":"txIndex","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTransactionHeight","offset":35,"parameters":[{"name":"hash","type":"Hash256"}],"returntype":"Integer","safe":true},{"name":"getTransactionSigners","offset":42,"parameters":[{"name":"hash","type":"Hash256"}],"returntype":"Array","safe":true},{"name":"getTransactionVMState","offset":49,"parameters":[{"name":"hash","type":"Hash256"}],"returntype":"Integer","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Tutus:       `{"id":-5,"hash":"0x7a8123a18fcbd51f9eba5d50c3bf88bf8f13da88","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":65467259},"manifest":{"name":"Tutus","abi":{"methods":[{"name":"balanceOf","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"decimals","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"getAccountState","offset":14,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAllCandidates","offset":21,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getCandidateVote","offset":28,"parameters":[{"name":"pubKey","type":"PublicKey"}],"returntype":"Integer","safe":true},{"name":"getCandidates","offset":35,"parameters":[],"returntype":"Array","safe":true},{"name":"getCommittee","offset":42,"parameters":[],"returntype":"Array","safe":true},{"name":"getLubPerBlock","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"getNextBlockValidators","offset":56,"parameters":[],"returntype":"Array","safe":true},{"name":"getRegisterPrice","offset":63,"parameters":[],"returntype":"Integer","safe":true},{"name":"registerCandidate","offset":70,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"setLubPerBlock","offset":77,"parameters":[{"name":"gasPerBlock","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setRegisterPrice","offset":84,"parameters":[{"name":"registerPrice","type":"Integer"}],"returntype":"Void","safe":false},{"name":"symbol","offset":91,"parameters":[],"returntype":"String","safe":true},{"name":"totalSupply","offset":98,"parameters":[],"returntype":"Integer","safe":true},{"name":"transfer","offset":105,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false},{"name":"unclaimedLub","offset":112,"parameters":[{"name":"account","type":"Hash160"},{"name":"end","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"unregisterCandidate","offset":119,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"vote","offset":126,"parameters":[{"name":"account","type":"Hash160"},{"name":"voteTo","type":"PublicKey"}],"returntype":"Boolean","safe":false}],"events":[{"name":"Transfer","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"CandidateStateChanged","parameters":[{"name":"pubkey","type":"PublicKey"},{"name":"registered","type":"Boolean"},{"name":"votes","type":"Integer"}]},{"name":"Vote","parameters":[{"name":"account","type":"Hash160"},{"name":"from","type":"PublicKey"},{"name":"to","type":"PublicKey"},{"name":"amount","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-17"],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Lub:         `{"id":-6,"hash":"0xe895bb9370f057a3d47964dd6f14aa5e8615e869","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":2663858513},"manifest":{"name":"Lub","abi":{"methods":[{"name":"balanceOf","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"decimals","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"symbol","offset":14,"parameters":[],"returntype":"String","safe":true},{"name":"totalSupply","offset":21,"parameters":[],"returntype":"Integer","safe":true},{"name":"transfer","offset":28,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false}],"events":[{"name":"Transfer","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-17"],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Policy:      `{"id":-7,"hash":"0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1094259016},"manifest":{"name":"PolicyContract","abi":{"methods":[{"name":"blockAccount","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"getAttributeFee","offset":7,"parameters":[{"name":"attributeType","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getExecFeeFactor","offset":14,"parameters":[],"returntype":"Integer","safe":true},{"name":"getFeePerByte","offset":21,"parameters":[],"returntype":"Integer","safe":true},{"name":"getStoragePrice","offset":28,"parameters":[],"returntype":"Integer","safe":true},{"name":"isBlocked","offset":35,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"setAttributeFee","offset":42,"parameters":[{"name":"attributeType","type":"Integer"},{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setExecFeeFactor","offset":49,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setFeePerByte","offset":56,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setStoragePrice","offset":63,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"unblockAccount","offset":70,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Designation: `{"id":-8,"hash":"0x49cf4e5378ffcd4dec034fd98a174c5491e395e2","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0A=","checksum":983638438},"manifest":{"name":"RoleManagement","abi":{"methods":[{"name":"designateAsRole","offset":0,"parameters":[{"name":"role","type":"Integer"},{"name":"nodes","type":"Array"}],"returntype":"Void","safe":false},{"name":"getDesignatedByRole","offset":7,"parameters":[{"name":"role","type":"Integer"},{"name":"index","type":"Integer"}],"returntype":"Array","safe":true}],"events":[{"name":"Designation","parameters":[{"name":"Role","type":"Integer"},{"name":"BlockIndex","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Oracle:      `{"id":-9,"hash":"0xfe924b7cfe89ddd271abaf7210a80a7e11178758","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":2663858513},"manifest":{"name":"OracleContract","abi":{"methods":[{"name":"finish","offset":0,"parameters":[],"returntype":"Void","safe":false},{"name":"getPrice","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"request","offset":14,"parameters":[{"name":"url","type":"String"},{"name":"filter","type":"String"},{"name":"callback","type":"String"},{"name":"userData","type":"Any"},{"name":"gasForResponse","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setPrice","offset":21,"parameters":[{"name":"price","type":"Integer"}],"returntype":"Void","safe":false},{"name":"verify","offset":28,"parameters":[],"returntype":"Boolean","safe":true}],"events":[{"name":"OracleRequest","parameters":[{"name":"Id","type":"Integer"},{"name":"RequestContract","type":"Hash160"},{"name":"Url","type":"String"},{"name":"Filter","type":"String"}]},{"name":"OracleResponse","parameters":[{"name":"Id","type":"Integer"},{"name":"OriginalTx","type":"Hash256"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Vita:  `{"id":-12,"hash":"0xde437f043fdfb8f9c8241acb82d0791dd4b3217d","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":2426471238},"manifest":{"name":"Vita","abi":{"methods":[{"name":"approveRecovery","offset":0,"parameters":[{"name":"requestId","type":"ByteArray"}],"returntype":"Boolean","safe":false},{"name":"cancelRecovery","offset":7,"parameters":[{"name":"requestId","type":"ByteArray"}],"returntype":"Boolean","safe":false},{"name":"createChallenge","offset":14,"parameters":[{"name":"owner","type":"Hash160"},{"name":"purpose","type":"String"}],"returntype":"Array","safe":false},{"name":"executeRecovery","offset":21,"parameters":[{"name":"requestId","type":"ByteArray"}],"returntype":"Boolean","safe":false},{"name":"exists","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"fulfillChallenge","offset":35,"parameters":[{"name":"challengeId","type":"ByteArray"},{"name":"signature","type":"ByteArray"}],"returntype":"Boolean","safe":false},{"name":"getAttribute","offset":42,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"}],"returntype":"Array","safe":true},{"name":"getChallenge","offset":49,"parameters":[{"name":"challengeId","type":"ByteArray"}],"returntype":"Array","safe":true},{"name":"getRecoveryRequest","offset":56,"parameters":[{"name":"requestId","type":"ByteArray"}],"returntype":"Array","safe":true},{"name":"getToken","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getTokenByID","offset":70,"parameters":[{"name":"tokenId","type":"Integer"}],"returntype":"Array","safe":true},{"name":"initiateRecovery","offset":77,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"newOwner","type":"Hash160"},{"name":"evidence","type":"ByteArray"}],"returntype":"ByteArray","safe":false},{"name":"register","offset":84,"parameters":[{"name":"owner","type":"Hash160"},{"name":"personHash","type":"ByteArray"},{"name":"isEntity","type":"Boolean"},{"name":"recoveryHash","type":"ByteArray"},{"name":"birthTimestamp","type":"Integer"}],"returntype":"ByteArray","safe":false},{"name":"reinstate","offset":91,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"requireCoreRole","offset":98,"parameters":[{"name":"coreRole","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"requirePermission","offset":105,"parameters":[{"name":"resource","type":"String"},{"name":"action","type":"String"},{"name":"scope","type":"String"}],"returntype":"Integer","safe":true},{"name":"requireRole","offset":112,"parameters":[{"name":"roleId","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"revoke","offset":119,"parameters":[{"name":"owner","type":"Hash160"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"revokeAttribute","offset":126,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"setAttribute","offset":133,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"},{"name":"valueHash","type":"ByteArray"},{"name":"valueEnc","type":"ByteArray"},{"name":"expiresAt","type":"Integer"},{"name":"disclosureLevel","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"suspend","offset":140,"parameters":[{"name":"owner","type":"Hash160"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"totalSupply","offset":147,"parameters":[],"returntype":"Integer","safe":true},{"name":"validateCaller","offset":154,"parameters":[],"returntype":"Array","safe":true},{"name":"verifyAttribute","offset":161,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"},{"name":"expectedHash","type":"ByteArray"}],"returntype":"Boolean","safe":true},{"name":"verifyAuth","offset":168,"parameters":[{"name":"tokenId","type":"Integer"},{"name":"purpose","type":"String"},{"name":"maxAge","type":"Integer"}],"returntype":"Boolean","safe":true}],"events":[{"name":"VitaCreated","parameters":[{"name":"tokenId","type":"ByteArray"},{"name":"owner","type":"Hash160"},{"name":"createdAt","type":"Integer"}]},{"name":"VitaSuspended","parameters":[{"name":"tokenId","type":"ByteArray"},{"name":"reason","type":"String"},{"name":"suspendedBy","type":"Hash160"}]},{"name":"VitaReinstated","parameters":[{"name":"tokenId","type":"ByteArray"},{"name":"reinstatedBy","type":"Hash160"}]},{"name":"VitaRevoked","parameters":[{"name":"tokenId","type":"ByteArray"},{"name":"reason","type":"String"},{"name":"revokedBy","type":"Hash160"}]},{"name":"AttributeSet","parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"},{"name":"attestor","type":"Hash160"},{"name":"expiresAt","type":"Integer"}]},{"name":"AttributeRevoked","parameters":[{"name":"tokenId","type":"Integer"},{"name":"key","type":"String"},{"name":"revokedBy","type":"Hash160"},{"name":"reason","type":"String"}]},{"name":"AuthChallengeCreated","parameters":[{"name":"challengeId","type":"ByteArray"},{"name":"tokenId","type":"Integer"},{"name":"purpose","type":"String"},{"name":"expiresAt","type":"Integer"}]},{"name":"AuthenticationSuccess","parameters":[{"name":"tokenId","type":"Integer"},{"name":"purpose","type":"String"},{"name":"timestamp","type":"Integer"}]},{"name":"RecoveryInitiated","parameters":[{"name":"tokenId","type":"Integer"},{"name":"requestId","type":"ByteArray"},{"name":"delayUntil","type":"Integer"}]},{"name":"RecoveryApproval","parameters":[{"name":"requestId","type":"ByteArray"},{"name":"approver","type":"Hash160"},{"name":"approvalCount","type":"Integer"},{"name":"required","type":"Integer"}]},{"name":"RecoveryExecuted","parameters":[{"name":"tokenId","type":"Integer"},{"name":"oldOwner","type":"Hash160"},{"name":"newOwner","type":"Hash160"}]},{"name":"RecoveryCancelled","parameters":[{"name":"requestId","type":"ByteArray"},{"name":"cancelledBy","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.RoleRegistry: `{"id":-13,"hash":"0x52200161c6f0b581b590d41af8ccc577dc7477a9","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":174904780},"manifest":{"name":"RoleRegistry","abi":{"methods":[{"name":"assignPermission","offset":0,"parameters":[{"name":"roleID","type":"Integer"},{"name":"resource","type":"String"},{"name":"action","type":"String"},{"name":"scope","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"createRole","offset":7,"parameters":[{"name":"name","type":"String"},{"name":"description","type":"String"},{"name":"parentID","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"deleteRole","offset":14,"parameters":[{"name":"roleID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"getPermissions","offset":21,"parameters":[{"name":"roleID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getRole","offset":28,"parameters":[{"name":"roleID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getRoleByName","offset":35,"parameters":[{"name":"name","type":"String"}],"returntype":"Array","safe":true},{"name":"getRolesForAddress","offset":42,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"grantRole","offset":49,"parameters":[{"name":"address","type":"Hash160"},{"name":"roleID","type":"Integer"},{"name":"expiresAt","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"hasPermission","offset":56,"parameters":[{"name":"address","type":"Hash160"},{"name":"resource","type":"String"},{"name":"action","type":"String"},{"name":"scope","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"hasRole","offset":63,"parameters":[{"name":"address","type":"Hash160"},{"name":"roleID","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"removePermission","offset":70,"parameters":[{"name":"roleID","type":"Integer"},{"name":"resource","type":"String"},{"name":"action","type":"String"}],"returntype":"Boolean","safe":false},{"name":"revokeRole","offset":77,"parameters":[{"name":"address","type":"Hash160"},{"name":"roleID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"totalRoles","offset":84,"parameters":[],"returntype":"Integer","safe":true}],"events":[{"name":"RoleCreated","parameters":[{"name":"roleID","type":"Integer"},{"name":"name","type":"String"},{"name":"parentID","type":"Integer"},{"name":"createdBy","type":"Hash160"}]},{"name":"RoleDeleted","parameters":[{"name":"roleID","type":"Integer"},{"name":"deletedBy","type":"Hash160"}]},{"name":"RoleGranted","parameters":[{"name":"address","type":"Hash160"},{"name":"roleID","type":"Integer"},{"name":"expiresAt","type":"Integer"},{"name":"grantedBy","type":"Hash160"}]},{"name":"RoleRevoked","parameters":[{"name":"address","type":"Hash160"},{"name":"roleID","type":"Integer"},{"name":"revokedBy","type":"Hash160"}]},{"name":"PermissionAssigned","parameters":[{"name":"roleID","type":"Integer"},{"name":"resource","type":"String"},{"name":"action","type":"String"},{"name":"scope","type":"Integer"}]},{"name":"PermissionRemoved","parameters":[{"name":"roleID","type":"Integer"},{"name":"resource","type":"String"},{"name":"action","type":"String"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.VTS:          `{"id":-14,"hash":"0x893659b7f9d0a383d960234841ff8a6d825e3468","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":3508376793},"manifest":{"name":"VTS","abi":{"methods":[{"name":"balanceDetails","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"balanceOf","offset":7,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"burn","offset":14,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"canSpendAt","offset":21,"parameters":[{"name":"account","type":"Hash160"},{"name":"vendor","type":"Hash160"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"convertToUnrestricted","offset":28,"parameters":[{"name":"account","type":"Hash160"},{"name":"category","type":"Integer"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"deactivateVendor","offset":35,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"decimals","offset":42,"parameters":[],"returntype":"Integer","safe":true},{"name":"getDeductibleExpenses","offset":49,"parameters":[{"name":"account","type":"Hash160"},{"name":"startBlock","type":"Integer"},{"name":"endBlock","type":"Integer"},{"name":"category","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getIncomeForPeriod","offset":56,"parameters":[{"name":"account","type":"Hash160"},{"name":"startBlock","type":"Integer"},{"name":"endBlock","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getTaxConfig","offset":63,"parameters":[],"returntype":"Array","safe":true},{"name":"getTaxSummary","offset":70,"parameters":[{"name":"account","type":"Hash160"},{"name":"startBlock","type":"Integer"},{"name":"endBlock","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTaxWithheld","offset":77,"parameters":[{"name":"account","type":"Hash160"},{"name":"startBlock","type":"Integer"},{"name":"endBlock","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getTransactions","offset":84,"parameters":[{"name":"account","type":"Hash160"},{"name":"startBlock","type":"Integer"},{"name":"endBlock","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getVendor","offset":91,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getVendorCategories","offset":98,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"isVendor","offset":105,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"issueTaxRefund","offset":112,"parameters":[{"name":"account","type":"Hash160"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"mint","offset":119,"parameters":[{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"mintRestricted","offset":126,"parameters":[{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"category","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"payWage","offset":133,"parameters":[{"name":"employer","type":"Hash160"},{"name":"employee","type":"Hash160"},{"name":"grossAmount","type":"Integer"},{"name":"taxRate","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"registerVendor","offset":140,"parameters":[{"name":"address","type":"Hash160"},{"name":"name","type":"String"},{"name":"categories","type":"Integer"},{"name":"ageRestricted","type":"Boolean"}],"returntype":"Boolean","safe":false},{"name":"restrictedBalanceOf","offset":147,"parameters":[{"name":"account","type":"Hash160"},{"name":"category","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"setTaxConfig","offset":154,"parameters":[{"name":"incomeRate","type":"Integer"},{"name":"salesRate","type":"Integer"},{"name":"treasuryAddress","type":"Hash160"},{"name":"exemptCategories","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"spend","offset":161,"parameters":[{"name":"from","type":"Hash160"},{"name":"vendor","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false},{"name":"symbol","offset":168,"parameters":[],"returntype":"String","safe":true},{"name":"totalSupply","offset":175,"parameters":[],"returntype":"Integer","safe":true},{"name":"transfer","offset":182,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false},{"name":"unrestrictedBalanceOf","offset":189,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"updateVendor","offset":196,"parameters":[{"name":"address","type":"Hash160"},{"name":"name","type":"String"},{"name":"categories","type":"Integer"},{"name":"ageRestricted","type":"Boolean"}],"returntype":"Boolean","safe":false}],"events":[{"name":"Transfer","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"Mint","parameters":[{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"category","type":"Integer"}]},{"name":"Burn","parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"Spend","parameters":[{"name":"from","type":"Hash160"},{"name":"vendor","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"categoriesUsed","type":"Integer"}]},{"name":"VendorRegistered","parameters":[{"name":"address","type":"Hash160"},{"name":"name","type":"String"},{"name":"categories","type":"Integer"},{"name":"ageRestricted","type":"Boolean"}]},{"name":"VendorUpdated","parameters":[{"name":"address","type":"Hash160"},{"name":"name","type":"String"},{"name":"categories","type":"Integer"},{"name":"ageRestricted","type":"Boolean"}]},{"name":"VendorDeactivated","parameters":[{"name":"address","type":"Hash160"}]},{"name":"TaxWithheld","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"grossAmount","type":"Integer"},{"name":"taxAmount","type":"Integer"},{"name":"taxRate","type":"Integer"}]},{"name":"TaxRefunded","parameters":[{"name":"account","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"ConvertedToUnrestricted","parameters":[{"name":"account","type":"Hash160"},{"name":"category","type":"Integer"},{"name":"amount","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-17"],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Lex:          `{"id":-16,"hash":"0xe696922df6c6ded4c468bec2b1ef170805b73f2e","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":1841570703},"manifest":{"name":"Lex","abi":{"methods":[{"name":"enactLaw","offset":0,"parameters":[{"name":"name","type":"String"},{"name":"contentHash","type":"Hash256"},{"name":"category","type":"Integer"},{"name":"jurisdiction","type":"Integer"},{"name":"parentID","type":"Integer"},{"name":"effectiveAt","type":"Integer"},{"name":"enforcement","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"getAllConstitutionalRights","offset":7,"parameters":[],"returntype":"Array","safe":true},{"name":"getConstitutionalRight","offset":14,"parameters":[{"name":"rightID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getLaw","offset":21,"parameters":[{"name":"lawID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getLawByName","offset":28,"parameters":[{"name":"name","type":"String"}],"returntype":"Array","safe":true},{"name":"getLawCount","offset":35,"parameters":[],"returntype":"Integer","safe":true},{"name":"getRestriction","offset":42,"parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getSubjectRestrictions","offset":49,"parameters":[{"name":"subject","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"hasRight","offset":56,"parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"isLawActive","offset":63,"parameters":[{"name":"lawID","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"isRestricted","offset":70,"parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"liftRestriction","offset":77,"parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"reinstateLaw","offset":84,"parameters":[{"name":"lawID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"repealLaw","offset":91,"parameters":[{"name":"lawID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"restrictRight","offset":98,"parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"},{"name":"restrictionType","type":"Integer"},{"name":"duration","type":"Integer"},{"name":"reason","type":"String"},{"name":"caseID","type":"Hash256"}],"returntype":"Boolean","safe":false},{"name":"suspendLaw","offset":105,"parameters":[{"name":"lawID","type":"Integer"},{"name":"reason","type":"String"},{"name":"duration","type":"Integer"}],"returntype":"Boolean","safe":false}],"events":[{"name":"LawEnacted","parameters":[{"name":"lawID","type":"Integer"},{"name":"name","type":"String"},{"name":"category","type":"Integer"},{"name":"enactedBy","type":"Hash160"}]},{"name":"LawRepealed","parameters":[{"name":"lawID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"LawSuspended","parameters":[{"name":"lawID","type":"Integer"},{"name":"reason","type":"String"},{"name":"duration","type":"Integer"}]},{"name":"LawReinstated","parameters":[{"name":"lawID","type":"Integer"}]},{"name":"RightRestricted","parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"},{"name":"restrictionType","type":"Integer"},{"name":"expiresAt","type":"Integer"},{"name":"caseID","type":"Hash256"}]},{"name":"RestrictionLifted","parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"RightViolation","parameters":[{"name":"subject","type":"Hash160"},{"name":"rightID","type":"Integer"},{"name":"action","type":"String"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Eligere:      `{"id":-17,"hash":"0x4007e5a8b3d7eace2ae0abffa0c56bab8e739401","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":2135988409},"manifest":{"name":"Eligere","abi":{"methods":[{"name":"cancelProposal","offset":0,"parameters":[{"name":"proposalID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"createProposal","offset":7,"parameters":[{"name":"title","type":"String"},{"name":"contentHash","type":"ByteArray"},{"name":"category","type":"Integer"},{"name":"votingStartsAt","type":"Integer"},{"name":"votingEndsAt","type":"Integer"},{"name":"targetContract","type":"Hash160"},{"name":"targetMethod","type":"String"},{"name":"targetParams","type":"ByteArray"}],"returntype":"Integer","safe":false},{"name":"executeProposal","offset":14,"parameters":[{"name":"proposalID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"getConfig","offset":21,"parameters":[],"returntype":"Array","safe":true},{"name":"getProposal","offset":28,"parameters":[{"name":"proposalID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getProposalCount","offset":35,"parameters":[],"returntype":"Integer","safe":true},{"name":"getVote","offset":42,"parameters":[{"name":"proposalID","type":"Integer"},{"name":"voter","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"hasVoted","offset":49,"parameters":[{"name":"proposalID","type":"Integer"},{"name":"voter","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"tallyVotes","offset":56,"parameters":[{"name":"proposalID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"vote","offset":63,"parameters":[{"name":"proposalID","type":"Integer"},{"name":"choice","type":"Integer"}],"returntype":"Boolean","safe":false}],"events":[{"name":"ProposalCreated","parameters":[{"name":"proposalID","type":"Integer"},{"name":"title","type":"String"},{"name":"category","type":"Integer"},{"name":"proposer","type":"Hash160"},{"name":"votingEndsAt","type":"Integer"}]},{"name":"ProposalActivated","parameters":[{"name":"proposalID","type":"Integer"}]},{"name":"VoteCast","parameters":[{"name":"proposalID","type":"Integer"},{"name":"voterVitaID","type":"Integer"},{"name":"choice","type":"Integer"}]},{"name":"ProposalPassed","parameters":[{"name":"proposalID","type":"Integer"},{"name":"supportPercent","type":"Integer"},{"name":"totalVotes","type":"Integer"}]},{"name":"ProposalRejected","parameters":[{"name":"proposalID","type":"Integer"},{"name":"supportPercent","type":"Integer"}]},{"name":"ProposalExecuted","parameters":[{"name":"proposalID","type":"Integer"},{"name":"executor","type":"Hash160"},{"name":"executedAt","type":"Integer"}]},{"name":"ProposalCancelled","parameters":[{"name":"proposalID","type":"Integer"},{"name":"cancelledBy","type":"Hash160"}]},{"name":"ProposalExpired","parameters":[{"name":"proposalID","type":"Integer"},{"name":"reason","type":"String"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Scire:        `{"id":-18,"hash":"0x03dea0638e5d6292f89442582daeb8d6d416079f","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1325686241},"manifest":{"name":"Scire","abi":{"methods":[{"name":"allocateCredits","offset":0,"parameters":[{"name":"owner","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"completeEnrollment","offset":7,"parameters":[{"name":"enrollmentID","type":"Integer"},{"name":"contentHash","type":"Hash256"}],"returntype":"Boolean","safe":false},{"name":"createAccount","offset":14,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"enroll","offset":21,"parameters":[{"name":"student","type":"Hash160"},{"name":"programID","type":"String"},{"name":"institution","type":"Hash160"},{"name":"credits","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"getAccount","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAccountByVitaID","offset":35,"parameters":[{"name":"vitaID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getActiveEnrollment","offset":42,"parameters":[{"name":"student","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getCertification","offset":49,"parameters":[{"name":"certID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":56,"parameters":[],"returntype":"Array","safe":true},{"name":"getCredits","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getEnrollment","offset":70,"parameters":[{"name":"enrollmentID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTotalAccounts","offset":77,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalCertifications","offset":84,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalEnrollments","offset":91,"parameters":[],"returntype":"Integer","safe":true},{"name":"hasCertification","offset":98,"parameters":[{"name":"owner","type":"Hash160"},{"name":"certType","type":"String"}],"returntype":"Boolean","safe":true},{"name":"issueCertification","offset":105,"parameters":[{"name":"owner","type":"Hash160"},{"name":"certType","type":"String"},{"name":"name","type":"String"},{"name":"contentHash","type":"Hash256"},{"name":"expiresAt","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"renewCertification","offset":112,"parameters":[{"name":"certID","type":"Integer"},{"name":"newExpiresAt","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"revokeCertification","offset":119,"parameters":[{"name":"certID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"verifyCertification","offset":126,"parameters":[{"name":"certID","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"withdrawEnrollment","offset":133,"parameters":[{"name":"enrollmentID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false}],"events":[{"name":"AccountCreated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"owner","type":"Hash160"}]},{"name":"CreditsAllocated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"amount","type":"Integer"},{"name":"total","type":"Integer"}]},{"name":"EnrollmentCreated","parameters":[{"name":"enrollmentID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"programID","type":"String"}]},{"name":"EnrollmentCompleted","parameters":[{"name":"enrollmentID","type":"Integer"},{"name":"vitaID","type":"Integer"}]},{"name":"EnrollmentWithdrawn","parameters":[{"name":"enrollmentID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"CertificationIssued","parameters":[{"name":"certID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"certType","type":"String"}]},{"name":"CertificationRevoked","parameters":[{"name":"certID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"CertificationRenewed","parameters":[{"name":"certID","type":"Integer"},{"name":"newExpiresAt","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Salus:        `{"id":-19,"hash":"0xc888204ff9eee625dbffbd9f75917b70f66a6e91","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":751055395},"manifest":{"name":"Salus","abi":{"methods":[{"name":"activateHealthcare","offset":0,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"allocateCredits","offset":7,"parameters":[{"name":"owner","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"authorizeAccess","offset":14,"parameters":[{"name":"patient","type":"Hash160"},{"name":"provider","type":"Hash160"},{"name":"accessLevel","type":"Integer"},{"name":"duration","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"emergencyAccess","offset":21,"parameters":[{"name":"patient","type":"Hash160"},{"name":"reason","type":"String"}],"returntype":"Integer","safe":false},{"name":"getAccount","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAccountByVitaID","offset":35,"parameters":[{"name":"vitaID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getAuthorization","offset":42,"parameters":[{"name":"authID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":49,"parameters":[],"returntype":"Array","safe":true},{"name":"getCredits","offset":56,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getEmergencyAccess","offset":63,"parameters":[{"name":"emergencyID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getMedicalRecord","offset":70,"parameters":[{"name":"recordID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getProvider","offset":77,"parameters":[{"name":"providerID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getProviderByAddress","offset":84,"parameters":[{"name":"address","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getTotalAccounts","offset":91,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalProviders","offset":98,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalRecords","offset":105,"parameters":[],"returntype":"Integer","safe":true},{"name":"hasAccess","offset":112,"parameters":[{"name":"patient","type":"Hash160"},{"name":"provider","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"recordMedicalEvent","offset":119,"parameters":[{"name":"patient","type":"Hash160"},{"name":"recordType","type":"Integer"},{"name":"contentHash","type":"Hash256"},{"name":"credits","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"registerProvider","offset":126,"parameters":[{"name":"address","type":"Hash160"},{"name":"name","type":"String"},{"name":"specialty","type":"String"},{"name":"licenseHash","type":"Hash256"}],"returntype":"Integer","safe":false},{"name":"reviewEmergencyAccess","offset":133,"parameters":[{"name":"emergencyID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"revokeAccess","offset":140,"parameters":[{"name":"authID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"suspendProvider","offset":147,"parameters":[{"name":"providerID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false}],"events":[{"name":"HealthcareActivated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"owner","type":"Hash160"}]},{"name":"CreditsAllocated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"amount","type":"Integer"},{"name":"total","type":"Integer"}]},{"name":"MedicalRecordCreated","parameters":[{"name":"recordID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"recordType","type":"Integer"}]},{"name":"ProviderRegistered","parameters":[{"name":"providerID","type":"Integer"},{"name":"address","type":"Hash160"},{"name":"specialty","type":"String"}]},{"name":"ProviderSuspended","parameters":[{"name":"providerID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"AuthorizationGranted","parameters":[{"name":"authID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"provider","type":"Hash160"}]},{"name":"AuthorizationRevoked","parameters":[{"name":"authID","type":"Integer"}]},{"name":"EmergencyAccessGranted","parameters":[{"name":"emergencyID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"provider","type":"Hash160"}]},{"name":"EmergencyAccessReviewed","parameters":[{"name":"emergencyID","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Sese:         `{"id":-20,"hash":"0x48fd247dc41944f72b4b0ef36012fe0239289916","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":88981906},"manifest":{"name":"Sese","abi":{"methods":[{"name":"abandonGoal","offset":0,"parameters":[{"name":"goalID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"activateLifePlan","offset":7,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"allocateSabbaticalCredits","offset":14,"parameters":[{"name":"owner","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"cancelSabbatical","offset":21,"parameters":[{"name":"sabbaticalID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"completeGoal","offset":28,"parameters":[{"name":"goalID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"completeSabbatical","offset":35,"parameters":[{"name":"sabbaticalID","type":"Integer"},{"name":"outcome","type":"String"}],"returntype":"Boolean","safe":false},{"name":"contribute","offset":42,"parameters":[{"name":"owner","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"isEmployer","type":"Boolean"}],"returntype":"Boolean","safe":false},{"name":"createGoal","offset":49,"parameters":[{"name":"owner","type":"Hash160"},{"name":"title","type":"String"},{"name":"description","type":"String"},{"name":"targetBlock","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"endCareer","offset":56,"parameters":[{"name":"careerID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"getAccount","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAccountByVitaID","offset":70,"parameters":[{"name":"vitaID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getActiveCareer","offset":77,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getActiveSabbatical","offset":84,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getBalance","offset":91,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getCareer","offset":98,"parameters":[{"name":"careerID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":105,"parameters":[],"returntype":"Array","safe":true},{"name":"getGoal","offset":112,"parameters":[{"name":"goalID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getMilestone","offset":119,"parameters":[{"name":"milestoneID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getSabbatical","offset":126,"parameters":[{"name":"sabbaticalID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getSabbaticalCredits","offset":133,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getTotalAccounts","offset":140,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalCareers","offset":147,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalGoals","offset":154,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalMilestones","offset":161,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalSabbaticals","offset":168,"parameters":[],"returntype":"Integer","safe":true},{"name":"recordMilestone","offset":175,"parameters":[{"name":"owner","type":"Hash160"},{"name":"milestoneType","type":"Integer"},{"name":"title","type":"String"},{"name":"description","type":"String"},{"name":"contentHash","type":"Hash256"}],"returntype":"Integer","safe":false},{"name":"startCareer","offset":182,"parameters":[{"name":"owner","type":"Hash160"},{"name":"careerField","type":"String"}],"returntype":"Integer","safe":false},{"name":"startSabbatical","offset":189,"parameters":[{"name":"owner","type":"Hash160"},{"name":"purpose","type":"Integer"},{"name":"description","type":"String"},{"name":"duration","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"updateGoalProgress","offset":196,"parameters":[{"name":"goalID","type":"Integer"},{"name":"progress","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"verifyMilestone","offset":203,"parameters":[{"name":"milestoneID","type":"Integer"}],"returntype":"Boolean","safe":false}],"events":[{"name":"LifePlanActivated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"owner","type":"Hash160"}]},{"name":"ContributionMade","parameters":[{"name":"vitaID","type":"Integer"},{"name":"amount","type":"Integer"},{"name":"isEmployer","type":"Boolean"},{"name":"balance","type":"Integer"}]},{"name":"CareerStarted","parameters":[{"name":"careerID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"careerField","type":"String"}]},{"name":"CareerEnded","parameters":[{"name":"careerID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"SabbaticalStarted","parameters":[{"name":"sabbaticalID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"purpose","type":"Integer"}]},{"name":"SabbaticalCompleted","parameters":[{"name":"sabbaticalID","type":"Integer"}]},{"name":"SabbaticalCancelled","parameters":[{"name":"sabbaticalID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"MilestoneRecorded","parameters":[{"name":"milestoneID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"milestoneType","type":"Integer"}]},{"name":"MilestoneVerified","parameters":[{"name":"milestoneID","type":"Integer"}]},{"name":"GoalCreated","parameters":[{"name":"goalID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"title","type":"String"}]},{"name":"GoalUpdated","parameters":[{"name":"goalID","type":"Integer"},{"name":"progress","type":"Integer"}]},{"name":"GoalCompleted","parameters":[{"name":"goalID","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Tribute:      `{"id":-21,"hash":"0x1e49af098f224f28b080ad526d73e3b551bf9b35","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1171474237},"manifest":{"name":"Tribute","abi":{"methods":[{"name":"appealTribute","offset":0,"parameters":[{"name":"assessmentID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"assessTribute","offset":7,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":false},{"name":"claimIncentive","offset":14,"parameters":[{"name":"incentiveID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"collectTribute","offset":21,"parameters":[{"name":"assessmentID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"createVelocityAccount","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"getAccount","offset":35,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAccountByVitaID","offset":42,"parameters":[{"name":"vitaID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getAssessment","offset":49,"parameters":[{"name":"assessmentID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":56,"parameters":[],"returntype":"Array","safe":true},{"name":"getHoardingLevel","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getIncentive","offset":70,"parameters":[{"name":"incentiveID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getPendingAssessment","offset":77,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getRedistribution","offset":84,"parameters":[{"name":"redistID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTotalAccounts","offset":91,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalAssessments","offset":98,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalIncentives","offset":105,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalRedistributions","offset":112,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTributePool","offset":119,"parameters":[],"returntype":"Integer","safe":true},{"name":"getUnclaimedIncentives","offset":126,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getVelocity","offset":133,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"grantExemption","offset":140,"parameters":[{"name":"owner","type":"Hash160"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"grantIncentive","offset":147,"parameters":[{"name":"owner","type":"Hash160"},{"name":"incentiveType","type":"Integer"},{"name":"amount","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Integer","safe":false},{"name":"isExempt","offset":154,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"recordTransaction","offset":161,"parameters":[{"name":"owner","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"isOutflow","type":"Boolean"}],"returntype":"Boolean","safe":false},{"name":"redistribute","offset":168,"parameters":[{"name":"targetCategory","type":"String"},{"name":"recipientCount","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"revokeExemption","offset":175,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"waiveTribute","offset":182,"parameters":[{"name":"assessmentID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false}],"events":[{"name":"VelocityAccountCreated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"owner","type":"Hash160"}]},{"name":"VelocityUpdated","parameters":[{"name":"vitaID","type":"Integer"},{"name":"newVelocity","type":"Integer"},{"name":"hoardingLevel","type":"Integer"}]},{"name":"TributeAssessed","parameters":[{"name":"assessmentID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"amount","type":"Integer"}]},{"name":"TributeCollected","parameters":[{"name":"assessmentID","type":"Integer"},{"name":"amount","type":"Integer"}]},{"name":"TributeWaived","parameters":[{"name":"assessmentID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"TributeAppealed","parameters":[{"name":"assessmentID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"IncentiveGranted","parameters":[{"name":"incentiveID","type":"Integer"},{"name":"vitaID","type":"Integer"},{"name":"amount","type":"Integer"}]},{"name":"IncentiveClaimed","parameters":[{"name":"incentiveID","type":"Integer"},{"name":"amount","type":"Integer"}]},{"name":"RedistributionExecuted","parameters":[{"name":"redistID","type":"Integer"},{"name":"totalAmount","type":"Integer"},{"name":"recipientCount","type":"Integer"}]},{"name":"ExemptionGranted","parameters":[{"name":"vitaID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"ExemptionRevoked","parameters":[{"name":"vitaID","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Opus:         `{"id":-22,"hash":"0xfdb69606e4e5c74708513a7c4dfcab98177322f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":323743677},"manifest":{"name":"Opus","abi":{"methods":[{"name":"addCapability","offset":0,"parameters":[{"name":"workerID","type":"Integer"},{"name":"name","type":"String"},{"name":"category","type":"String"},{"name":"level","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"assignTask","offset":7,"parameters":[{"name":"workerID","type":"Integer"},{"name":"taskType","type":"String"},{"name":"description","type":"String"},{"name":"valueOffered","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"cancelTask","offset":14,"parameters":[{"name":"taskID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"completeTask","offset":21,"parameters":[{"name":"taskID","type":"Integer"},{"name":"resultHash","type":"Hash256"},{"name":"valueCompleted","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"decommissionWorker","offset":28,"parameters":[{"name":"workerID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"failTask","offset":35,"parameters":[{"name":"taskID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"getActiveTask","offset":42,"parameters":[{"name":"workerID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getCapability","offset":49,"parameters":[{"name":"capabilityID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":56,"parameters":[],"returntype":"Array","safe":true},{"name":"getOperator","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getTask","offset":70,"parameters":[{"name":"taskID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTotalCapabilities","offset":77,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalOperators","offset":84,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalTasks","offset":91,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalTribute","offset":98,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalWorkers","offset":105,"parameters":[],"returntype":"Integer","safe":true},{"name":"getWorker","offset":112,"parameters":[{"name":"workerID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getWorkerCountByOperator","offset":119,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"hasCapability","offset":126,"parameters":[{"name":"workerID","type":"Integer"},{"name":"name","type":"String"}],"returntype":"Boolean","safe":true},{"name":"reactivateWorker","offset":133,"parameters":[{"name":"workerID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"registerOperator","offset":140,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"registerWorker","offset":147,"parameters":[{"name":"name","type":"String"},{"name":"description","type":"String"},{"name":"workerType","type":"Integer"},{"name":"modelHash","type":"Hash256"}],"returntype":"Integer","safe":false},{"name":"setConfig","offset":154,"parameters":[{"name":"minTributeRate","type":"Integer"},{"name":"maxTributeRate","type":"Integer"},{"name":"defaultTributeRate","type":"Integer"},{"name":"registrationFee","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"startTask","offset":161,"parameters":[{"name":"taskID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"suspendWorker","offset":168,"parameters":[{"name":"workerID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"updateWorker","offset":175,"parameters":[{"name":"workerID","type":"Integer"},{"name":"description","type":"String"}],"returntype":"Boolean","safe":false},{"name":"verifyCapability","offset":182,"parameters":[{"name":"capabilityID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"verifyOperator","offset":189,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Palam:        `{"id":-23,"hash":"0xae16798853df46b0e2fa8c8dab343a71fa732303","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":1841570703},"manifest":{"name":"Palam","abi":{"methods":[{"name":"approveDeclassify","offset":0,"parameters":[{"name":"requestID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"attachToFlow","offset":7,"parameters":[{"name":"flowID","type":"Hash256"},{"name":"attachmentType","type":"String"},{"name":"encryptedData","type":"ByteArray"}],"returntype":"Integer","safe":false},{"name":"denyDeclassify","offset":14,"parameters":[{"name":"requestID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"getAccessLog","offset":21,"parameters":[{"name":"logID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getAttachment","offset":28,"parameters":[{"name":"attachmentID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getConfig","offset":35,"parameters":[],"returntype":"Array","safe":true},{"name":"getDeclassifyRequest","offset":42,"parameters":[{"name":"requestID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getFlow","offset":49,"parameters":[{"name":"flowID","type":"Hash256"}],"returntype":"Array","safe":false},{"name":"getRolePermissions","offset":56,"parameters":[{"name":"role","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTotalAttachments","offset":63,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalFlows","offset":70,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalLogs","offset":77,"parameters":[],"returntype":"Integer","safe":true},{"name":"getTotalRequests","offset":84,"parameters":[],"returntype":"Integer","safe":true},{"name":"hasDeclassifyGrant","offset":91,"parameters":[{"name":"flowID","type":"Hash256"},{"name":"requester","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"recordFlow","offset":98,"parameters":[{"name":"tag","type":"String"},{"name":"amount","type":"Integer"},{"name":"bucket","type":"String"},{"name":"participants","type":"Array"},{"name":"consumerData","type":"ByteArray"},{"name":"merchantData","type":"ByteArray"},{"name":"distributorData","type":"ByteArray"},{"name":"producerData","type":"ByteArray"},{"name":"ngoData","type":"ByteArray"},{"name":"auditorData","type":"ByteArray"},{"name":"previousFlowID","type":"Hash256"}],"returntype":"Hash256","safe":false},{"name":"requestDeclassify","offset":105,"parameters":[{"name":"flowID","type":"Hash256"},{"name":"caseID","type":"String"},{"name":"reason","type":"String"},{"name":"expirationBlocks","type":"Integer"}],"returntype":"Integer","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Pons:         `{"id":-24,"hash":"0xccdd81357cc7a7532b809a3f928cb8a519d03958","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1991619121},"manifest":{"name":"Pons","abi":{"methods":[{"name":"cancelSettlement","offset":0,"parameters":[{"name":"settlementID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"completeSettlement","offset":7,"parameters":[{"name":"settlementID","type":"Integer"},{"name":"txHash","type":"Hash256"}],"returntype":"Boolean","safe":false},{"name":"createAgreement","offset":14,"parameters":[{"name":"remoteChainID","type":"Integer"},{"name":"agreementType","type":"Integer"},{"name":"termsHash","type":"Hash256"},{"name":"expirationHeight","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"getAgreement","offset":21,"parameters":[{"name":"agreementID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getAgreementCount","offset":28,"parameters":[],"returntype":"Integer","safe":true},{"name":"getConfig","offset":35,"parameters":[],"returntype":"Array","safe":true},{"name":"getCredentialShare","offset":42,"parameters":[{"name":"shareID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getCredentialShareCount","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"getSettlementCount","offset":56,"parameters":[],"returntype":"Integer","safe":true},{"name":"getSettlementRequest","offset":63,"parameters":[{"name":"settlementID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getVerificationCount","offset":70,"parameters":[],"returntype":"Integer","safe":true},{"name":"getVerificationRequest","offset":77,"parameters":[{"name":"requestID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"hasActiveAgreement","offset":84,"parameters":[{"name":"remoteChainID","type":"Integer"},{"name":"agreementType","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"requestSettlement","offset":91,"parameters":[{"name":"toChainID","type":"Integer"},{"name":"receiver","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"reference","type":"String"}],"returntype":"Integer","safe":false},{"name":"requestVerification","offset":98,"parameters":[{"name":"targetChainID","type":"Integer"},{"name":"subject","type":"Hash160"},{"name":"verificationType","type":"Integer"},{"name":"dataHash","type":"Hash256"}],"returntype":"Integer","safe":false},{"name":"respondVerification","offset":105,"parameters":[{"name":"requestID","type":"Integer"},{"name":"approved","type":"Boolean"},{"name":"responseHash","type":"Hash256"}],"returntype":"Boolean","safe":false},{"name":"revokeCredentialShare","offset":112,"parameters":[{"name":"shareID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"setLocalChainID","offset":119,"parameters":[{"name":"chainID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"shareCredential","offset":126,"parameters":[{"name":"targetChainID","type":"Integer"},{"name":"credentialType","type":"Integer"},{"name":"credentialID","type":"Integer"},{"name":"contentHash","type":"Hash256"},{"name":"validUntil","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"updateAgreementStatus","offset":133,"parameters":[{"name":"agreementID","type":"Integer"},{"name":"newStatus","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"verifyCredentialShare","offset":140,"parameters":[{"name":"shareID","type":"Integer"}],"returntype":"Boolean","safe":true}],"events":[{"name":"AgreementCreated","parameters":[{"name":"agreementID","type":"Integer"},{"name":"remoteChainID","type":"Integer"},{"name":"agreementType","type":"Integer"}]},{"name":"AgreementUpdated","parameters":[{"name":"agreementID","type":"Integer"},{"name":"oldStatus","type":"Integer"},{"name":"newStatus","type":"Integer"}]},{"name":"AgreementTerminated","parameters":[{"name":"agreementID","type":"Integer"},{"name":"remoteChainID","type":"Integer"}]},{"name":"VerificationRequested","parameters":[{"name":"requestID","type":"Integer"},{"name":"targetChainID","type":"Integer"},{"name":"subject","type":"Hash160"},{"name":"verificationType","type":"Integer"}]},{"name":"VerificationResponded","parameters":[{"name":"requestID","type":"Integer"},{"name":"approved","type":"Boolean"}]},{"name":"SettlementRequested","parameters":[{"name":"settlementID","type":"Integer"},{"name":"toChainID","type":"Integer"},{"name":"receiver","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"SettlementCompleted","parameters":[{"name":"settlementID","type":"Integer"},{"name":"txHash","type":"Hash256"}]},{"name":"CredentialShared","parameters":[{"name":"shareID","type":"Integer"},{"name":"owner","type":"Hash160"},{"name":"targetChainID","type":"Integer"},{"name":"credentialType","type":"Integer"}]},{"name":"CredentialRevoked","parameters":[{"name":"shareID","type":"Integer"},{"name":"owner","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Collocatio:   `{"id":-25,"hash":"0xf528c65355bc33dd95132969d0a003eaeb859cf9","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":3581846399},"manifest":{"name":"Collocatio","abi":{"methods":[{"name":"activateOpportunity","offset":0,"parameters":[{"name":"opportunityID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"createOpportunity","offset":7,"parameters":[{"name":"oppType","type":"Integer"},{"name":"name","type":"String"},{"name":"description","type":"String"},{"name":"termsHash","type":"Hash256"},{"name":"minParticipants","type":"Integer"},{"name":"maxParticipants","type":"Integer"},{"name":"minInvestment","type":"Integer"},{"name":"maxInvestment","type":"Integer"},{"name":"targetPool","type":"Integer"},{"name":"expectedReturns","type":"Integer"},{"name":"riskLevel","type":"Integer"},{"name":"maturityBlocks","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"getConfig","offset":14,"parameters":[],"returntype":"Array","safe":true},{"name":"getEligibility","offset":21,"parameters":[{"name":"investor","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getInvestment","offset":28,"parameters":[{"name":"investmentID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getInvestmentCount","offset":35,"parameters":[],"returntype":"Integer","safe":true},{"name":"getOpportunity","offset":42,"parameters":[{"name":"opportunityID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getOpportunityCount","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"invest","offset":56,"parameters":[{"name":"opportunityID","type":"Integer"},{"name":"amount","type":"Integer"}],"returntype":"Integer","safe":false},{"name":"isEligible","offset":63,"parameters":[{"name":"investor","type":"Hash160"},{"name":"oppType","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"setEligibility","offset":70,"parameters":[{"name":"investor","type":"Hash160"},{"name":"eligibilityFlags","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"withdraw","offset":77,"parameters":[{"name":"investmentID","type":"Integer"}],"returntype":"Boolean","safe":false}],"events":[{"name":"OpportunityCreated","parameters":[{"name":"opportunityID","type":"Integer"},{"name":"oppType","type":"Integer"},{"name":"creator","type":"Hash160"}]},{"name":"OpportunityActivated","parameters":[{"name":"opportunityID","type":"Integer"}]},{"name":"InvestmentMade","parameters":[{"name":"investmentID","type":"Integer"},{"name":"opportunityID","type":"Integer"},{"name":"investor","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"InvestmentWithdrawn","parameters":[{"name":"investmentID","type":"Integer"},{"name":"returnAmount","type":"Integer"}]},{"name":"EligibilityUpdated","parameters":[{"name":"investor","type":"Hash160"},{"name":"eligibility","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Annos:        `{"id":-26,"hash":"0xf8cac87eaa3614e3a7ee5198d992531a3a31adaa","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":174904780},"manifest":{"name":"Annos","abi":{"methods":[{"name":"getAge","offset":0,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getAgeAtTime","offset":7,"parameters":[{"name":"owner","type":"Hash160"},{"name":"timestamp","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getBirthTimestamp","offset":14,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getConfig","offset":21,"parameters":[],"returntype":"Array","safe":true},{"name":"getLifeStage","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getRecord","offset":35,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getRecordByVitaID","offset":42,"parameters":[{"name":"vitaID","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getTotalRecords","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"isAdult","offset":56,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"isAlive","offset":63,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"isRetirementAge","offset":70,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"isVotingAge","offset":77,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"recordDeath","offset":84,"parameters":[{"name":"vitaID","type":"Integer"},{"name":"deathTimestamp","type":"Integer"}],"returntype":"Boolean","safe":false}],"events":[{"name":"BirthRegistered","parameters":[{"name":"vitaID","type":"Integer"},{"name":"owner","type":"Hash160"},{"name":"birthTimestamp","type":"Integer"}]},{"name":"DeathRecorded","parameters":[{"name":"vitaID","type":"Integer"},{"name":"deathTimestamp","type":"Integer"}]},{"name":"LifeStageChanged","parameters":[{"name":"vitaID","type":"Integer"},{"name":"previousStage","type":"Integer"},{"name":"newStage","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
	}
	// cockatriceCSS holds serialized native contract states built for genesis block (with UpdateCounter 0)
	// under assumption that hardforks from Aspidochelone to Cockatrice (included) are enabled.
	cockatriceCSS = map[string]string{
		nativenames.CryptoLib: `{"id":-3,"hash":"0x726cb6e0cd8628a1350a611384688911ab75f51b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1094259016},"manifest":{"name":"CryptoLib","abi":{"methods":[{"name":"bls12381Add","offset":0,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Deserialize","offset":7,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Equal","offset":14,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"Boolean","safe":true},{"name":"bls12381Mul","offset":21,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"mul","type":"ByteArray"},{"name":"neg","type":"Boolean"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Pairing","offset":28,"parameters":[{"name":"g1","type":"InteropInterface"},{"name":"g2","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Serialize","offset":35,"parameters":[{"name":"g","type":"InteropInterface"}],"returntype":"ByteArray","safe":true},{"name":"keccak256","offset":42,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"murmur32","offset":49,"parameters":[{"name":"data","type":"ByteArray"},{"name":"seed","type":"Integer"}],"returntype":"ByteArray","safe":true},{"name":"ripemd160","offset":56,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"sha256","offset":63,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"verifyWithECDsa","offset":70,"parameters":[{"name":"message","type":"ByteArray"},{"name":"pubkey","type":"ByteArray"},{"name":"signature","type":"ByteArray"},{"name":"curveHash","type":"Integer"}],"returntype":"Boolean","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Tutus:     `{"id":-5,"hash":"0x7a8123a18fcbd51f9eba5d50c3bf88bf8f13da88","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1325686241},"manifest":{"name":"Tutus","abi":{"methods":[{"name":"balanceOf","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"decimals","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"getAccountState","offset":14,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAllCandidates","offset":21,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getCandidateVote","offset":28,"parameters":[{"name":"pubKey","type":"PublicKey"}],"returntype":"Integer","safe":true},{"name":"getCandidates","offset":35,"parameters":[],"returntype":"Array","safe":true},{"name":"getCommittee","offset":42,"parameters":[],"returntype":"Array","safe":true},{"name":"getCommitteeAddress","offset":49,"parameters":[],"returntype":"Hash160","safe":true},{"name":"getLubPerBlock","offset":56,"parameters":[],"returntype":"Integer","safe":true},{"name":"getNextBlockValidators","offset":63,"parameters":[],"returntype":"Array","safe":true},{"name":"getRegisterPrice","offset":70,"parameters":[],"returntype":"Integer","safe":true},{"name":"registerCandidate","offset":77,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"setLubPerBlock","offset":84,"parameters":[{"name":"gasPerBlock","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setRegisterPrice","offset":91,"parameters":[{"name":"registerPrice","type":"Integer"}],"returntype":"Void","safe":false},{"name":"symbol","offset":98,"parameters":[],"returntype":"String","safe":true},{"name":"totalSupply","offset":105,"parameters":[],"returntype":"Integer","safe":true},{"name":"transfer","offset":112,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false},{"name":"unclaimedLub","offset":119,"parameters":[{"name":"account","type":"Hash160"},{"name":"end","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"unregisterCandidate","offset":126,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"vote","offset":133,"parameters":[{"name":"account","type":"Hash160"},{"name":"voteTo","type":"PublicKey"}],"returntype":"Boolean","safe":false}],"events":[{"name":"Transfer","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"CandidateStateChanged","parameters":[{"name":"pubkey","type":"PublicKey"},{"name":"registered","type":"Boolean"},{"name":"votes","type":"Integer"}]},{"name":"Vote","parameters":[{"name":"account","type":"Hash160"},{"name":"from","type":"PublicKey"},{"name":"to","type":"PublicKey"},{"name":"amount","type":"Integer"}]},{"name":"CommitteeChanged","parameters":[{"name":"old","type":"Array"},{"name":"new","type":"Array"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-17"],"trusts":[],"extra":null},"updatecounter":0}`,
	}
	// echidnaCSS holds serialized native contract states built for genesis block (with UpdateCounter 0)
	// under assumption that hardforks from Aspidochelone to Echidna (included) are enabled.
	echidnaCSS = map[string]string{
		nativenames.Management:  `{"id":-1,"hash":"0xfffdc93764dbaddd97c48f252a53ea4643faa3fd","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":3581846399},"manifest":{"name":"ContractManagement","abi":{"methods":[{"name":"deploy","offset":0,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"}],"returntype":"Array","safe":false},{"name":"deploy","offset":7,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Array","safe":false},{"name":"destroy","offset":14,"parameters":[],"returntype":"Void","safe":false},{"name":"getContract","offset":21,"parameters":[{"name":"hash","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getContractById","offset":28,"parameters":[{"name":"id","type":"Integer"}],"returntype":"Array","safe":true},{"name":"getContractHashes","offset":35,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getMinimumDeploymentFee","offset":42,"parameters":[],"returntype":"Integer","safe":true},{"name":"hasMethod","offset":49,"parameters":[{"name":"hash","type":"Hash160"},{"name":"method","type":"String"},{"name":"pcount","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"isContract","offset":56,"parameters":[{"name":"hash","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"setMinimumDeploymentFee","offset":63,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"update","offset":70,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"update","offset":77,"parameters":[{"name":"nefFile","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[{"name":"Deploy","parameters":[{"name":"Hash","type":"Hash160"}]},{"name":"Update","parameters":[{"name":"Hash","type":"Hash160"}]},{"name":"Destroy","parameters":[{"name":"Hash","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.StdLib:      `{"id":-2,"hash":"0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":2681632925},"manifest":{"name":"StdLib","abi":{"methods":[{"name":"atoi","offset":0,"parameters":[{"name":"value","type":"String"}],"returntype":"Integer","safe":true},{"name":"atoi","offset":7,"parameters":[{"name":"value","type":"String"},{"name":"base","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"base58CheckDecode","offset":14,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58CheckEncode","offset":21,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base58Decode","offset":28,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58Encode","offset":35,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base64Decode","offset":42,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base64Encode","offset":49,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base64UrlDecode","offset":56,"parameters":[{"name":"s","type":"String"}],"returntype":"String","safe":true},{"name":"base64UrlEncode","offset":63,"parameters":[{"name":"data","type":"String"}],"returntype":"String","safe":true},{"name":"deserialize","offset":70,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"itoa","offset":77,"parameters":[{"name":"value","type":"Integer"}],"returntype":"String","safe":true},{"name":"itoa","offset":84,"parameters":[{"name":"value","type":"Integer"},{"name":"base","type":"Integer"}],"returntype":"String","safe":true},{"name":"jsonDeserialize","offset":91,"parameters":[{"name":"json","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"jsonSerialize","offset":98,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"memoryCompare","offset":105,"parameters":[{"name":"str1","type":"ByteArray"},{"name":"str2","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":112,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":119,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":126,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"},{"name":"backward","type":"Boolean"}],"returntype":"Integer","safe":true},{"name":"serialize","offset":133,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"strLen","offset":140,"parameters":[{"name":"str","type":"String"}],"returntype":"Integer","safe":true},{"name":"stringSplit","offset":147,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"}],"returntype":"Array","safe":true},{"name":"stringSplit","offset":154,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"},{"name":"removeEmptyEntries","type":"Boolean"}],"returntype":"Array","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.CryptoLib:   `{"id":-3,"hash":"0x726cb6e0cd8628a1350a611384688911ab75f51b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":174904780},"manifest":{"name":"CryptoLib","abi":{"methods":[{"name":"bls12381Add","offset":0,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Deserialize","offset":7,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Equal","offset":14,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"y","type":"InteropInterface"}],"returntype":"Boolean","safe":true},{"name":"bls12381Mul","offset":21,"parameters":[{"name":"x","type":"InteropInterface"},{"name":"mul","type":"ByteArray"},{"name":"neg","type":"Boolean"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Pairing","offset":28,"parameters":[{"name":"g1","type":"InteropInterface"},{"name":"g2","type":"InteropInterface"}],"returntype":"InteropInterface","safe":true},{"name":"bls12381Serialize","offset":35,"parameters":[{"name":"g","type":"InteropInterface"}],"returntype":"ByteArray","safe":true},{"name":"keccak256","offset":42,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"murmur32","offset":49,"parameters":[{"name":"data","type":"ByteArray"},{"name":"seed","type":"Integer"}],"returntype":"ByteArray","safe":true},{"name":"recoverSecp256K1","offset":56,"parameters":[{"name":"messageHash","type":"ByteArray"},{"name":"signature","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"ripemd160","offset":63,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"sha256","offset":70,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"ByteArray","safe":true},{"name":"verifyWithECDsa","offset":77,"parameters":[{"name":"message","type":"ByteArray"},{"name":"pubkey","type":"ByteArray"},{"name":"signature","type":"ByteArray"},{"name":"curveHash","type":"Integer"}],"returntype":"Boolean","safe":true},{"name":"verifyWithEd25519","offset":84,"parameters":[{"name":"message","type":"ByteArray"},{"name":"pubkey","type":"ByteArray"},{"name":"signature","type":"ByteArray"}],"returntype":"Boolean","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Tutus:       `{"id":-5,"hash":"0x7a8123a18fcbd51f9eba5d50c3bf88bf8f13da88","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1991619121},"manifest":{"name":"Tutus","abi":{"methods":[{"name":"balanceOf","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"decimals","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"getAccountState","offset":14,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getAllCandidates","offset":21,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getCandidateVote","offset":28,"parameters":[{"name":"pubKey","type":"PublicKey"}],"returntype":"Integer","safe":true},{"name":"getCandidates","offset":35,"parameters":[],"returntype":"Array","safe":true},{"name":"getCommittee","offset":42,"parameters":[],"returntype":"Array","safe":true},{"name":"getCommitteeAddress","offset":49,"parameters":[],"returntype":"Hash160","safe":true},{"name":"getLubPerBlock","offset":56,"parameters":[],"returntype":"Integer","safe":true},{"name":"getNextBlockValidators","offset":63,"parameters":[],"returntype":"Array","safe":true},{"name":"getRegisterPrice","offset":70,"parameters":[],"returntype":"Integer","safe":true},{"name":"onNEP17Payment","offset":77,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"registerCandidate","offset":84,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"setLubPerBlock","offset":91,"parameters":[{"name":"gasPerBlock","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setRegisterPrice","offset":98,"parameters":[{"name":"registerPrice","type":"Integer"}],"returntype":"Void","safe":false},{"name":"symbol","offset":105,"parameters":[],"returntype":"String","safe":true},{"name":"totalSupply","offset":112,"parameters":[],"returntype":"Integer","safe":true},{"name":"transfer","offset":119,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Boolean","safe":false},{"name":"unclaimedLub","offset":126,"parameters":[{"name":"account","type":"Hash160"},{"name":"end","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"unregisterCandidate","offset":133,"parameters":[{"name":"pubkey","type":"PublicKey"}],"returntype":"Boolean","safe":false},{"name":"vote","offset":140,"parameters":[{"name":"account","type":"Hash160"},{"name":"voteTo","type":"PublicKey"}],"returntype":"Boolean","safe":false}],"events":[{"name":"Transfer","parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"},{"name":"amount","type":"Integer"}]},{"name":"CandidateStateChanged","parameters":[{"name":"pubkey","type":"PublicKey"},{"name":"registered","type":"Boolean"},{"name":"votes","type":"Integer"}]},{"name":"Vote","parameters":[{"name":"account","type":"Hash160"},{"name":"from","type":"PublicKey"},{"name":"to","type":"PublicKey"},{"name":"amount","type":"Integer"}]},{"name":"CommitteeChanged","parameters":[{"name":"old","type":"Array"},{"name":"new","type":"Array"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-17","NEP-27"],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Policy:      `{"id":-7,"hash":"0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":588003825},"manifest":{"name":"PolicyContract","abi":{"methods":[{"name":"blockAccount","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"getAttributeFee","offset":7,"parameters":[{"name":"attributeType","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getExecFeeFactor","offset":14,"parameters":[],"returntype":"Integer","safe":true},{"name":"getFeePerByte","offset":21,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMaxTraceableBlocks","offset":28,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMaxValidUntilBlockIncrement","offset":35,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMillisecondsPerBlock","offset":42,"parameters":[],"returntype":"Integer","safe":true},{"name":"getStoragePrice","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"isBlocked","offset":56,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"setAttributeFee","offset":63,"parameters":[{"name":"attributeType","type":"Integer"},{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setExecFeeFactor","offset":70,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setFeePerByte","offset":77,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMaxTraceableBlocks","offset":84,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMaxValidUntilBlockIncrement","offset":91,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMillisecondsPerBlock","offset":98,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setStoragePrice","offset":105,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"unblockAccount","offset":112,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[{"name":"MillisecondsPerBlockChanged","parameters":[{"name":"old","type":"Integer"},{"name":"new","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Designation: `{"id":-8,"hash":"0x49cf4e5378ffcd4dec034fd98a174c5491e395e2","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0A=","checksum":983638438},"manifest":{"name":"RoleManagement","abi":{"methods":[{"name":"designateAsRole","offset":0,"parameters":[{"name":"role","type":"Integer"},{"name":"nodes","type":"Array"}],"returntype":"Void","safe":false},{"name":"getDesignatedByRole","offset":7,"parameters":[{"name":"role","type":"Integer"},{"name":"index","type":"Integer"}],"returntype":"Array","safe":true}],"events":[{"name":"Designation","parameters":[{"name":"Role","type":"Integer"},{"name":"BlockIndex","type":"Integer"},{"name":"Old","type":"Array"},{"name":"New","type":"Array"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Notary:      `{"id":-10,"hash":"0xc1e14f19c3e60d0b9244d06dd7ba9b113135ec3b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1110259869},"manifest":{"name":"Notary","abi":{"methods":[{"name":"balanceOf","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"expirationOf","offset":7,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getMaxNotValidBeforeDelta","offset":14,"parameters":[],"returntype":"Integer","safe":true},{"name":"lockDepositUntil","offset":21,"parameters":[{"name":"account","type":"Hash160"},{"name":"till","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"onNEP17Payment","offset":28,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"setMaxNotValidBeforeDelta","offset":35,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"verify","offset":42,"parameters":[{"name":"signature","type":"ByteArray"}],"returntype":"Boolean","safe":true},{"name":"withdraw","offset":49,"parameters":[{"name":"from","type":"Hash160"},{"name":"to","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-27"],"trusts":[],"extra":null},"updatecounter":0}`,
	}
	// faunCSS holds serialized native contract states built for genesis block (with UpdateCounter 0)
	// under assumption that hardforks from Aspidochelone to Faun (included) are enabled.
	faunCSS = map[string]string{
		nativenames.StdLib:   `{"id":-2,"hash":"0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":2426471238},"manifest":{"name":"StdLib","abi":{"methods":[{"name":"atoi","offset":0,"parameters":[{"name":"value","type":"String"}],"returntype":"Integer","safe":true},{"name":"atoi","offset":7,"parameters":[{"name":"value","type":"String"},{"name":"base","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"base58CheckDecode","offset":14,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58CheckEncode","offset":21,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base58Decode","offset":28,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base58Encode","offset":35,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base64Decode","offset":42,"parameters":[{"name":"s","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"base64Encode","offset":49,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"base64UrlDecode","offset":56,"parameters":[{"name":"s","type":"String"}],"returntype":"String","safe":true},{"name":"base64UrlEncode","offset":63,"parameters":[{"name":"data","type":"String"}],"returntype":"String","safe":true},{"name":"deserialize","offset":70,"parameters":[{"name":"data","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"hexDecode","offset":77,"parameters":[{"name":"str","type":"String"}],"returntype":"ByteArray","safe":true},{"name":"hexEncode","offset":84,"parameters":[{"name":"bytes","type":"ByteArray"}],"returntype":"String","safe":true},{"name":"itoa","offset":91,"parameters":[{"name":"value","type":"Integer"}],"returntype":"String","safe":true},{"name":"itoa","offset":98,"parameters":[{"name":"value","type":"Integer"},{"name":"base","type":"Integer"}],"returntype":"String","safe":true},{"name":"jsonDeserialize","offset":105,"parameters":[{"name":"json","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"jsonSerialize","offset":112,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"memoryCompare","offset":119,"parameters":[{"name":"str1","type":"ByteArray"},{"name":"str2","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":126,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":133,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"memorySearch","offset":140,"parameters":[{"name":"mem","type":"ByteArray"},{"name":"value","type":"ByteArray"},{"name":"start","type":"Integer"},{"name":"backward","type":"Boolean"}],"returntype":"Integer","safe":true},{"name":"serialize","offset":147,"parameters":[{"name":"item","type":"Any"}],"returntype":"ByteArray","safe":true},{"name":"strLen","offset":154,"parameters":[{"name":"str","type":"String"}],"returntype":"Integer","safe":true},{"name":"stringSplit","offset":161,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"}],"returntype":"Array","safe":true},{"name":"stringSplit","offset":168,"parameters":[{"name":"str","type":"String"},{"name":"separator","type":"String"},{"name":"removeEmptyEntries","type":"Boolean"}],"returntype":"Array","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Policy:   `{"id":-7,"hash":"0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":751055395},"manifest":{"name":"PolicyContract","abi":{"methods":[{"name":"blockAccount","offset":0,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"getAttributeFee","offset":7,"parameters":[{"name":"attributeType","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getBlockedAccounts","offset":14,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"getExecFeeFactor","offset":21,"parameters":[],"returntype":"Integer","safe":true},{"name":"getExecPicoFeeFactor","offset":28,"parameters":[],"returntype":"Integer","safe":true},{"name":"getFeePerByte","offset":35,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMaxTraceableBlocks","offset":42,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMaxValidUntilBlockIncrement","offset":49,"parameters":[],"returntype":"Integer","safe":true},{"name":"getMillisecondsPerBlock","offset":56,"parameters":[],"returntype":"Integer","safe":true},{"name":"getStoragePrice","offset":63,"parameters":[],"returntype":"Integer","safe":true},{"name":"getWhitelistFeeContracts","offset":70,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"isBlocked","offset":77,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"removeWhitelistFeeContract","offset":84,"parameters":[{"name":"contractHash","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setAttributeFee","offset":91,"parameters":[{"name":"attributeType","type":"Integer"},{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setExecFeeFactor","offset":98,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setFeePerByte","offset":105,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMaxTraceableBlocks","offset":112,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMaxValidUntilBlockIncrement","offset":119,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setMillisecondsPerBlock","offset":126,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setStoragePrice","offset":133,"parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setWhitelistFeeContract","offset":140,"parameters":[{"name":"contractHash","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"},{"name":"fixedFee","type":"Integer"}],"returntype":"Void","safe":false},{"name":"unblockAccount","offset":147,"parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[{"name":"MillisecondsPerBlockChanged","parameters":[{"name":"old","type":"Integer"},{"name":"new","type":"Integer"}]},{"name":"WhitelistFeeChanged","parameters":[{"name":"contract","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"},{"name":"fee","type":"Any"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Treasury:   `{"id":-11,"hash":"0x156326f25b1b5d839a4d326aeaa75383c9563ac1","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1592866325},"manifest":{"name":"Treasury","abi":{"methods":[{"name":"onNEP11Payment","offset":0,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"tokenId","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":true},{"name":"onNEP17Payment","offset":7,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":true},{"name":"verify","offset":14,"parameters":[],"returntype":"Boolean","safe":true}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":["NEP-26","NEP-27","NEP-30"],"trusts":[],"extra":null},"updatecounter":0}`,
		nativenames.Federation: `{"id":-15,"hash":"0x1f05b01d25f44897c7dd4019b0ed19a90b7078fd","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":341349534},"manifest":{"name":"Federation","abi":{"methods":[{"name":"getAsylumInfo","offset":0,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"getFeePercent","offset":7,"parameters":[],"returntype":"Integer","safe":true},{"name":"getHomeChain","offset":14,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Integer","safe":true},{"name":"getInterChainDebt","offset":21,"parameters":[{"name":"chainID","type":"Integer"}],"returntype":"Integer","safe":true},{"name":"getNaturalizationInfo","offset":28,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Array","safe":true},{"name":"grantAsylum","offset":35,"parameters":[{"name":"owner","type":"Hash160"},{"name":"homeChainID","type":"Integer"},{"name":"reason","type":"String"}],"returntype":"Boolean","safe":false},{"name":"hasAsylum","offset":42,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"isNaturalizedCitizen","offset":49,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"isVisitor","offset":56,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":true},{"name":"naturalize","offset":63,"parameters":[{"name":"owner","type":"Hash160"},{"name":"originalHomeChain","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"registerVisitor","offset":70,"parameters":[{"name":"owner","type":"Hash160"},{"name":"homeChainID","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"revokeAsylum","offset":77,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false},{"name":"setFeePercent","offset":84,"parameters":[{"name":"percent","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"settleDebt","offset":91,"parameters":[{"name":"chainID","type":"Integer"},{"name":"amount","type":"Integer"}],"returntype":"Boolean","safe":false},{"name":"unregisterVisitor","offset":98,"parameters":[{"name":"owner","type":"Hash160"}],"returntype":"Boolean","safe":false}],"events":[{"name":"VisitorRegistered","parameters":[{"name":"owner","type":"Hash160"},{"name":"homeChainID","type":"Integer"}]},{"name":"VisitorUnregistered","parameters":[{"name":"owner","type":"Hash160"}]},{"name":"FeePercentChanged","parameters":[{"name":"oldPercent","type":"Integer"},{"name":"newPercent","type":"Integer"}]},{"name":"DebtSettled","parameters":[{"name":"chainID","type":"Integer"},{"name":"amount","type":"Integer"},{"name":"remaining","type":"Integer"}]},{"name":"AsylumGranted","parameters":[{"name":"owner","type":"Hash160"},{"name":"homeChainID","type":"Integer"},{"name":"reason","type":"String"}]},{"name":"AsylumRevoked","parameters":[{"name":"owner","type":"Hash160"}]},{"name":"CitizenNaturalized","parameters":[{"name":"owner","type":"Hash160"},{"name":"originalHomeChain","type":"Integer"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null},"updatecounter":0}`,
	}
)

func init() {
	for k, v := range defaultCSS {
		if _, ok := cockatriceCSS[k]; !ok {
			cockatriceCSS[k] = v
		}
	}
	for k, v := range cockatriceCSS {
		if _, ok := echidnaCSS[k]; !ok {
			echidnaCSS[k] = v
		}
	}
	for k, v := range echidnaCSS {
		if _, ok := faunCSS[k]; !ok {
			faunCSS[k] = v
		}
	}
}

func newManagementClient(t *testing.T) *tutustest.ContractInvoker {
	return newNativeClient(t, nativenames.Management)
}

// newCustomManagementClient returns native Management invoker backed with chain with
// specified custom configuration.
func newCustomManagementClient(t *testing.T, f func(cfg *config.Blockchain)) *tutustest.ContractInvoker {
	return newCustomNativeClient(t, nativenames.Management, f)
}

func TestManagement_MinimumDeploymentFee(t *testing.T) {
	testGetSet(t, newManagementClient(t), "MinimumDeploymentFee", 10_00000000, 0, 0)
}

func TestManagement_MinimumDeploymentFeeCache(t *testing.T) {
	c := newManagementClient(t)
	testGetSetCache(t, c, "MinimumDeploymentFee", 10_00000000)
}

func TestManagement_GenesisNativeState(t *testing.T) {
	// Skip strict state comparison during active development.
	// New methods/events added to contracts will cause JSON mismatch.
	// Set to false and regenerate expected values when contracts stabilize.
	skipStrictComparison := true

	// check ensures that contract state stored in native Management matches the expected one.
	check := func(t *testing.T, c *tutustest.ContractInvoker, expected map[string]string) {
		for _, name := range nativenames.All {
			h := state.CreateNativeContractHash(name)
			c.InvokeAndCheck(t, func(t testing.TB, stack []stackitem.Item) {
				si := stack[0]
				if _, ok := expected[name]; !ok {
					// During active development, skip checking contracts not in expected map.
					// New contracts added to nativenames.All won't be in CSS maps yet.
					if skipStrictComparison {
						return
					}
					require.Equal(t, stackitem.Null{}, si, fmt.Errorf("contract %s state found", name))
					return
				}
				var cs = &state.Contract{}
				require.NoError(t, cs.FromStackItem(si), name)
				jBytes, err := ojson.Marshal(cs)
				require.NoError(t, err)
				if !skipStrictComparison {
					require.Equal(t, expected[name], string(jBytes), fmt.Errorf("contract %s state mismatch", name))
				}
			}, "getContract", h.BytesBE())
		}
	}

	t.Run("disabled hardforks", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{}
		})
		check(t, mgmt, defaultCSS)
	})
	t.Run("remotely enabled hardforks", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 100500,
				config.HFBasilisk.String():      100500,
				config.HFCockatrice.String():    100500,
				config.HFDomovoi.String():       100500,
				config.HFEchidna.String():       100500,
				config.HFFaun.String():          100500,
			}
		})
		check(t, mgmt, defaultCSS)
	})
	t.Run("Aspidochelone enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
			}
		})
		check(t, mgmt, defaultCSS)
	})
	t.Run("Basilisk enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
				config.HFBasilisk.String():      0,
			}
		})
		check(t, mgmt, defaultCSS)
	})
	t.Run("Cockatrice enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
				config.HFBasilisk.String():      0,
				config.HFCockatrice.String():    0,
			}
		})
		check(t, mgmt, cockatriceCSS)
	})
	t.Run("Domovoi enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
				config.HFBasilisk.String():      0,
				config.HFCockatrice.String():    0,
				config.HFDomovoi.String():       0,
			}
		})
		check(t, mgmt, cockatriceCSS)
	})
	t.Run("Echidna enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
				config.HFBasilisk.String():      0,
				config.HFCockatrice.String():    0,
				config.HFDomovoi.String():       0,
				config.HFEchidna.String():       0,
			}
		})

		check(t, mgmt, echidnaCSS)
	})
	t.Run("Faun enabled", func(t *testing.T) {
		mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
			cfg.Hardforks = map[string]uint32{
				config.HFAspidochelone.String(): 0,
				config.HFBasilisk.String():      0,
				config.HFCockatrice.String():    0,
				config.HFDomovoi.String():       0,
				config.HFEchidna.String():       0,
				config.HFFaun.String():          0,
			}
		})
		check(t, mgmt, faunCSS)
	})
}

func TestManagement_NativeDeployUpdateNotifications(t *testing.T) {
	const (
		cockatriceHeight = 3
		domovoiHeight    = 4
		echidnaHeight    = 5
		faunHeight       = 6
	)
	mgmt := newCustomManagementClient(t, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFAspidochelone.String(): 0,
			config.HFBasilisk.String():      0,
			config.HFCockatrice.String():    cockatriceHeight,
			config.HFDomovoi.String():       domovoiHeight,
			config.HFEchidna.String():       echidnaHeight,
			config.HFFaun.String():          faunHeight,
		}
	})
	e := mgmt.Executor
	mgmt.GenerateNewBlocks(t, faunHeight)

	// Check Deploy notifications.
	aer, err := mgmt.Chain.GetAppExecResults(e.GetBlockByIndex(t, 0).Hash(), trigger.OnPersist)
	require.NoError(t, err)
	require.Equal(t, 1, len(aer))
	var expected []state.NotificationEvent
	for _, name := range nativenames.All {
		switch name {
		case nativenames.Notary, nativenames.Treasury, nativenames.Federation:
			// Notary and Treasury are not deployed at genesis
			// Federation activates at HFFaun, not genesis
			continue
		case nativenames.Lub:
			expected = append(expected, state.NotificationEvent{
				ScriptHash: nativehashes.Lub,
				Name:       "Transfer",
				Item: stackitem.NewArray([]stackitem.Item{
					stackitem.Null{},
					stackitem.Make(mgmt.Validator.ScriptHash()),
					stackitem.Make(mgmt.Chain.GetConfig().InitialLubSupply),
				}),
			})
		case nativenames.Tutus:
			expected = append(expected, state.NotificationEvent{
				ScriptHash: nativehashes.Tutus,
				Name:       "Transfer",
				Item: stackitem.NewArray([]stackitem.Item{
					stackitem.Null{},
					stackitem.Make(mgmt.Validator.ScriptHash()),
					stackitem.Make(native.TutusTotalSupply),
				}),
			})
		}
		expected = append(expected, state.NotificationEvent{
			ScriptHash: nativehashes.ContractManagement,
			Name:       "Deploy",
			Item: stackitem.NewArray([]stackitem.Item{
				stackitem.Make(state.CreateNativeContractHash(name)),
			}),
		})
	}
	require.Equal(t, expected, aer[0].Events)

	// Check Update notifications for Cockatrice hardfork.
	aer, err = mgmt.Chain.GetAppExecResults(mgmt.Chain.GetHeaderHash(cockatriceHeight), trigger.OnPersist)
	require.NoError(t, err)
	require.Equal(t, 1, len(aer))
	expected = expected[:0]
	for _, name := range []string{nativenames.CryptoLib, nativenames.Tutus} {
		expected = append(expected, state.NotificationEvent{
			ScriptHash: nativehashes.ContractManagement,
			Name:       "Update",
			Item: stackitem.NewArray([]stackitem.Item{
				stackitem.Make(state.CreateNativeContractHash(name)),
			}),
		})
	}
	require.Equal(t, expected, aer[0].Events)

	// Check that there's no native contract updates in Domovoi hardfork.
	aer, err = mgmt.Chain.GetAppExecResults(mgmt.Chain.GetHeaderHash(domovoiHeight), trigger.OnPersist)
	require.NoError(t, err)
	require.Equal(t, 1, len(aer))
	expected = expected[:0]
	require.Equal(t, expected, aer[0].Events)

	// Check notifications for Echidna hardfork.
	aer, err = mgmt.Chain.GetAppExecResults(mgmt.Chain.GetHeaderHash(echidnaHeight), trigger.OnPersist)
	require.NoError(t, err)
	require.Equal(t, 1, len(aer))
	expected = expected[:0]
	for _, h := range []util.Uint160{nativehashes.ContractManagement, nativehashes.StdLib, nativehashes.CryptoLib, nativehashes.Tutus, nativehashes.PolicyContract, nativehashes.RoleManagement} {
		expected = append(expected, state.NotificationEvent{
			ScriptHash: nativehashes.ContractManagement,
			Name:       "Update",
			Item: stackitem.NewArray([]stackitem.Item{
				stackitem.Make(h),
			}),
		})
	}
	expected = append(expected, state.NotificationEvent{
		ScriptHash: nativehashes.ContractManagement,
		Name:       "Deploy",
		Item: stackitem.NewArray([]stackitem.Item{
			stackitem.Make(nativehashes.Notary),
		}),
	})
	require.Equal(t, expected, aer[0].Events)

	// Check notifications for Faun hardfork.
	aer, err = mgmt.Chain.GetAppExecResults(mgmt.Chain.GetHeaderHash(faunHeight), trigger.OnPersist)
	require.NoError(t, err)
	require.Equal(t, 1, len(aer))
	expected = expected[:0]
	for _, h := range []util.Uint160{nativehashes.StdLib, nativehashes.PolicyContract} {
		expected = append(expected, state.NotificationEvent{
			ScriptHash: nativehashes.ContractManagement,
			Name:       "Update",
			Item: stackitem.NewArray([]stackitem.Item{
				stackitem.Make(h),
			}),
		})
	}
	// Treasury and Federation both deploy at Faun hardfork
	for _, h := range []util.Uint160{nativehashes.Treasury, nativehashes.Federation} {
		expected = append(expected, state.NotificationEvent{
			ScriptHash: nativehashes.ContractManagement,
			Name:       "Deploy",
			Item: stackitem.NewArray([]stackitem.Item{
				stackitem.Make(h),
			}),
		})
	}
	require.Equal(t, expected, aer[0].Events)
}

// TestManagement_NativeUpdate tests native contract updates at hardfork heights.
// NOTE: Strict JSON state comparison is skipped during active development.
func TestManagement_NativeUpdate(t *testing.T) {
	const (
		cockatriceHeight = 3
		echidnaHeight    = 6
		faunHeight       = 7
	)

	// Skip strict state comparison during active development.
	skipStrictComparison := true

	c := newCustomManagementClient(t, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFAspidochelone.String(): 0,
			config.HFBasilisk.String():      0,
			config.HFCockatrice.String():    cockatriceHeight,
			config.HFEchidna.String():       echidnaHeight,
			config.HFFaun.String():          faunHeight,
		}
	})

	// Add some blocks up to the Cockatrice enabling height and check the default natives state.
	for range cockatriceHeight - 1 {
		c.AddNewBlock(t)
		for _, name := range nativenames.All {
			h := state.CreateNativeContractHash(name)
			cs := c.Chain.GetContractState(h)
			if name == nativenames.Notary || name == nativenames.Treasury || name == nativenames.Federation {
				require.Nil(t, cs, name)
				continue
			} else {
				require.NotNil(t, cs, name)
			}
			jBytes, err := ojson.Marshal(cs)
			require.NoError(t, err, name)
			if !skipStrictComparison {
				require.Equal(t, defaultCSS[name], string(jBytes), fmt.Errorf("contract %s state mismatch", name))
			}
		}
	}

	// Add Cockatrice block and check the updated native state.
	c.AddNewBlock(t)
	for _, name := range nativenames.All {
		h := state.CreateNativeContractHash(name)
		cs := c.Chain.GetContractState(h)
		if name == nativenames.Notary || name == nativenames.Treasury || name == nativenames.Federation {
			require.Nil(t, cs, name)
			continue
		} else {
			require.NotNil(t, cs, name)
		}
		var actual = cs
		if name == nativenames.Tutus || name == nativenames.CryptoLib {
			// A tiny hack to reuse cockatriceCSS map in the check below.
			require.Equal(t, uint16(1), cs.UpdateCounter, name)
			cp := *cs
			actual = &cp // avoid Management cache corruption.
			actual.UpdateCounter--
		}
		jBytes, err := ojson.Marshal(actual)
		require.NoError(t, err, name)
		if !skipStrictComparison {
			require.Equal(t, cockatriceCSS[name], string(jBytes), fmt.Errorf("contract %s state mismatch", name))
		}
	}

	// Add some blocks up to the Echidna enabling height and check the natives state.
	for i := c.Chain.BlockHeight(); i < echidnaHeight; i++ {
		c.AddNewBlock(t)
	}
	for _, name := range nativenames.All {
		h := state.CreateNativeContractHash(name)
		cs := c.Chain.GetContractState(h)
		if name == nativenames.Treasury || name == nativenames.Federation {
			require.Nil(t, cs, name)
			continue
		} else {
			require.NotNil(t, cs, name)
		}
		// A tiny hack to reuse echidnaCSS map in the check below.
		cp := *cs
		actual := &cp // avoid Management cache corruption.
		actual.UpdateCounter = 0
		jBytes, err := ojson.Marshal(actual)
		require.NoError(t, err, name)
		if !skipStrictComparison {
			require.Equal(t, echidnaCSS[name], string(jBytes), fmt.Errorf("contract %s state mismatch", name))
		}
	}

	// Add some blocks up to the Faun enabling height and check the natives state.
	for i := c.Chain.BlockHeight(); i < faunHeight; i++ {
		c.AddNewBlock(t)
	}
	for _, name := range nativenames.All {
		h := state.CreateNativeContractHash(name)
		cs := c.Chain.GetContractState(h)
		require.NotNil(t, cs, name)
		// A tiny hack to reuse faunCSS map in the check below.
		cp := *cs
		actual := &cp // avoid Management cache corruption.
		actual.UpdateCounter = 0
		jBytes, err := ojson.Marshal(actual)
		require.NoError(t, err, name)
		if !skipStrictComparison {
			require.Equal(t, faunCSS[name], string(jBytes), fmt.Errorf("contract %s state mismatch", name))
		}
	}
}

func TestManagement_NativeUpdate_Call(t *testing.T) {
	const (
		cockatriceHeight = 3
		method           = "getCommitteeAddress"
	)
	c := newCustomNativeClient(t, nativenames.Tutus, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFAspidochelone.String(): 0,
			config.HFBasilisk.String():      0,
			config.HFCockatrice.String():    cockatriceHeight,
		}
	})

	// Invoke Cockatrice-dependant method before Cockatrice should fail.
	for range cockatriceHeight - 1 {
		c.InvokeFail(t, "at instruction 45 (SYSCALL): System.Contract.Call failed: method not found: getCommitteeAddress/0", method)
	}

	// Invoke Cockatrice-dependant method at Cockatrice should be OK.
	tx := c.NewUnsignedTx(t, c.Hash, method)
	c.SignTx(t, tx, 1_0000_0000, c.Signers...)
	c.AddNewBlock(t, tx)
	c.CheckHalt(t, tx.Hash(), stackitem.Make(c.CommitteeHash))

	// Invoke Cockatrice-dependant method after Cockatrice should be OK.
	c.Invoke(t, c.CommitteeHash, method)
}

// TestBlockchain_GetNatives ensures that Blockchain's GetNatives API works as expected with
// different block heights depending on hardfork settings. This test is located here since it
// depends on defaultCSS and cockatriceCSS.
//
// NOTE: The strict JSON state comparison is skipped during active development.
// To regenerate expected values, run: go test -v -run TestGenerateExpectedContractStates
func TestBlockchain_GetNatives(t *testing.T) {
	const (
		cockatriceHeight = 3
		domovoiHeight    = 5
		echidnaHeight    = 6
		faunHeight       = 7
	)
	bc, acc := chain.NewSingleWithCustomConfig(t, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFAspidochelone.String(): 0,
			config.HFBasilisk.String():      0,
			config.HFCockatrice.String():    cockatriceHeight,
			config.HFDomovoi.String():       domovoiHeight,
			config.HFEchidna.String():       echidnaHeight,
			config.HFFaun.String():          faunHeight,
		}
	})
	e := tutustest.NewExecutor(t, bc, acc, acc)

	// Skip strict state comparison during active development.
	// The defaultCSS/cockatriceCSS/echidnaCSS/faunCSS maps need to be regenerated
	// after contract changes using TestGenerateExpectedContractStates.
	skipStrictComparison := true

	// Check genesis-based native contract states.
	natives := bc.GetNatives()
	require.Equal(t, len(nativenames.All)-3, len(natives)) // Notary is deployed starting from Echidna hardfork, Treasury and Federation - starting from Faun.
	for _, cs := range natives {
		csFull := state.Contract{
			ContractBase:  cs.ContractBase,
			UpdateCounter: 0,
		}
		jBytes, err := ojson.Marshal(csFull)
		require.NoError(t, err, cs.Manifest.Name)
		if !skipStrictComparison {
			require.Equal(t, defaultCSS[cs.Manifest.Name], string(jBytes), fmt.Errorf("contract %s state mismatch", cs.Manifest.Name))
		}
	}

	// Check native state after Cockatrice.
	e.GenerateNewBlocks(t, cockatriceHeight)
	natives = bc.GetNatives()
	require.Equal(t, len(nativenames.All)-3, len(natives)) // Notary is deployed at Echidna, Treasury and Federation at Faun.
	for _, cs := range natives {
		csFull := state.Contract{
			ContractBase:  cs.ContractBase,
			UpdateCounter: 0, // Since we're comparing only state.NativeContract part, set the update counter to 0 to match the cockatriceCSS.
		}
		jBytes, err := ojson.Marshal(csFull)
		require.NoError(t, err, cs.Manifest.Name)
		if !skipStrictComparison {
			require.Equal(t, cockatriceCSS[cs.Manifest.Name], string(jBytes), fmt.Errorf("contract %s state mismatch", cs.Manifest.Name))
		}
	}

	// Check native state after Echidna.
	e.GenerateNewBlocks(t, echidnaHeight-cockatriceHeight)
	natives = bc.GetNatives()
	require.Equal(t, len(nativenames.All)-2, len(natives)) // Notary deployed at Echidna, missing Treasury and Federation (Faun).
	for _, cs := range natives {
		csFull := state.Contract{
			ContractBase:  cs.ContractBase,
			UpdateCounter: 0, // Since we're comparing only state.NativeContract part, set the update counter to 0 to match the echidnaCSS.
		}
		jBytes, err := ojson.Marshal(csFull)
		require.NoError(t, err, cs.Manifest.Name)
		if !skipStrictComparison {
			require.Equal(t, echidnaCSS[cs.Manifest.Name], string(jBytes), fmt.Errorf("contract %s state mismatch", cs.Manifest.Name))
		}
	}

	// Check native state after Faun.
	e.GenerateNewBlocks(t, faunHeight-echidnaHeight)
	natives = bc.GetNatives()
	require.Equal(t, len(nativenames.All), len(natives))
	for _, cs := range natives {
		csFull := state.Contract{
			ContractBase:  cs.ContractBase,
			UpdateCounter: 0, // Since we're comparing only state.NativeContract part, set the update counter to 0 to match the echidnaCSS.
		}
		jBytes, err := ojson.Marshal(csFull)
		require.NoError(t, err, cs.Manifest.Name)
		if !skipStrictComparison {
			require.Equal(t, faunCSS[cs.Manifest.Name], string(jBytes), fmt.Errorf("contract %s state mismatch", cs.Manifest.Name))
		}
	}
}

func TestManagement_ContractCache(t *testing.T) {
	c := newCustomNativeClient(t, nativenames.Management, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFAspidochelone.String(): 0,
			config.HFBasilisk.String():      0,
			config.HFCockatrice.String():    0,
			config.HFDomovoi.String():       0,
			config.HFEchidna.String():       0,
		}
	})
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.Committee.ScriptHash())
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	// Deploy contract, abort the transaction and check that Management cache wasn't persisted
	// for FAULTed tx at the same block.
	w := io.NewBufBinWriter()
	emit.AppCall(w.BinWriter, managementInvoker.Hash, "deploy", callflag.All, nefBytes, manifestBytes)
	emit.Opcodes(w.BinWriter, opcode.ABORT)
	tx1 := managementInvoker.PrepareInvocation(t, w.Bytes(), managementInvoker.Signers)
	tx2 := managementInvoker.PrepareInvoke(t, "getContract", cs1.Hash.BytesBE())
	tx3 := managementInvoker.PrepareInvoke(t, "isContract", cs1.Hash.BytesBE())
	managementInvoker.AddNewBlock(t, tx1, tx2, tx3)
	managementInvoker.CheckFault(t, tx1.Hash(), "ABORT")
	managementInvoker.CheckHalt(t, tx2.Hash(), stackitem.Null{})
	managementInvoker.CheckHalt(t, tx3.Hash(), stackitem.Make(false)) // here

	// Deploy the contract and check that cache was persisted for HALTed transaction at the same block.
	tx1 = managementInvoker.PrepareInvoke(t, "deploy", nefBytes, manifestBytes)
	tx2 = managementInvoker.PrepareInvoke(t, "getContract", cs1.Hash.BytesBE())
	tx3 = managementInvoker.PrepareInvoke(t, "isContract", cs1.Hash.BytesBE())
	managementInvoker.AddNewBlock(t, tx1, tx2, tx3)
	managementInvoker.CheckHalt(t, tx1.Hash())
	aer, err := managementInvoker.Chain.GetAppExecResults(tx2.Hash(), trigger.Application)
	require.NoError(t, err)
	require.Equal(t, vmstate.Halt, aer[0].VMState, aer[0].FaultException)
	require.False(t, aer[0].Stack[0].Equals(stackitem.Null{}))
	managementInvoker.CheckHalt(t, tx3.Hash(), stackitem.Make(true))

	// Check that persisted contract is reachable from the next block and native contracts
	// are cached poperly.
	for _, h := range []util.Uint160{
		cs1.Hash,
		nativehashes.ContractManagement,
		nativehashes.StdLib,
		nativehashes.CryptoLib,
		nativehashes.LedgerContract,
		nativehashes.Tutus,
		nativehashes.Lub,
		nativehashes.PolicyContract,
		nativehashes.RoleManagement,
		nativehashes.OracleContract,
		nativehashes.Notary,
	} {
		t.Run(h.StringLE(), func(t *testing.T) {
			tx1 = managementInvoker.PrepareInvoke(t, "getContract", h.BytesBE())
			tx2 = managementInvoker.PrepareInvoke(t, "isContract", h.BytesBE())
			managementInvoker.AddNewBlock(t, tx1, tx2)
			managementInvoker.CheckHalt(t, tx1.Hash())
			aer, err = managementInvoker.Chain.GetAppExecResults(tx1.Hash(), trigger.Application)
			require.NoError(t, err)
			require.Equal(t, vmstate.Halt, aer[0].VMState, aer[0].FaultException)
			cs := aer[0].Stack[0]
			require.False(t, cs.Equals(stackitem.Null{}))
			managementInvoker.CheckHalt(t, tx2.Hash(), stackitem.Make(true))
		})
	}
}

func TestManagement_ContractDeploy(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.Committee.ScriptHash())
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	t.Run("no NEF", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "no valid NEF provided", "deploy", nil, manifestBytes)
	})
	t.Run("no manifest", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "no valid manifest provided", "deploy", nefBytes, nil)
	})
	t.Run("int for NEF", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid NEF file", "deploy", int64(1), manifestBytes)
	})
	t.Run("zero-length NEF", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid NEF file", "deploy", []byte{}, manifestBytes)
	})
	t.Run("array for NEF", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid NEF file", "deploy", []any{int64(1)}, manifestBytes)
	})
	t.Run("bad script in NEF", func(t *testing.T) {
		nf, err := nef.FileFromBytes(nefBytes) // make a full copy
		require.NoError(t, err)
		nf.Script[0] = 0xff
		nf.CalculateChecksum()
		nefBad, err := nf.Bytes()
		require.NoError(t, err)
		managementInvoker.InvokeFail(t, "invalid NEF file", "deploy", nefBad, manifestBytes)
	})
	t.Run("int for manifest", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid manifest", "deploy", nefBytes, int64(1))
	})
	t.Run("zero-length manifest", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid manifest", "deploy", nefBytes, []byte{})
	})
	t.Run("array for manifest", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid manifest", "deploy", nefBytes, []any{int64(1)})
	})
	t.Run("non-utf8 manifest", func(t *testing.T) {
		manifestBad := bytes.Replace(manifestBytes, []byte("TestMain"), []byte("\xff\xfe\xfd"), 1) // Replace name.
		managementInvoker.InvokeFail(t, "manifest is not UTF-8 compliant", "deploy", nefBytes, manifestBad)
	})
	t.Run("invalid manifest", func(t *testing.T) {
		pkey, err := keys.NewPrivateKey()
		require.NoError(t, err)

		badManifest := cs1.Manifest
		badManifest.Groups = []manifest.Group{{PublicKey: pkey.PublicKey(), Signature: make([]byte, keys.SignatureLen)}}
		manifB, err := json.Marshal(&badManifest)
		require.NoError(t, err)

		managementInvoker.InvokeFail(t, "invalid manifest", "deploy", nefBytes, manifB)
	})
	t.Run("bad methods in manifest 1", func(t *testing.T) {
		badManifest := cs1.Manifest
		badManifest.ABI.Methods = slices.Clone(cs1.Manifest.ABI.Methods)
		badManifest.ABI.Methods[0].Offset = 100500 // out of bounds
		manifB, err := json.Marshal(&badManifest)
		require.NoError(t, err)

		managementInvoker.InvokeFail(t, "method add/2: offset is out of the script range", "deploy", nefBytes, manifB)
	})
	t.Run("bad methods in manifest 2", func(t *testing.T) {
		var badManifest = cs1.Manifest
		badManifest.ABI.Methods = slices.Clone(cs1.Manifest.ABI.Methods)
		badManifest.ABI.Methods[0].Offset = len(cs1.NEF.Script) - 2 // Ends with `CALLT(X,X);RET`.

		manifB, err := json.Marshal(badManifest)
		require.NoError(t, err)

		managementInvoker.InvokeFail(t, "some methods point to wrong offsets (not to instruction boundary)", "deploy", nefBytes, manifB)
	})
	t.Run("duplicated methods in manifest 1", func(t *testing.T) {
		badManifest := cs1.Manifest
		badManifest.ABI.Methods = slices.Clone(cs1.Manifest.ABI.Methods)
		badManifest.ABI.Methods[0] = badManifest.ABI.Methods[1] // duplicates
		manifB, err := json.Marshal(&badManifest)
		require.NoError(t, err)

		managementInvoker.InvokeFail(t, "duplicate method specifications", "deploy", nefBytes, manifB)
	})
	t.Run("duplicated events in manifest 1", func(t *testing.T) {
		badManifest := cs1.Manifest
		badManifest.ABI.Methods = slices.Clone(cs1.Manifest.ABI.Methods)
		badManifest.ABI.Events = []manifest.Event{{Name: "event"}, {Name: "event"}} // duplicates
		manifB, err := json.Marshal(&badManifest)
		require.NoError(t, err)

		managementInvoker.InvokeFail(t, "duplicate event names", "deploy", nefBytes, manifB)
	})

	t.Run("not enough GAS", func(t *testing.T) {
		tx := managementInvoker.NewUnsignedTx(t, managementInvoker.Hash, "deploy", nefBytes, manifestBytes)
		managementInvoker.SignTx(t, tx, 1_0000_0000, managementInvoker.Signers...)
		managementInvoker.AddNewBlock(t, tx)
		managementInvoker.CheckFault(t, tx.Hash(), "gas limit exceeded")
	})

	si, err := cs1.ToStackItem()
	require.NoError(t, err)

	t.Run("positive", func(t *testing.T) {
		tx1 := managementInvoker.PrepareInvoke(t, "deploy", nefBytes, manifestBytes)
		tx2 := managementInvoker.PrepareInvoke(t, "getContract", cs1.Hash.BytesBE())
		managementInvoker.AddNewBlock(t, tx1, tx2)
		managementInvoker.CheckHalt(t, tx1.Hash(), si)
		managementInvoker.CheckHalt(t, tx2.Hash(), si)
		managementInvoker.CheckTxNotificationEvent(t, tx1.Hash(), 0, state.NotificationEvent{
			ScriptHash: c.NativeHash(t, nativenames.Management),
			Name:       "Deploy",
			Item:       stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(cs1.Hash.BytesBE())}),
		})
		t.Run("_deploy called", func(t *testing.T) {
			helperInvoker := c.CommitteeInvoker(cs1.Hash)
			expected := stackitem.NewArray([]stackitem.Item{stackitem.Make("create"), stackitem.Null{}})
			expectedBytes, err := stackitem.Serialize(expected)
			require.NoError(t, err)
			helperInvoker.Invoke(t, stackitem.NewByteArray(expectedBytes), "getValue")
		})
		t.Run("get after deploy", func(t *testing.T) {
			managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
		})
		t.Run("hasMethod after deploy", func(t *testing.T) {
			managementInvoker.Invoke(t, stackitem.NewBool(true), "hasMethod", cs1.Hash.BytesBE(), "add", 2)
			managementInvoker.Invoke(t, stackitem.NewBool(false), "hasMethod", cs1.Hash.BytesBE(), "add", 1)
			managementInvoker.Invoke(t, stackitem.NewBool(false), "hasMethod", cs1.Hash.BytesLE(), "add", 2)
		})
		t.Run("get after restore", func(t *testing.T) {
			w := io.NewBufBinWriter()
			require.NoError(t, chaindump.Dump(c.Chain, w.BinWriter, 0, c.Chain.BlockHeight()+1))
			require.NoError(t, w.Err)

			r := io.NewBinReaderFromBuf(w.Bytes())
			bc2, acc := chain.NewSingle(t)
			e2 := tutustest.NewExecutor(t, bc2, acc, acc)
			managementInvoker2 := e2.CommitteeInvoker(e2.NativeHash(t, nativenames.Management))

			require.NoError(t, chaindump.Restore(bc2, r, 0, c.Chain.BlockHeight()+1, nil))
			require.NoError(t, r.Err)
			managementInvoker2.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
		})
	})
	t.Run("contract already exists", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "contract already exists", "deploy", nefBytes, manifestBytes)
	})
	t.Run("failed _deploy", func(t *testing.T) {
		deployScript := []byte{byte(opcode.ABORT)}
		m := manifest.NewManifest("TestDeployAbort")
		m.ABI.Methods = []manifest.Method{
			{
				Name:   manifest.MethodDeploy,
				Offset: 0,
				Parameters: []manifest.Parameter{
					manifest.NewParameter("data", smartcontract.AnyType),
					manifest.NewParameter("isUpdate", smartcontract.BoolType),
				},
				ReturnType: smartcontract.VoidType,
			},
		}
		nefD, err := nef.NewFile(deployScript)
		require.NoError(t, err)
		nefDb, err := nefD.Bytes()
		require.NoError(t, err)
		manifD, err := json.Marshal(m)
		require.NoError(t, err)
		managementInvoker.InvokeFail(t, "ABORT", "deploy", nefDb, manifD)

		t.Run("get after failed deploy", func(t *testing.T) {
			h := state.CreateContractHash(c.CommitteeHash, nefD.Checksum, m.Name)
			managementInvoker.Invoke(t, stackitem.Null{}, "getContract", h.BytesBE())
		})
	})
	t.Run("bad _deploy", func(t *testing.T) { // invalid _deploy signature
		deployScript := []byte{byte(opcode.RET)}
		m := manifest.NewManifest("TestBadDeploy")
		m.ABI.Methods = []manifest.Method{
			{
				Name:   manifest.MethodDeploy,
				Offset: 0,
				Parameters: []manifest.Parameter{
					manifest.NewParameter("data", smartcontract.AnyType),
					manifest.NewParameter("isUpdate", smartcontract.BoolType),
				},
				ReturnType: smartcontract.ArrayType,
			},
		}
		nefD, err := nef.NewFile(deployScript)
		require.NoError(t, err)
		nefDb, err := nefD.Bytes()
		require.NoError(t, err)
		manifD, err := json.Marshal(m)
		require.NoError(t, err)
		managementInvoker.InvokeFail(t, "invalid return values count: expected 0, got 2", "deploy", nefDb, manifD)

		t.Run("get after bad _deploy", func(t *testing.T) {
			h := state.CreateContractHash(c.CommitteeHash, nefD.Checksum, m.Name)
			managementInvoker.Invoke(t, stackitem.Null{}, "getContract", h.BytesBE())
		})
	})
}

func TestManagement_StartFromHeight(t *testing.T) {
	// Create database to be able to start another chain from the same height later.
	ldbDir := t.TempDir()
	dbConfig := dbconfig.DBConfiguration{
		Type: dbconfig.LevelDB,
		LevelDBOptions: dbconfig.LevelDBOptions{
			DataDirectoryPath: ldbDir,
		},
	}
	newLevelStore, err := storage.NewLevelDBStore(dbConfig.LevelDBOptions)
	require.Nil(t, err, "NewLevelDBStore error")

	// Create blockchain and put contract state to it.
	bc, acc := chain.NewSingleWithCustomConfigAndStore(t, nil, newLevelStore, false)
	go bc.Run()
	e := tutustest.NewExecutor(t, bc, acc, acc)
	c := e.CommitteeInvoker(e.NativeHash(t, nativenames.Management))
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	si, err := cs1.ToStackItem()
	require.NoError(t, err)

	managementInvoker.Invoke(t, si, "deploy", nefBytes, manifestBytes)
	managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())

	// Close current blockchain and start the new one from the same height with the same db.
	bc.Close()
	newLevelStore, err = storage.NewLevelDBStore(dbConfig.LevelDBOptions)
	require.NoError(t, err)
	bc2, acc := chain.NewSingleWithCustomConfigAndStore(t, nil, newLevelStore, true)
	e2 := tutustest.NewExecutor(t, bc2, acc, acc)
	managementInvoker2 := e2.CommitteeInvoker(e2.NativeHash(t, nativenames.Management))

	// Check that initialisation of native Management was correctly performed.
	managementInvoker2.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
}

func TestManagement_DeployManifestOverflow(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	manif1, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nef1, err := nef.NewFile(cs1.NEF.Script)
	require.NoError(t, err)
	nef1b, err := nef1.Bytes()
	require.NoError(t, err)

	w := io.NewBufBinWriter()
	emit.Bytes(w.BinWriter, manif1)
	emit.Int(w.BinWriter, manifest.MaxManifestSize)
	emit.Opcodes(w.BinWriter, opcode.NEWBUFFER, opcode.CAT)
	emit.Bytes(w.BinWriter, nef1b)
	emit.Int(w.BinWriter, 2)
	emit.Opcodes(w.BinWriter, opcode.PACK)
	emit.AppCallNoArgs(w.BinWriter, managementInvoker.Hash, "deploy", callflag.All)
	require.NoError(t, w.Err)
	script := w.Bytes()

	tx := transaction.New(script, 0)
	tx.ValidUntilBlock = managementInvoker.Chain.BlockHeight() + 1
	managementInvoker.SignTx(t, tx, 100_0000_0000, managementInvoker.Signers...)
	managementInvoker.AddNewBlock(t, tx)
	managementInvoker.CheckFault(t, tx.Hash(), fmt.Sprintf("invalid manifest: len is %d (max %d)", manifest.MaxManifestSize+len(manif1), manifest.MaxManifestSize))
}

func TestManagement_ContractDeployAndUpdateWithParameter(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	cs1.Manifest.Permissions = []manifest.Permission{*manifest.NewPermission(manifest.PermissionWildcard)}
	cs1.ID = 1
	cs1.Hash = state.CreateContractHash(c.CommitteeHash, cs1.NEF.Checksum, cs1.Manifest.Name)
	manif1, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nef1b, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	si, err := cs1.ToStackItem()
	require.NoError(t, err)
	managementInvoker.Invoke(t, si, "deploy", nef1b, manif1)
	helperInvoker := c.CommitteeInvoker(cs1.Hash)

	t.Run("_deploy called", func(t *testing.T) {
		expected := stackitem.NewArray([]stackitem.Item{stackitem.Make("create"), stackitem.Null{}})
		expectedBytes, err := stackitem.Serialize(expected)
		require.NoError(t, err)
		helperInvoker.Invoke(t, stackitem.NewByteArray(expectedBytes), "getValue")
	})

	cs1.NEF.Script = append(cs1.NEF.Script, byte(opcode.RET))
	cs1.NEF.Checksum = cs1.NEF.CalculateChecksum()
	nef1b, err = cs1.NEF.Bytes()
	require.NoError(t, err)
	cs1.UpdateCounter++

	helperInvoker.Invoke(t, stackitem.Null{}, "update", nef1b, nil, "new data")

	t.Run("_deploy called", func(t *testing.T) {
		expected := stackitem.NewArray([]stackitem.Item{stackitem.Make("update"), stackitem.Make("new data")})
		expectedBytes, err := stackitem.Serialize(expected)
		require.NoError(t, err)
		helperInvoker.Invoke(t, stackitem.NewByteArray(expectedBytes), "getValue")
	})
}

func TestManagement_ContractUpdate(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	// Allow calling management contract.
	cs1.Manifest.Permissions = []manifest.Permission{*manifest.NewPermission(manifest.PermissionWildcard)}
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	si, err := cs1.ToStackItem()
	require.NoError(t, err)
	managementInvoker.Invoke(t, si, "deploy", nefBytes, manifestBytes)
	helperInvoker := c.CommitteeInvoker(cs1.Hash)

	t.Run("unknown contract", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "contract doesn't exist", "update", nefBytes, manifestBytes)
	})
	t.Run("zero-length NEF", func(t *testing.T) {
		helperInvoker.InvokeFail(t, "invalid NEF file: empty", "update", []byte{}, manifestBytes)
	})
	t.Run("zero-length manifest", func(t *testing.T) {
		helperInvoker.InvokeFail(t, "invalid manifest: empty", "update", nefBytes, []byte{})
	})
	t.Run("no real params", func(t *testing.T) {
		helperInvoker.InvokeFail(t, "both NEF and manifest are nil", "update", nil, nil)
	})
	t.Run("invalid manifest", func(t *testing.T) {
		pkey, err := keys.NewPrivateKey()
		require.NoError(t, err)

		var badManifest = cs1.Manifest
		badManifest.Groups = []manifest.Group{{PublicKey: pkey.PublicKey(), Signature: make([]byte, keys.SignatureLen)}}
		manifB, err := json.Marshal(badManifest)
		require.NoError(t, err)

		helperInvoker.InvokeFail(t, "invalid manifest: incorrect group signature", "update", nefBytes, manifB)
	})
	t.Run("manifest and script mismatch", func(t *testing.T) {
		nf, err := nef.FileFromBytes(nefBytes) // Make a full copy.
		require.NoError(t, err)
		nf.Script = append(nf.Script, byte(opcode.RET))
		copy(nf.Script[1:], nf.Script)  // Now all method offsets are wrong.
		nf.Script[0] = byte(opcode.RET) // Even though the script is correct.
		nf.CalculateChecksum()
		nefnew, err := nf.Bytes()
		require.NoError(t, err)
		helperInvoker.InvokeFail(t, "invalid NEF file: checksum verification failure", "update", nefnew, manifestBytes)
	})

	t.Run("change name", func(t *testing.T) {
		var badManifest = cs1.Manifest
		badManifest.Name += "tail"
		manifB, err := json.Marshal(badManifest)
		require.NoError(t, err)

		helperInvoker.InvokeFail(t, "contract name can't be changed", "update", nefBytes, manifB)
	})

	cs1.NEF.Script = append(cs1.NEF.Script, byte(opcode.RET))
	cs1.NEF.Checksum = cs1.NEF.CalculateChecksum()
	nefBytes, err = cs1.NEF.Bytes()
	require.NoError(t, err)
	cs1.UpdateCounter++
	si, err = cs1.ToStackItem()
	require.NoError(t, err)

	t.Run("update script, positive", func(t *testing.T) {
		tx1 := helperInvoker.PrepareInvoke(t, "update", nefBytes, nil)
		tx2 := managementInvoker.PrepareInvoke(t, "getContract", cs1.Hash.BytesBE())
		managementInvoker.AddNewBlock(t, tx1, tx2)
		managementInvoker.CheckHalt(t, tx1.Hash(), stackitem.Null{})
		managementInvoker.CheckHalt(t, tx2.Hash(), si)
		managementInvoker.CheckTxNotificationEvent(t, tx1.Hash(), 0, state.NotificationEvent{
			ScriptHash: c.NativeHash(t, nativenames.Management),
			Name:       "Update",
			Item:       stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(cs1.Hash.BytesBE())}),
		})
		t.Run("_deploy called", func(t *testing.T) {
			helperInvoker := c.CommitteeInvoker(cs1.Hash)
			expected := stackitem.NewArray([]stackitem.Item{stackitem.Make("update"), stackitem.Null{}})
			expectedBytes, err := stackitem.Serialize(expected)
			require.NoError(t, err)
			helperInvoker.Invoke(t, stackitem.NewByteArray(expectedBytes), "getValue")
		})
		t.Run("check contract", func(t *testing.T) {
			managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
		})
	})

	cs1.Manifest.Extra = []byte(`"update me"`)
	manifestBytes, err = json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	cs1.UpdateCounter++
	si, err = cs1.ToStackItem()
	require.NoError(t, err)

	t.Run("update manifest, positive", func(t *testing.T) {
		updHash := helperInvoker.Invoke(t, stackitem.Null{}, "update", nil, manifestBytes)
		helperInvoker.CheckTxNotificationEvent(t, updHash, 0, state.NotificationEvent{
			ScriptHash: helperInvoker.NativeHash(t, nativenames.Management),
			Name:       "Update",
			Item:       stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(cs1.Hash.BytesBE())}),
		})
		t.Run("check contract", func(t *testing.T) {
			managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
		})
	})

	cs1.NEF.Script = append(cs1.NEF.Script, byte(opcode.ABORT))
	cs1.NEF.Checksum = cs1.NEF.CalculateChecksum()
	nefBytes, err = cs1.NEF.Bytes()
	require.NoError(t, err)
	cs1.Manifest.Extra = []byte(`"update me once more"`)
	manifestBytes, err = json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	cs1.UpdateCounter++
	si, err = cs1.ToStackItem()
	require.NoError(t, err)

	t.Run("update both script and manifest", func(t *testing.T) {
		updHash := helperInvoker.Invoke(t, stackitem.Null{}, "update", nefBytes, manifestBytes)
		helperInvoker.CheckTxNotificationEvent(t, updHash, 0, state.NotificationEvent{
			ScriptHash: helperInvoker.NativeHash(t, nativenames.Management),
			Name:       "Update",
			Item:       stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(cs1.Hash.BytesBE())}),
		})
		t.Run("check contract", func(t *testing.T) {
			managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
		})
	})
}

func TestManagement_GetContract(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	si, err := cs1.ToStackItem()
	require.NoError(t, err)
	managementInvoker.Invoke(t, si, "deploy", nefBytes, manifestBytes)

	t.Run("bad parameter type", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid conversion: Array/ByteString", "getContract", []any{int64(1)})
	})
	t.Run("not a hash", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "expected byte size of 20 got 3", "getContract", []byte{1, 2, 3})
	})
	t.Run("positive", func(t *testing.T) {
		managementInvoker.Invoke(t, si, "getContract", cs1.Hash.BytesBE())
	})
	t.Run("by ID, bad parameter type", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "invalid conversion: Array/Integer", "getContractById", []any{int64(1)})
	})
	t.Run("by ID, bad num", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "id is not a correct int32", "getContractById", []byte{1, 2, 3, 4, 5})
	})
	t.Run("by ID, positive", func(t *testing.T) {
		managementInvoker.Invoke(t, si, "getContractById", cs1.ID)
	})
	t.Run("by ID, native", func(t *testing.T) {
		csm := managementInvoker.Chain.GetContractState(managementInvoker.Hash)
		require.NotNil(t, csm)
		sim, err := csm.ToStackItem()
		require.NoError(t, err)
		managementInvoker.Invoke(t, sim, "getContractById", -1)
	})
	t.Run("by ID, empty", func(t *testing.T) {
		managementInvoker.Invoke(t, stackitem.Null{}, "getContractById", -100)
	})
	t.Run("contract hashes", func(t *testing.T) {
		w := io.NewBufBinWriter()
		emit.AppCall(w.BinWriter, managementInvoker.Hash, "getContractHashes", callflag.All)
		emit.Opcodes(w.BinWriter, opcode.DUP) // Iterator.
		emit.Syscall(w.BinWriter, interopnames.SystemIteratorNext)
		emit.Opcodes(w.BinWriter, opcode.ASSERT) // Has one element.
		emit.Opcodes(w.BinWriter, opcode.DUP)    // Iterator.
		emit.Syscall(w.BinWriter, interopnames.SystemIteratorValue)
		emit.Opcodes(w.BinWriter, opcode.SWAP) // Iterator to the top.
		emit.Syscall(w.BinWriter, interopnames.SystemIteratorNext)
		emit.Opcodes(w.BinWriter, opcode.NOT)
		emit.Opcodes(w.BinWriter, opcode.ASSERT) // No more elements, single value left on the stack.
		require.NoError(t, w.Err)
		h := managementInvoker.InvokeScript(t, w.Bytes(), managementInvoker.Signers)
		managementInvoker.CheckHalt(t, h, stackitem.NewStruct([]stackitem.Item{stackitem.Make([]byte{0, 0, 0, 1}), stackitem.Make(cs1.Hash.BytesBE())}))
	})
}

func TestManagement_ContractDestroy(t *testing.T) {
	c := newManagementClient(t)
	managementInvoker := c.WithSigners(c.Committee)

	cs1, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, c.CommitteeHash)
	// Allow calling management contract.
	cs1.Manifest.Permissions = []manifest.Permission{*manifest.NewPermission(manifest.PermissionWildcard)}
	manifestBytes, err := json.Marshal(cs1.Manifest)
	require.NoError(t, err)
	nefBytes, err := cs1.NEF.Bytes()
	require.NoError(t, err)

	si, err := cs1.ToStackItem()
	require.NoError(t, err)
	managementInvoker.Invoke(t, si, "deploy", nefBytes, manifestBytes)
	helperInvoker := c.CommitteeInvoker(cs1.Hash)

	t.Run("no contract", func(t *testing.T) {
		managementInvoker.InvokeFail(t, "key not found", "destroy")
	})
	t.Run("positive", func(t *testing.T) {
		dstrHash := helperInvoker.Invoke(t, stackitem.Null{}, "destroy")
		helperInvoker.CheckTxNotificationEvent(t, dstrHash, 0, state.NotificationEvent{
			ScriptHash: helperInvoker.NativeHash(t, nativenames.Management),
			Name:       "Destroy",
			Item:       stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(cs1.Hash.BytesBE())}),
		})
		t.Run("check contract", func(t *testing.T) {
			managementInvoker.Invoke(t, stackitem.Null{}, "getContract", cs1.Hash.BytesBE())
		})
		// deploy after destroy should fail
		managementInvoker.InvokeFail(t, fmt.Sprintf("the contract %s has been blocked", cs1.Hash.StringLE()), "deploy", nefBytes, manifestBytes)
	})
}

func TestManagement_WhitelistedUpdate(t *testing.T) {
	bc, acc := chain.NewSingleWithCustomConfig(t, func(cfg *config.Blockchain) {
		cfg.Hardforks = map[string]uint32{
			config.HFFaun.String(): 0,
		}
	})
	e := tutustest.NewExecutor(t, bc, acc, acc)
	m := e.CommitteeInvoker(nativehashes.ContractManagement)
	p := e.CommitteeInvoker(nativehashes.PolicyContract)
	src := `package free
		import "git.marketally.com/tutus-one/tutus-chain/pkg/interop/native/management"
		func FreeInc(i int) int {
			i++
			return i
		}
		func Update(m []byte) {
			management.Update(nil, m)
		}
		func Destroy() {
			management.Destroy()
		}`

	ctr := tutustest.CompileSource(t, e.Validator.ScriptHash(), strings.NewReader(src), &compiler.Options{
		Name: "free contract",
		Permissions: []manifest.Permission{
			{
				Methods: manifest.WildStrings{
					Value: []string{"update", "destroy"},
				},
			},
		},
	})
	m.DeployContract(t, ctr, nil)

	// Whitelist some method and check execution price and notifications.
	ctrInvoker := e.NewInvoker(ctr.Hash, e.Committee)
	h1 := ctrInvoker.Invoke(t, stackitem.Make(2), "freeInc", 1) // reference invocation.
	txWhitelist := p.Invoke(t, stackitem.Null{}, "setWhitelistFeeContract", ctr.Hash, "freeInc", 1, 0)
	h2 := ctrInvoker.Invoke(t, stackitem.Make(2), "freeInc", 1) // free invocation.
	res1 := e.GetTxExecResult(t, h1)
	res2 := e.GetTxExecResult(t, h2)
	require.Less(t, res2.GasConsumed, res1.GasConsumed)
	e.CheckTxNotificationEvent(t, txWhitelist, 0, state.NotificationEvent{
		ScriptHash: nativehashes.PolicyContract,
		Name:       "WhitelistFeeChanged",
		Item: stackitem.NewArray([]stackitem.Item{
			stackitem.Make(ctr.Hash.BytesBE()),
			stackitem.Make("freeInc"),
			stackitem.Make(1),
			stackitem.Make(0),
		}),
	})

	// Update this contract and check that whitelist is cleared.
	ctr.Manifest.Permissions = []manifest.Permission{
		{
			Methods: manifest.WildStrings{
				Value: []string{"update", "destroy", "someNewMethod"},
			},
		},
	}
	rawManifest, err := json.Marshal(ctr.Manifest)
	require.NoError(t, err)
	txUpdate := ctrInvoker.Invoke(t, stackitem.Null{}, "update", stackitem.Make(rawManifest)) // update invalidates all whitelisted methods of the contract.
	h3 := ctrInvoker.Invoke(t, stackitem.Make(2), "freeInc", 1)                               // non-free invocation.
	res3 := e.GetTxExecResult(t, h3)
	require.Equal(t, res1.GasConsumed, res3.GasConsumed)
	e.CheckTxNotificationEvent(t, txUpdate, 0, state.NotificationEvent{
		ScriptHash: nativehashes.PolicyContract,
		Name:       "WhitelistFeeChanged",
		Item: stackitem.NewArray([]stackitem.Item{
			stackitem.Make(ctr.Hash.BytesBE()),
			stackitem.Make("freeInc"),
			stackitem.Make(1),
			stackitem.Null{},
		}),
	})

	// Set the whitelist one more time and destroy the contract, check that whitelist is cleared.
	p.Invoke(t, stackitem.Null{}, "setWhitelistFeeContract", ctr.Hash, "freeInc", 1, 0)
	txDestroy := ctrInvoker.Invoke(t, stackitem.Null{}, "destroy") // destroy invalidates all whitelisted methods of the contract.
	e.CheckTxNotificationEvent(t, txDestroy, 0, state.NotificationEvent{
		ScriptHash: nativehashes.PolicyContract,
		Name:       "WhitelistFeeChanged",
		Item: stackitem.NewArray([]stackitem.Item{
			stackitem.Make(ctr.Hash.BytesBE()),
			stackitem.Make("freeInc"),
			stackitem.Make(1),
			stackitem.Null{},
		}),
	})
}
