Rename NEO to Annos and GAS to Lub native contracts

Rename the core governance and utility tokens to reflect Tutus
blockchain's identity-centric design:

- NEO -> Annos (Latin for "years" - governance token tied to Vita)
- GAS -> Lub (lubrication - utility/fee token)

File renames:
- native_neo.go -> native_annos.go
- native_gas.go -> native_lub.go
- native_neo_candidate.go -> native_annos_candidate.go

Struct/interface renames:
- NEO struct -> Annos, INEO -> IAnnos
- GAS struct -> Lub, IGAS -> ILub

Constants updated:
- nativenames: Neo="NeoToken" -> Annos="AnnosToken"
- nativenames: Gas="GasToken" -> Lub="LubToken"
- NEOTotalSupply -> AnnosTotalSupply
- GASFactor -> LubFactor

Regenerated nativehashes for new manifest names.

Updated all native contracts, blockchain.go, test files,
CLI wallet, and RPC client packages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tutus Development 2025-12-20 11:34:42 +00:00
parent b5c87b5cf8
commit 64c682cd68
46 changed files with 432 additions and 432 deletions

View File

@ -272,9 +272,9 @@ func getNEPBalance(ctx *cli.Context, standard string, accHandler func(*cli.Conte
var h util.Uint160 var h util.Uint160
// Well-known hardcoded names/symbols. // Well-known hardcoded names/symbols.
if standard == manifest.NEP17StandardName && (name == nativenames.Neo || name == "NEO") { if standard == manifest.NEP17StandardName && (name == nativenames.Annos || name == "NEO") {
h = neo.Hash h = neo.Hash
} else if standard == manifest.NEP17StandardName && (name == nativenames.Gas || name == "GAS") { } else if standard == manifest.NEP17StandardName && (name == nativenames.Lub || name == "GAS") {
h = gas.Hash h = gas.Hash
} else { } else {
// The last resort, maybe it's a direct hash or address. // The last resort, maybe it's a direct hash or address.

View File

@ -113,7 +113,7 @@ func handleRegister(ctx *cli.Context) error {
} }
return gasT.TransferUnsigned( return gasT.TransferUnsigned(
acc.ScriptHash(), acc.ScriptHash(),
nativehashes.NeoToken, nativehashes.AnnosToken,
big.NewInt(regPrice), big.NewInt(regPrice),
acc.PublicKey().Bytes(), acc.PublicKey().Bytes(),
) )

View File

@ -92,8 +92,8 @@ func Init(t *testing.T, rootpath string, e *neotest.Executor) {
notaryModulePath = filepath.Join(rootpath, "pkg", "services", "notary") notaryModulePath = filepath.Join(rootpath, "pkg", "services", "notary")
) )
gasHash := e.NativeHash(t, nativenames.Gas) gasHash := e.NativeHash(t, nativenames.Lub)
neoHash := e.NativeHash(t, nativenames.Neo) neoHash := e.NativeHash(t, nativenames.Annos)
policyHash := e.NativeHash(t, nativenames.Policy) policyHash := e.NativeHash(t, nativenames.Policy)
notaryHash := e.NativeHash(t, nativenames.Notary) notaryHash := e.NativeHash(t, nativenames.Notary)
designationHash := e.NativeHash(t, nativenames.Designation) designationHash := e.NativeHash(t, nativenames.Designation)
@ -149,7 +149,7 @@ func Init(t *testing.T, rootpath string, e *neotest.Executor) {
t.Logf("txMoveNeo base64: %s", base64.StdEncoding.EncodeToString(txMoveNeo.Bytes())) t.Logf("txMoveNeo base64: %s", base64.StdEncoding.EncodeToString(txMoveNeo.Bytes()))
t.Logf("txMoveGas hash: %s", txMoveGas.Hash().StringLE()) t.Logf("txMoveGas hash: %s", txMoveGas.Hash().StringLE())
e.EnsureGASBalance(t, priv0ScriptHash, func(balance *big.Int) bool { return balance.Cmp(big.NewInt(1000*native.GASFactor)) >= 0 }) e.EnsureGASBalance(t, priv0ScriptHash, func(balance *big.Int) bool { return balance.Cmp(big.NewInt(1000*native.LubFactor)) >= 0 })
// info for getblockheader rpc tests // info for getblockheader rpc tests
t.Logf("header hash: %s", b.Hash().StringLE()) t.Logf("header hash: %s", b.Hash().StringLE())
buf := io.NewBufBinWriter() buf := io.NewBufBinWriter()

View File

@ -111,7 +111,7 @@ func NewDeployTx(bc Ledger, name string, sender util.Uint160, r gio.Reader, conf
return nil, util.Uint160{}, nil, err return nil, util.Uint160{}, nil, err
} }
tx := transaction.New(script, 100*native.GASFactor) tx := transaction.New(script, 100*native.LubFactor)
tx.Signers = []transaction.Signer{{Account: sender}} tx.Signers = []transaction.Signer{{Account: sender}}
h := state.CreateContractHash(tx.Sender(), ne.Checksum, m.Name) h := state.CreateContractHash(tx.Sender(), ne.Checksum, m.Name)

View File

@ -213,8 +213,8 @@ type Blockchain struct {
contracts *native.Contracts contracts *native.Contracts
management native.IManagement management native.IManagement
policy native.IPolicy policy native.IPolicy
neo native.INEO annos native.IAnnos
gas native.IGAS lub native.ILub
designate native.IDesignate designate native.IDesignate
oracle native.IOracle oracle native.IOracle
notary native.INotary notary native.INotary
@ -435,18 +435,18 @@ func NewBlockchain(s storage.Store, cfg config.Blockchain, log *zap.Logger, newN
if err := validateNative(bc.management, nativeids.ContractManagement, nativenames.Management, nativehashes.ContractManagement); err != nil { if err := validateNative(bc.management, nativeids.ContractManagement, nativenames.Management, nativehashes.ContractManagement); err != nil {
return nil, err return nil, err
} }
bc.neo = bc.contracts.NEO() bc.annos = bc.contracts.Annos()
if bc.neo == native.INEO(nil) { if bc.annos == native.IAnnos(nil) {
return nil, errors.New("native NeoToken implementation is required") return nil, errors.New("native AnnosToken implementation is required")
} }
if err := validateNative(bc.neo, nativeids.NeoToken, nativenames.Neo, nativehashes.NeoToken); err != nil { if err := validateNative(bc.annos, nativeids.Annos, nativenames.Annos, nativehashes.AnnosToken); err != nil {
return nil, err return nil, err
} }
bc.gas = bc.contracts.GAS() bc.lub = bc.contracts.Lub()
if bc.gas == native.IGAS(nil) { if bc.lub == native.ILub(nil) {
return nil, errors.New("native GasToken implementation is required") return nil, errors.New("native LubToken implementation is required")
} }
if err := validateNative(bc.gas, nativeids.GasToken, nativenames.Gas, nativehashes.GasToken); err != nil { if err := validateNative(bc.lub, nativeids.Lub, nativenames.Lub, nativehashes.LubToken); err != nil {
return nil, err return nil, err
} }
bc.policy = bc.contracts.Policy() bc.policy = bc.contracts.Policy()
@ -2223,8 +2223,8 @@ func (bc *Blockchain) updateExtensibleWhitelist(height uint32) error {
return nil return nil
} }
newList := []util.Uint160{bc.neo.GetCommitteeAddress(bc.dao)} newList := []util.Uint160{bc.annos.GetCommitteeAddress(bc.dao)}
nextVals := bc.neo.GetNextBlockValidatorsInternal(bc.dao) nextVals := bc.annos.GetNextBlockValidatorsInternal(bc.dao)
script, err := smartcontract.CreateDefaultMultiSigRedeemScript(nextVals) script, err := smartcontract.CreateDefaultMultiSigRedeemScript(nextVals)
if err != nil { if err != nil {
return err return err
@ -2469,10 +2469,10 @@ func (bc *Blockchain) GetTokenLastUpdated(acc util.Uint160) (map[int32]uint32, e
return nil, err return nil, err
} }
if bc.config.P2PStateExchangeExtensions && bc.config.RemoveUntraceableBlocks { if bc.config.P2PStateExchangeExtensions && bc.config.RemoveUntraceableBlocks {
if _, ok := info.LastUpdated[bc.neo.Metadata().ID]; !ok { if _, ok := info.LastUpdated[bc.annos.Metadata().ID]; !ok {
nBalance, lub := bc.neo.BalanceOf(bc.dao, acc) nBalance, lub := bc.annos.BalanceOf(bc.dao, acc)
if nBalance.Sign() != 0 { if nBalance.Sign() != 0 {
info.LastUpdated[bc.neo.Metadata().ID] = lub info.LastUpdated[bc.annos.Metadata().ID] = lub
} }
} }
} }
@ -2485,7 +2485,7 @@ func (bc *Blockchain) GetTokenLastUpdated(acc util.Uint160) (map[int32]uint32, e
// GetUtilityTokenBalance returns utility token (GAS) balance for the acc. // GetUtilityTokenBalance returns utility token (GAS) balance for the acc.
func (bc *Blockchain) GetUtilityTokenBalance(acc util.Uint160) *big.Int { func (bc *Blockchain) GetUtilityTokenBalance(acc util.Uint160) *big.Int {
bs := bc.gas.BalanceOf(bc.dao, acc) bs := bc.lub.BalanceOf(bc.dao, acc)
if bs == nil { if bs == nil {
return big.NewInt(0) return big.NewInt(0)
} }
@ -2525,7 +2525,7 @@ func (bc *Blockchain) IsVitaFeeExempt(acc util.Uint160) bool {
// GetGoverningTokenBalance returns governing token (NEO) balance and the height // GetGoverningTokenBalance returns governing token (NEO) balance and the height
// of the last balance change for the account. // of the last balance change for the account.
func (bc *Blockchain) GetGoverningTokenBalance(acc util.Uint160) (*big.Int, uint32) { func (bc *Blockchain) GetGoverningTokenBalance(acc util.Uint160) (*big.Int, uint32) {
return bc.neo.BalanceOf(bc.dao, acc) return bc.annos.BalanceOf(bc.dao, acc)
} }
// GetNotaryBalance returns Notary deposit amount for the specified account. // GetNotaryBalance returns Notary deposit amount for the specified account.
@ -2905,7 +2905,7 @@ func (bc *Blockchain) CalculateClaimable(acc util.Uint160, endHeight uint32) (*b
return nil, err return nil, err
} }
ic := bc.newInteropContext(trigger.Application, bc.dao, nextBlock, nil) ic := bc.newInteropContext(trigger.Application, bc.dao, nextBlock, nil)
return bc.neo.CalculateBonus(ic, acc, endHeight) return bc.annos.CalculateBonus(ic, acc, endHeight)
} }
// FeePerByte returns transaction network fee per byte. // FeePerByte returns transaction network fee per byte.
@ -2932,7 +2932,7 @@ func (bc *Blockchain) ApplyPolicyToTxSet(txes []*transaction.Transaction) []*tra
curVC := bc.config.GetNumOfCNs(bc.BlockHeight() + 1) curVC := bc.config.GetNumOfCNs(bc.BlockHeight() + 1)
if oldVC == nil || oldVC != curVC { if oldVC == nil || oldVC != curVC {
m := smartcontract.GetDefaultHonestNodeCount(curVC) m := smartcontract.GetDefaultHonestNodeCount(curVC)
verification, _ := smartcontract.CreateDefaultMultiSigRedeemScript(bc.neo.GetNextBlockValidatorsInternal(bc.dao)) verification, _ := smartcontract.CreateDefaultMultiSigRedeemScript(bc.annos.GetNextBlockValidatorsInternal(bc.dao))
defaultWitness = transaction.Witness{ defaultWitness = transaction.Witness{
InvocationScript: make([]byte, 66*m), InvocationScript: make([]byte, 66*m),
VerificationScript: verification, VerificationScript: verification,
@ -3094,7 +3094,7 @@ func (bc *Blockchain) verifyTxAttributes(d *dao.Simple, tx *transaction.Transact
for i := range tx.Attributes { for i := range tx.Attributes {
switch attrType := tx.Attributes[i].Type; attrType { switch attrType := tx.Attributes[i].Type; attrType {
case transaction.HighPriority: case transaction.HighPriority:
h := bc.neo.GetCommitteeAddress(d) h := bc.annos.GetCommitteeAddress(d)
if !tx.HasSigner(h) { if !tx.HasSigner(h) {
return fmt.Errorf("%w: high priority tx is not signed by committee", ErrInvalidAttribute) return fmt.Errorf("%w: high priority tx is not signed by committee", ErrInvalidAttribute)
} }
@ -3254,7 +3254,7 @@ func (bc *Blockchain) PoolTxWithData(t *transaction.Transaction, data any, mp *m
// GetCommittee returns the sorted list of public keys of nodes in committee. // GetCommittee returns the sorted list of public keys of nodes in committee.
func (bc *Blockchain) GetCommittee() (keys.PublicKeys, error) { func (bc *Blockchain) GetCommittee() (keys.PublicKeys, error) {
pubs := bc.neo.GetCommitteeMembers(bc.dao) pubs := bc.annos.GetCommitteeMembers(bc.dao)
slices.SortFunc(pubs, (*keys.PublicKey).Cmp) slices.SortFunc(pubs, (*keys.PublicKey).Cmp)
return pubs, nil return pubs, nil
} }
@ -3267,7 +3267,7 @@ func (bc *Blockchain) GetCommittee() (keys.PublicKeys, error) {
// For the not-last block of dBFT epoch this method returns the same list as // For the not-last block of dBFT epoch this method returns the same list as
// GetNextBlockValidators. // GetNextBlockValidators.
func (bc *Blockchain) ComputeNextBlockValidators() []*keys.PublicKey { func (bc *Blockchain) ComputeNextBlockValidators() []*keys.PublicKey {
return bc.neo.ComputeNextBlockValidators(bc.dao) return bc.annos.ComputeNextBlockValidators(bc.dao)
} }
// GetNextBlockValidators returns next block validators. Validators list returned // GetNextBlockValidators returns next block validators. Validators list returned
@ -3277,12 +3277,12 @@ func (bc *Blockchain) ComputeNextBlockValidators() []*keys.PublicKey {
// method is being updated once per (committee size) number of blocks, but not // method is being updated once per (committee size) number of blocks, but not
// every block. // every block.
func (bc *Blockchain) GetNextBlockValidators() ([]*keys.PublicKey, error) { func (bc *Blockchain) GetNextBlockValidators() ([]*keys.PublicKey, error) {
return bc.neo.GetNextBlockValidatorsInternal(bc.dao), nil return bc.annos.GetNextBlockValidatorsInternal(bc.dao), nil
} }
// GetEnrollments returns all registered validators. // GetEnrollments returns all registered validators.
func (bc *Blockchain) GetEnrollments() ([]state.Validator, error) { func (bc *Blockchain) GetEnrollments() ([]state.Validator, error) {
return bc.neo.GetCandidates(bc.dao) return bc.annos.GetCandidates(bc.dao)
} }
// GetTestVM returns an interop context with VM set up for a test run. // GetTestVM returns an interop context with VM set up for a test run.
@ -3524,14 +3524,14 @@ func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header
return err return err
} }
// GoverningTokenHash returns the governing token (NEO) native contract hash. // GoverningTokenHash returns the governing token (Annos) native contract hash.
func (bc *Blockchain) GoverningTokenHash() util.Uint160 { func (bc *Blockchain) GoverningTokenHash() util.Uint160 {
return nativehashes.NeoToken return nativehashes.AnnosToken
} }
// UtilityTokenHash returns the utility token (GAS) native contract hash. // UtilityTokenHash returns the utility token (Lub) native contract hash.
func (bc *Blockchain) UtilityTokenHash() util.Uint160 { func (bc *Blockchain) UtilityTokenHash() util.Uint160 {
return nativehashes.GasToken return nativehashes.LubToken
} }
// ManagementContractHash returns management contract's hash. // ManagementContractHash returns management contract's hash.

View File

@ -23,7 +23,7 @@ import (
// Latin: "collocatio" = placement, arrangement (investment) // Latin: "collocatio" = placement, arrangement (investment)
type Collocatio struct { type Collocatio struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry *RoleRegistry RoleRegistry *RoleRegistry
VTS *VTS VTS *VTS
@ -597,7 +597,7 @@ func (c *Collocatio) activateOpportunity(ic *interop.Context, args []stackitem.I
} }
caller := ic.VM.GetCallingScriptHash() caller := ic.VM.GetCallingScriptHash()
if caller != opp.Creator && !c.NEO.CheckCommittee(ic) { if caller != opp.Creator && !c.Annos.CheckCommittee(ic) {
panic("only creator or committee can activate") panic("only creator or committee can activate")
} }
@ -792,7 +792,7 @@ func (c *Collocatio) setEligibility(ic *interop.Context, args []stackitem.Item)
eligFlags := state.EligibilityType(toUint64(args[1])) eligFlags := state.EligibilityType(toUint64(args[1]))
// Only committee or RoleInvestmentManager can set eligibility // Only committee or RoleInvestmentManager can set eligibility
if !c.NEO.CheckCommittee(ic) { if !c.Annos.CheckCommittee(ic) {
caller := ic.VM.GetCallingScriptHash() caller := ic.VM.GetCallingScriptHash()
if !c.RoleRegistry.HasRoleInternal(ic.DAO, caller, RoleInvestmentManager, ic.Block.Index) { if !c.RoleRegistry.HasRoleInternal(ic.DAO, caller, RoleInvestmentManager, ic.Block.Index) {
panic("only committee or investment manager can set eligibility") panic("only committee or investment manager can set eligibility")

View File

@ -29,9 +29,9 @@ type (
GetNEP17Contracts(d *dao.Simple) []util.Uint160 GetNEP17Contracts(d *dao.Simple) []util.Uint160
} }
// INEO is an interface required from native NeoToken contract for // IAnnos is an interface required from native AnnosToken contract for
// interaction with Blockchain and other native contracts. // interaction with Blockchain and other native contracts.
INEO interface { IAnnos interface {
interop.Contract interop.Contract
GetCommitteeAddress(d *dao.Simple) util.Uint160 GetCommitteeAddress(d *dao.Simple) util.Uint160
GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys
@ -46,9 +46,9 @@ type (
RevokeVotes(ic *interop.Context, h util.Uint160) error RevokeVotes(ic *interop.Context, h util.Uint160) error
} }
// IGAS is an interface required from native GasToken contract for // ILub is an interface required from native LubToken contract for
// interaction with Blockchain and other native contracts. // interaction with Blockchain and other native contracts.
IGAS interface { ILub interface {
interop.Contract interop.Contract
BalanceOf(d *dao.Simple, acc util.Uint160) *big.Int BalanceOf(d *dao.Simple, acc util.Uint160) *big.Int
@ -61,10 +61,10 @@ type (
// interaction with Blockchain and other native contracts. // interaction with Blockchain and other native contracts.
IPolicy interface { IPolicy interface {
interop.Contract interop.Contract
// GetStoragePriceInternal returns the current storage price in picoGAS units. // GetStoragePriceInternal returns the current storage price in picoLub units.
GetStoragePriceInternal(d *dao.Simple) int64 GetStoragePriceInternal(d *dao.Simple) int64
GetMaxVerificationGas(d *dao.Simple) int64 GetMaxVerificationGas(d *dao.Simple) int64
// GetExecFeeFactorInternal returns the current execution fee factor in picoGAS units. // GetExecFeeFactorInternal returns the current execution fee factor in picoLub units.
GetExecFeeFactorInternal(d *dao.Simple) int64 GetExecFeeFactorInternal(d *dao.Simple) int64
GetMaxTraceableBlocksInternal(d *dao.Simple) uint32 GetMaxTraceableBlocksInternal(d *dao.Simple) uint32
GetMillisecondsPerBlockInternal(d *dao.Simple) uint32 GetMillisecondsPerBlockInternal(d *dao.Simple) uint32
@ -128,11 +128,11 @@ type (
// IRoleRegistry is an interface required from native RoleRegistry contract // IRoleRegistry is an interface required from native RoleRegistry contract
// for interaction with Blockchain and other native contracts. // for interaction with Blockchain and other native contracts.
// RoleRegistry provides democratic governance for Tutus, replacing NEO.CheckCommittee(). // RoleRegistry provides democratic governance for Tutus, replacing Annos.CheckCommittee().
IRoleRegistry interface { IRoleRegistry interface {
interop.Contract interop.Contract
// CheckCommittee returns true if caller has COMMITTEE role. // CheckCommittee returns true if caller has COMMITTEE role.
// This replaces NEO.CheckCommittee() for Tutus democratic governance. // This replaces Annos.CheckCommittee() for Tutus democratic governance.
CheckCommittee(ic *interop.Context) bool CheckCommittee(ic *interop.Context) bool
// HasRoleInternal checks if address has role (includes hierarchy). // HasRoleInternal checks if address has role (includes hierarchy).
HasRoleInternal(d *dao.Simple, address util.Uint160, roleID uint64, blockHeight uint32) bool HasRoleInternal(d *dao.Simple, address util.Uint160, roleID uint64, blockHeight uint32) bool
@ -372,16 +372,16 @@ func (cs *Contracts) Management() IManagement {
return cs.ByName(nativenames.Management).(IManagement) return cs.ByName(nativenames.Management).(IManagement)
} }
// NEO returns native INEO contract implementation. It panics if there's no // Annos returns native IAnnos contract implementation. It panics if there's no
// contract with proper name in cs. // contract with proper name in cs.
func (cs *Contracts) NEO() INEO { func (cs *Contracts) Annos() IAnnos {
return cs.ByName(nativenames.Neo).(INEO) return cs.ByName(nativenames.Annos).(IAnnos)
} }
// GAS returns native IGAS contract implementation. It panics if there's no // Lub returns native ILub contract implementation. It panics if there's no
// contract with proper name in cs. // contract with proper name in cs.
func (cs *Contracts) GAS() IGAS { func (cs *Contracts) Lub() ILub {
return cs.ByName(nativenames.Gas).(IGAS) return cs.ByName(nativenames.Lub).(ILub)
} }
// Designate returns native IDesignate contract implementation. It panics if // Designate returns native IDesignate contract implementation. It panics if
@ -503,37 +503,37 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
c := newCrypto() c := newCrypto()
ledger := NewLedger() ledger := NewLedger()
gas := newGAS(int64(cfg.InitialGASSupply)) lub := newLub(int64(cfg.InitialGASSupply))
neo := newNEO(cfg) annos := newAnnos(cfg)
policy := newPolicy() policy := newPolicy()
neo.GAS = gas annos.Lub = lub
neo.Policy = policy annos.Policy = policy
gas.NEO = neo lub.Annos = annos
gas.Policy = policy lub.Policy = policy
mgmt.NEO = neo mgmt.Annos = annos
mgmt.Policy = policy mgmt.Policy = policy
policy.NEO = neo policy.Annos = annos
ledger.Policy = policy ledger.Policy = policy
desig := NewDesignate(cfg.Genesis.Roles) desig := NewDesignate(cfg.Genesis.Roles)
desig.NEO = neo desig.Annos = annos
oracle := newOracle() oracle := newOracle()
oracle.GAS = gas oracle.Lub = lub
oracle.NEO = neo oracle.Annos = annos
oracle.Desig = desig oracle.Desig = desig
notary := newNotary() notary := newNotary()
notary.GAS = gas notary.Lub = lub
notary.NEO = neo notary.Annos = annos
notary.Desig = desig notary.Desig = desig
notary.Policy = policy notary.Policy = policy
treasury := newTreasury() treasury := newTreasury()
treasury.NEO = neo treasury.Annos = annos
vita := newVita() vita := newVita()
vita.NEO = neo vita.Annos = annos
// Parse TutusCommittee addresses from config // Parse TutusCommittee addresses from config
var tutusCommittee []util.Uint160 var tutusCommittee []util.Uint160
@ -549,24 +549,24 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
tutusCommittee = append(tutusCommittee, addr) tutusCommittee = append(tutusCommittee, addr)
} }
roleRegistry := newRoleRegistry(tutusCommittee) roleRegistry := newRoleRegistry(tutusCommittee)
roleRegistry.NEO = neo roleRegistry.Annos = annos
// Set RoleRegistry on Vita for cross-contract integration // Set RoleRegistry on Vita for cross-contract integration
vita.RoleRegistry = roleRegistry vita.RoleRegistry = roleRegistry
// Create VTS (Value Transfer System) contract // Create VTS (Value Transfer System) contract
vts := newVTS() vts := newVTS()
vts.NEO = neo vts.Annos = annos
vts.RoleRegistry = roleRegistry vts.RoleRegistry = roleRegistry
vts.Vita = vita vts.Vita = vita
// Create Federation contract for cross-chain Vita coordination // Create Federation contract for cross-chain Vita coordination
federation := newFederation() federation := newFederation()
federation.NEO = neo federation.Annos = annos
// Create Lex (Law Registry) contract for universal rights and law enforcement // Create Lex (Law Registry) contract for universal rights and law enforcement
lex := newLex() lex := newLex()
lex.NEO = neo lex.Annos = annos
lex.Vita = vita lex.Vita = vita
lex.RoleRegistry = roleRegistry lex.RoleRegistry = roleRegistry
lex.Federation = federation lex.Federation = federation
@ -577,42 +577,42 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
// Wire Lex into Vita for liberty rights enforcement (due process) // Wire Lex into Vita for liberty rights enforcement (due process)
vita.Lex = lex vita.Lex = lex
// Wire GAS dependencies for Vita fee exemption // Wire Lub dependencies for Vita fee exemption
gas.Vita = vita lub.Vita = vita
gas.Federation = federation lub.Federation = federation
gas.Treasury = treasury lub.Treasury = treasury
// Create Eligere (Democratic Voting) contract // Create Eligere (Democratic Voting) contract
eligere := newEligere() eligere := newEligere()
eligere.NEO = neo eligere.Annos = annos
eligere.Vita = vita eligere.Vita = vita
eligere.RoleRegistry = roleRegistry eligere.RoleRegistry = roleRegistry
eligere.Lex = lex eligere.Lex = lex
// Create Scire (Universal Education) contract // Create Scire (Universal Education) contract
scire := newScire() scire := newScire()
scire.NEO = neo scire.Annos = annos
scire.Vita = vita scire.Vita = vita
scire.RoleRegistry = roleRegistry scire.RoleRegistry = roleRegistry
scire.Lex = lex scire.Lex = lex
// Create Salus (Universal Healthcare) contract // Create Salus (Universal Healthcare) contract
salus := newSalus() salus := newSalus()
salus.NEO = neo salus.Annos = annos
salus.Vita = vita salus.Vita = vita
salus.RoleRegistry = roleRegistry salus.RoleRegistry = roleRegistry
salus.Lex = lex salus.Lex = lex
// Create Sese (Life Planning) contract // Create Sese (Life Planning) contract
sese := newSese() sese := newSese()
sese.NEO = neo sese.Annos = annos
sese.Vita = vita sese.Vita = vita
sese.RoleRegistry = roleRegistry sese.RoleRegistry = roleRegistry
sese.Lex = lex sese.Lex = lex
// Create Tribute (Anti-Hoarding Economics) contract // Create Tribute (Anti-Hoarding Economics) contract
tribute := newTribute() tribute := newTribute()
tribute.NEO = neo tribute.Annos = annos
tribute.Vita = vita tribute.Vita = vita
tribute.VTS = vts tribute.VTS = vts
tribute.RoleRegistry = roleRegistry tribute.RoleRegistry = roleRegistry
@ -620,7 +620,7 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
// Create Opus (AI Workforce Integration) contract // Create Opus (AI Workforce Integration) contract
opus := newOpus() opus := newOpus()
opus.NEO = neo opus.Annos = annos
opus.Vita = vita opus.Vita = vita
opus.VTS = vts opus.VTS = vts
opus.RoleRegistry = roleRegistry opus.RoleRegistry = roleRegistry
@ -629,14 +629,14 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
// Create Palam (Programmed Transparency) contract // Create Palam (Programmed Transparency) contract
palam := NewPalam() palam := NewPalam()
palam.NEO = neo palam.Annos = annos
palam.Vita = vita palam.Vita = vita
palam.RoleRegistry = roleRegistry palam.RoleRegistry = roleRegistry
palam.Lex = lex palam.Lex = lex
// Create Pons (Inter-Government Bridge) contract // Create Pons (Inter-Government Bridge) contract
pons := newPons() pons := newPons()
pons.NEO = neo pons.Annos = annos
pons.Vita = vita pons.Vita = vita
pons.Federation = federation pons.Federation = federation
pons.RoleRegistry = roleRegistry pons.RoleRegistry = roleRegistry
@ -646,7 +646,7 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
// Create Collocatio (Democratic Investment) contract // Create Collocatio (Democratic Investment) contract
collocatio := newCollocatio() collocatio := newCollocatio()
collocatio.NEO = neo collocatio.Annos = annos
collocatio.Vita = vita collocatio.Vita = vita
collocatio.RoleRegistry = roleRegistry collocatio.RoleRegistry = roleRegistry
collocatio.VTS = vts collocatio.VTS = vts
@ -659,8 +659,8 @@ func NewDefaultContracts(cfg config.ProtocolConfiguration) []interop.Contract {
s, s,
c, c,
ledger, ledger,
neo, annos,
gas, lub,
policy, policy,
desig, desig,
oracle, oracle,

View File

@ -30,7 +30,7 @@ import (
// Designate represents a designation contract. // Designate represents a designation contract.
type Designate struct { type Designate struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
// initialNodeRoles defines a set of node roles that should be defined at the contract // initialNodeRoles defines a set of node roles that should be defined at the contract
// deployment (initialization). // deployment (initialization).
@ -405,7 +405,7 @@ func (s *Designate) DesignateAsRole(ic *interop.Context, r noderoles.Role, pubs
} }
if ic.Trigger != trigger.OnPersist { if ic.Trigger != trigger.OnPersist {
h := s.NEO.GetCommitteeAddress(ic.DAO) h := s.Annos.GetCommitteeAddress(ic.DAO)
if ok, err := runtime.CheckHashedWitness(ic, h); err != nil || !ok { if ok, err := runtime.CheckHashedWitness(ic, h); err != nil || !ok {
return ErrInvalidWitness return ErrInvalidWitness
} }

View File

@ -74,7 +74,7 @@ var (
type Eligere struct { type Eligere struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex
@ -430,10 +430,10 @@ func (e *Eligere) updateStatusIndex(d *dao.Simple, proposalID uint64, oldStatus,
// ============ Authorization Helpers ============ // ============ Authorization Helpers ============
func (e *Eligere) checkCommittee(ic *interop.Context) bool { func (e *Eligere) checkCommittee(ic *interop.Context) bool {
if e.NEO == nil { if e.Annos == nil {
return false return false
} }
return e.NEO.CheckCommittee(ic) return e.Annos.CheckCommittee(ic)
} }
func (e *Eligere) hasLegislatorRole(d *dao.Simple, addr util.Uint160, blockHeight uint32) bool { func (e *Eligere) hasLegislatorRole(d *dao.Simple, addr util.Uint160, blockHeight uint32) bool {

View File

@ -24,7 +24,7 @@ import (
// - Inter-chain debt (tracking fees owed to other chains) // - Inter-chain debt (tracking fees owed to other chains)
type Federation struct { type Federation struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
} }
// Storage key prefixes for Federation. // Storage key prefixes for Federation.
@ -403,7 +403,7 @@ func (f *Federation) setFeePercent(ic *interop.Context, args []stackitem.Item) s
} }
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -435,7 +435,7 @@ func (f *Federation) registerVisitor(ic *interop.Context, args []stackitem.Item)
} }
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -463,7 +463,7 @@ func (f *Federation) unregisterVisitor(ic *interop.Context, args []stackitem.Ite
owner := toUint160(args[0]) owner := toUint160(args[0])
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -517,7 +517,7 @@ func (f *Federation) settleDebt(ic *interop.Context, args []stackitem.Item) stac
} }
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -559,7 +559,7 @@ func (f *Federation) grantAsylum(ic *interop.Context, args []stackitem.Item) sta
} }
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -588,7 +588,7 @@ func (f *Federation) revokeAsylum(ic *interop.Context, args []stackitem.Item) st
owner := toUint160(args[0]) owner := toUint160(args[0])
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }
@ -636,7 +636,7 @@ func (f *Federation) naturalize(ic *interop.Context, args []stackitem.Item) stac
originalHomeChain := uint32(toBigInt(args[1]).Int64()) originalHomeChain := uint32(toBigInt(args[1]).Int64())
// Check committee // Check committee
if !f.NEO.CheckCommittee(ic) { if !f.Annos.CheckCommittee(ic) {
panic(ErrNotCommittee) panic(ErrNotCommittee)
} }

View File

@ -34,7 +34,7 @@ func TestNativeContract_Invoke(t *testing.T) {
) )
bc, validator, committee := chain.NewMulti(t) bc, validator, committee := chain.NewMulti(t)
e := neotest.NewExecutor(t, bc, validator, committee) e := neotest.NewExecutor(t, bc, validator, committee)
gasHash := e.NativeHash(t, nativenames.Gas) gasHash := e.NativeHash(t, nativenames.Lub)
baseExecFee := bc.GetBaseExecFee() baseExecFee := bc.GetBaseExecFee()
price := fee.Opcode(baseExecFee, opcode.SYSCALL, // System.Contract.Call price := fee.Opcode(baseExecFee, opcode.SYSCALL, // System.Contract.Call
@ -96,7 +96,7 @@ func TestNativeContract_InvokeInternal(t *testing.T) {
c.NativeUpdateHistories = map[string][]uint32{ c.NativeUpdateHistories = map[string][]uint32{
nativenames.Policy: {0}, nativenames.Policy: {0},
nativenames.Neo: {0}, nativenames.Neo: {0},
nativenames.Gas: {0}, nativenames.Lub: {0},
nativenames.Designation: {0}, nativenames.Designation: {0},
nativenames.StdLib: {0}, nativenames.StdLib: {0},
nativenames.Management: {0}, nativenames.Management: {0},
@ -200,7 +200,7 @@ func TestNativeContract_InvokeOtherContract(t *testing.T) {
bc, validator, committee := chain.NewMulti(t) bc, validator, committee := chain.NewMulti(t)
e := neotest.NewExecutor(t, bc, validator, committee) e := neotest.NewExecutor(t, bc, validator, committee)
managementInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Management)) managementInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Management))
gasInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Gas)) gasInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Lub))
cs, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, validator.ScriptHash()) cs, _ := contracts.GetTestContractState(t, pathToInternalContracts, 1, 2, validator.ScriptHash())
cs.Hash = state.CreateContractHash(validator.ScriptHash(), cs.NEF.Checksum, cs.Manifest.Name) // set proper hash cs.Hash = state.CreateContractHash(validator.ScriptHash(), cs.NEF.Checksum, cs.Manifest.Name) // set proper hash

View File

@ -27,7 +27,7 @@ import (
// - Cross-contract compliance checking // - Cross-contract compliance checking
type Lex struct { type Lex struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Federation IFederation Federation IFederation
@ -460,7 +460,7 @@ func (l *Lex) checkCommittee(ic *interop.Context) error {
if l.RoleRegistry != nil && l.RoleRegistry.CheckCommittee(ic) { if l.RoleRegistry != nil && l.RoleRegistry.CheckCommittee(ic) {
return nil return nil
} }
if l.NEO != nil && l.NEO.CheckCommittee(ic) { if l.Annos != nil && l.Annos.CheckCommittee(ic) {
return nil return nil
} }
return ErrNotAuthorized return ErrNotAuthorized

View File

@ -35,7 +35,7 @@ import (
// Management is a contract-managing native contract. // Management is a contract-managing native contract.
type Management struct { type Management struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Policy IPolicy Policy IPolicy
} }
@ -556,7 +556,7 @@ func (m *Management) setMinimumDeploymentFee(ic *interop.Context, args []stackit
if value.Sign() < 0 { if value.Sign() < 0 {
panic("MinimumDeploymentFee cannot be negative") panic("MinimumDeploymentFee cannot be negative")
} }
if !m.NEO.CheckCommittee(ic) { if !m.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
ic.DAO.PutStorageItem(m.ID, keyMinimumDeploymentFee, bigint.ToBytes(value)) ic.DAO.PutStorageItem(m.ID, keyMinimumDeploymentFee, bigint.ToBytes(value))

View File

@ -25,8 +25,8 @@ func TestManagement_GetNEP17Contracts(t *testing.T) {
e := neotest.NewExecutor(t, bc, validators, committee) e := neotest.NewExecutor(t, bc, validators, committee)
// Native NEP17 contracts: NEO, GAS, and VTS // Native NEP17 contracts: NEO, GAS, and VTS
require.ElementsMatch(t, []util.Uint160{e.NativeHash(t, nativenames.Neo), require.ElementsMatch(t, []util.Uint160{e.NativeHash(t, nativenames.Annos),
e.NativeHash(t, nativenames.Gas), e.NativeHash(t, nativenames.VTS)}, bc.GetNEP17Contracts()) e.NativeHash(t, nativenames.Lub), e.NativeHash(t, nativenames.VTS)}, bc.GetNEP17Contracts())
}) })
t.Run("basic chain", func(t *testing.T) { t.Run("basic chain", func(t *testing.T) {
@ -35,8 +35,8 @@ func TestManagement_GetNEP17Contracts(t *testing.T) {
basicchain.Init(t, "../../../", e) basicchain.Init(t, "../../../", e)
// Native NEP17 contracts: NEO, GAS, VTS + deployed contract // Native NEP17 contracts: NEO, GAS, VTS + deployed contract
require.ElementsMatch(t, []util.Uint160{e.NativeHash(t, nativenames.Neo), require.ElementsMatch(t, []util.Uint160{e.NativeHash(t, nativenames.Annos),
e.NativeHash(t, nativenames.Gas), e.NativeHash(t, nativenames.VTS), e.ContractHash(t, 1)}, bc.GetNEP17Contracts()) e.NativeHash(t, nativenames.Lub), e.NativeHash(t, nativenames.VTS), e.ContractHash(t, 1)}, bc.GetNEP17Contracts())
}) })
} }

View File

@ -18,34 +18,34 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
type neo struct{} type annos struct{}
func (n neo) Initialize(context *interop.Context, hardfork *config.Hardfork, md *interop.HFSpecificContractMD) error { func (n annos) Initialize(context *interop.Context, hardfork *config.Hardfork, md *interop.HFSpecificContractMD) error {
panic("TODO") panic("TODO")
} }
func (n neo) ActiveIn() *config.Hardfork { panic("TODO") } func (n annos) ActiveIn() *config.Hardfork { panic("TODO") }
func (n neo) InitializeCache(isHardforkEnabled interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error { func (n annos) InitializeCache(isHardforkEnabled interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error {
panic("TODO") panic("TODO")
} }
func (n neo) Metadata() *interop.ContractMD { panic("TODO") } func (n annos) Metadata() *interop.ContractMD { panic("TODO") }
func (n neo) OnPersist(context *interop.Context) error { panic("TODO") } func (n annos) OnPersist(context *interop.Context) error { panic("TODO") }
func (n neo) PostPersist(context *interop.Context) error { panic("TODO") } func (n annos) PostPersist(context *interop.Context) error { panic("TODO") }
func (n neo) GetCommitteeAddress(d *dao.Simple) util.Uint160 { panic("TODO") } func (n annos) GetCommitteeAddress(d *dao.Simple) util.Uint160 { panic("TODO") }
func (n neo) GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys { panic("TODO") } func (n annos) GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys { panic("TODO") }
func (n neo) BalanceOf(d *dao.Simple, acc util.Uint160) (*big.Int, uint32) { panic("TODO") } func (n annos) BalanceOf(d *dao.Simple, acc util.Uint160) (*big.Int, uint32) { panic("TODO") }
func (n neo) CalculateBonus(ic *interop.Context, acc util.Uint160, endHeight uint32) (*big.Int, error) { func (n annos) CalculateBonus(ic *interop.Context, acc util.Uint160, endHeight uint32) (*big.Int, error) {
panic("TODO") panic("TODO")
} }
func (n neo) GetCommitteeMembers(d *dao.Simple) keys.PublicKeys { panic("TODO") } func (n annos) GetCommitteeMembers(d *dao.Simple) keys.PublicKeys { panic("TODO") }
func (n neo) ComputeNextBlockValidators(d *dao.Simple) keys.PublicKeys { panic("TODO") } func (n annos) ComputeNextBlockValidators(d *dao.Simple) keys.PublicKeys { panic("TODO") }
func (n neo) GetCandidates(d *dao.Simple) ([]state.Validator, error) { panic("TODO") } func (n annos) GetCandidates(d *dao.Simple) ([]state.Validator, error) { panic("TODO") }
func (n neo) CheckCommittee(ic *interop.Context) bool { panic("TODO") } func (n annos) CheckCommittee(ic *interop.Context) bool { panic("TODO") }
func (n neo) RevokeVotes(ic *interop.Context, h util.Uint160) error { return nil } func (n annos) RevokeVotes(ic *interop.Context, h util.Uint160) error { return nil }
func TestDeployGetUpdateDestroyContract(t *testing.T) { func TestDeployGetUpdateDestroyContract(t *testing.T) {
mgmt := NewManagement() mgmt := NewManagement()
p := newPolicy() p := newPolicy()
p.NEO = neo{} p.Annos = annos{}
mgmt.Policy = p mgmt.Policy = p
d := dao.NewSimple(storage.NewMemoryStore(), false) d := dao.NewSimple(storage.NewMemoryStore(), false)

View File

@ -32,10 +32,10 @@ import (
"github.com/tutus-one/tutus-chain/pkg/vm/stackitem" "github.com/tutus-one/tutus-chain/pkg/vm/stackitem"
) )
// NEO represents NEO native contract. // Annos represents Annos native contract (governance token - years/lifespan).
type NEO struct { type Annos struct {
nep17TokenNative nep17TokenNative
GAS IGAS Lub ILub
Policy IPolicy Policy IPolicy
// Configuration and standby keys are set in constructor and then // Configuration and standby keys are set in constructor and then
@ -44,7 +44,7 @@ type NEO struct {
standbyKeys keys.PublicKeys standbyKeys keys.PublicKeys
} }
type NeoCache struct { type AnnosCache struct {
// gasPerBlock represents the history of generated gas per block. // gasPerBlock represents the history of generated gas per block.
gasPerBlock gasRecord gasPerBlock gasRecord
@ -80,31 +80,31 @@ type NeoCache struct {
} }
const ( const (
// NEOTotalSupply is the total amount of NEO in the system. // AnnosTotalSupply is the total amount of Annos in the system.
NEOTotalSupply = 100000000 AnnosTotalSupply = 100000000
// DefaultRegisterPrice is the default price for candidate register. // DefaultRegisterPrice is the default price for candidate register.
DefaultRegisterPrice = 1000 * GASFactor DefaultRegisterPrice = 1000 * LubFactor
// prefixCandidate is a prefix used to store validator's data. // prefixCandidate is a prefix used to store validator's data.
prefixCandidate = 33 prefixCandidate = 33
// prefixVotersCount is a prefix for storing total amount of NEO of voters. // prefixVotersCount is a prefix for storing total amount of Annos of voters.
prefixVotersCount = 1 prefixVotersCount = 1
// prefixVoterRewardPerCommittee is a prefix for storing committee GAS reward. // prefixVoterRewardPerCommittee is a prefix for storing committee Lub reward.
prefixVoterRewardPerCommittee = 23 prefixVoterRewardPerCommittee = 23
// voterRewardFactor is a factor by which voter reward per committee is multiplied // voterRewardFactor is a factor by which voter reward per committee is multiplied
// to make calculations more precise. // to make calculations more precise.
voterRewardFactor = 100_000_000 voterRewardFactor = 100_000_000
// prefixGASPerBlock is a prefix for storing amount of GAS generated per block. // prefixLubPerBlock is a prefix for storing amount of Lub generated per block.
prefixGASPerBlock = 29 prefixLubPerBlock = 29
// prefixRegisterPrice is a prefix for storing candidate register price. // prefixRegisterPrice is a prefix for storing candidate register price.
prefixRegisterPrice = 13 prefixRegisterPrice = 13
// effectiveVoterTurnout represents minimal ratio of total supply to total amount voted value // effectiveVoterTurnout represents minimal ratio of total supply to total amount voted value
// which is require to use non-standby validators. // which is require to use non-standby validators.
effectiveVoterTurnout = 5 effectiveVoterTurnout = 5
// neoHolderRewardRatio is a percent of generated GAS that is distributed to NEO holders. // annosHolderRewardRatio is a percent of generated Lub that is distributed to Annos holders.
neoHolderRewardRatio = 10 annosHolderRewardRatio = 10
// committeeRewardRatio is a percent of generated GAS that is distributed to committee. // committeeRewardRatio is a percent of generated Lub that is distributed to committee.
committeeRewardRatio = 10 committeeRewardRatio = 10
// voterRewardRatio is a percent of generated GAS that is distributed to voters. // voterRewardRatio is a percent of generated Lub that is distributed to voters.
voterRewardRatio = 80 voterRewardRatio = 80
// maxGetCandidatesRespLen is the maximum number of candidates to return from the // maxGetCandidatesRespLen is the maximum number of candidates to return from the
@ -124,18 +124,18 @@ var (
) )
var ( var (
_ interop.Contract = (*NEO)(nil) _ interop.Contract = (*Annos)(nil)
_ dao.NativeContractCache = (*NeoCache)(nil) _ dao.NativeContractCache = (*AnnosCache)(nil)
) )
// Copy implements NativeContractCache interface. // Copy implements NativeContractCache interface.
func (c *NeoCache) Copy() dao.NativeContractCache { func (c *AnnosCache) Copy() dao.NativeContractCache {
cp := &NeoCache{} cp := &AnnosCache{}
copyNeoCache(c, cp) copyAnnosCache(c, cp)
return cp return cp
} }
func copyNeoCache(src, dst *NeoCache) { func copyAnnosCache(src, dst *AnnosCache) {
dst.votesChanged = src.votesChanged dst.votesChanged = src.votesChanged
// Can safely omit copying because the new array is created each time // Can safely omit copying because the new array is created each time
// newEpochNextValidators list, nextValidators and committee are updated. // newEpochNextValidators list, nextValidators and committee are updated.
@ -165,17 +165,17 @@ func makeValidatorKey(key *keys.PublicKey) []byte {
return b return b
} }
// newNEO returns NEO native contract. // newAnnos returns Annos native contract.
func newNEO(cfg config.ProtocolConfiguration) *NEO { func newAnnos(cfg config.ProtocolConfiguration) *Annos {
n := &NEO{} n := &Annos{}
defer n.BuildHFSpecificMD(n.ActiveIn()) defer n.BuildHFSpecificMD(n.ActiveIn())
nep17 := newNEP17Native(nativenames.Neo, nativeids.NeoToken, func(m *manifest.Manifest, hf config.Hardfork) { nep17 := newNEP17Native(nativenames.Annos, nativeids.Annos, func(m *manifest.Manifest, hf config.Hardfork) {
if hf.Cmp(config.HFEchidna) >= 0 { if hf.Cmp(config.HFEchidna) >= 0 {
m.SupportedStandards = append(m.SupportedStandards, manifest.NEP27StandardName) m.SupportedStandards = append(m.SupportedStandards, manifest.NEP27StandardName)
} }
}) })
nep17.symbol = "NEO" nep17.symbol = "ANNOS"
nep17.decimals = 0 nep17.decimals = 0
nep17.factor = 1 nep17.factor = 1
nep17.incBalance = n.increaseBalance nep17.incBalance = n.increaseBalance
@ -185,7 +185,7 @@ func newNEO(cfg config.ProtocolConfiguration) *NEO {
err := n.initConfigCache(cfg) err := n.initConfigCache(cfg)
if err != nil { if err != nil {
panic(fmt.Errorf("failed to initialize NEO config cache: %w", err)) panic(fmt.Errorf("failed to initialize Annos config cache: %w", err))
} }
desc := NewDescriptor("unclaimedGas", smartcontract.IntegerType, desc := NewDescriptor("unclaimedGas", smartcontract.IntegerType,
@ -301,8 +301,8 @@ func newNEO(cfg config.ProtocolConfiguration) *NEO {
return n return n
} }
// Initialize initializes a NEO contract. // Initialize initializes an Annos contract.
func (n *NEO) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *interop.HFSpecificContractMD) error { func (n *Annos) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *interop.HFSpecificContractMD) error {
if hf != n.ActiveIn() { if hf != n.ActiveIn() {
return nil return nil
} }
@ -316,7 +316,7 @@ func (n *NEO) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *intero
return errors.New("already initialized") return errors.New("already initialized")
} }
cache := &NeoCache{ cache := &AnnosCache{
gasPerVoteCache: make(map[string]big.Int), gasPerVoteCache: make(map[string]big.Int),
votesChanged: true, votesChanged: true,
} }
@ -337,10 +337,10 @@ func (n *NEO) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *intero
if err != nil { if err != nil {
return err return err
} }
n.Mint(ic, h, big.NewInt(NEOTotalSupply), false) n.Mint(ic, h, big.NewInt(AnnosTotalSupply), false)
var index uint32 var index uint32
value := big.NewInt(5 * GASFactor) value := big.NewInt(5 * LubFactor)
n.putGASRecord(ic.DAO, index, value) n.putGASRecord(ic.DAO, index, value)
gr := &gasRecord{{Index: index, GASPerBlock: *value}} gr := &gasRecord{{Index: index, GASPerBlock: *value}}
@ -358,12 +358,12 @@ func (n *NEO) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *intero
return nil return nil
} }
// InitializeCache initializes all NEO cache with the proper values from the storage. // InitializeCache initializes all Annos cache with the proper values from the storage.
// Cache initialization should be done apart from Initialize because Initialize is // Cache initialization should be done apart from Initialize because Initialize is
// called only when deploying native contracts. InitializeCache implements the Contract // called only when deploying native contracts. InitializeCache implements the Contract
// interface. // interface.
func (n *NEO) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error { func (n *Annos) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error {
cache := &NeoCache{ cache := &AnnosCache{
gasPerVoteCache: make(map[string]big.Int), gasPerVoteCache: make(map[string]big.Int),
votesChanged: true, votesChanged: true,
} }
@ -401,11 +401,11 @@ func (n *NEO) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d
} }
// ActiveIn implements the Contract interface. // ActiveIn implements the Contract interface.
func (n *NEO) ActiveIn() *config.Hardfork { func (n *Annos) ActiveIn() *config.Hardfork {
return nil return nil
} }
func (n *NEO) initConfigCache(cfg config.ProtocolConfiguration) error { func (n *Annos) initConfigCache(cfg config.ProtocolConfiguration) error {
var err error var err error
n.cfg = cfg n.cfg = cfg
@ -413,7 +413,7 @@ func (n *NEO) initConfigCache(cfg config.ProtocolConfiguration) error {
return err return err
} }
func (n *NEO) updateCache(cache *NeoCache, cvs keysWithVotes, blockHeight uint32) error { func (n *Annos) updateCache(cache *AnnosCache, cvs keysWithVotes, blockHeight uint32) error {
cache.committee = cvs cache.committee = cvs
var committee = getCommitteeMembers(cache.committee) var committee = getCommitteeMembers(cache.committee)
@ -435,7 +435,7 @@ func (n *NEO) updateCache(cache *NeoCache, cvs keysWithVotes, blockHeight uint32
// will be used by corresponding values initialisation on the next epoch start. // will be used by corresponding values initialisation on the next epoch start.
// The updated new epoch cached values computed using the persisted blocks state // The updated new epoch cached values computed using the persisted blocks state
// of the latest epoch. // of the latest epoch.
func (n *NEO) updateCachedNewEpochValues(d *dao.Simple, cache *NeoCache, blockHeight uint32, numOfCNs int) error { func (n *Annos) updateCachedNewEpochValues(d *dao.Simple, cache *AnnosCache, blockHeight uint32, numOfCNs int) error {
committee, cvs, err := n.computeCommitteeMembers(blockHeight, d) committee, cvs, err := n.computeCommitteeMembers(blockHeight, d)
if err != nil { if err != nil {
return fmt.Errorf("failed to compute committee members: %w", err) return fmt.Errorf("failed to compute committee members: %w", err)
@ -455,9 +455,9 @@ func (n *NEO) updateCachedNewEpochValues(d *dao.Simple, cache *NeoCache, blockHe
} }
// OnPersist implements the Contract interface. // OnPersist implements the Contract interface.
func (n *NEO) OnPersist(ic *interop.Context) error { func (n *Annos) OnPersist(ic *interop.Context) error {
if n.cfg.ShouldUpdateCommitteeAt(ic.Block.Index) { if n.cfg.ShouldUpdateCommitteeAt(ic.Block.Index) {
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) cache := ic.DAO.GetRWCache(n.ID).(*AnnosCache)
// Cached newEpoch* values always have proper value set (either by PostPersist // Cached newEpoch* values always have proper value set (either by PostPersist
// during the last epoch block handling or by initialization code). // during the last epoch block handling or by initialization code).
@ -493,14 +493,14 @@ func (n *NEO) OnPersist(ic *interop.Context) error {
} }
// PostPersist implements the Contract interface. // PostPersist implements the Contract interface.
func (n *NEO) PostPersist(ic *interop.Context) error { func (n *Annos) PostPersist(ic *interop.Context) error {
gas := n.GetGASPerBlock(ic.DAO, ic.BlockHeight()+1) gas := n.GetGASPerBlock(ic.DAO, ic.BlockHeight()+1)
cache := ic.DAO.GetROCache(n.ID).(*NeoCache) cache := ic.DAO.GetROCache(n.ID).(*AnnosCache)
pubs := getCommitteeMembers(cache.committee) pubs := getCommitteeMembers(cache.committee)
committeeSize := n.cfg.GetCommitteeSize(ic.Block.Index) committeeSize := n.cfg.GetCommitteeSize(ic.Block.Index)
index := int(ic.Block.Index) % committeeSize index := int(ic.Block.Index) % committeeSize
committeeReward := new(big.Int).Mul(gas, bigCommitteeRewardRatio) committeeReward := new(big.Int).Mul(gas, bigCommitteeRewardRatio)
n.GAS.Mint(ic, pubs[index].GetScriptHash(), committeeReward.Div(committeeReward, big100), false) n.Lub.Mint(ic, pubs[index].GetScriptHash(), committeeReward.Div(committeeReward, big100), false)
var isCacheRW bool var isCacheRW bool
if n.cfg.ShouldUpdateCommitteeAt(ic.Block.Index) { if n.cfg.ShouldUpdateCommitteeAt(ic.Block.Index) {
@ -531,7 +531,7 @@ func (n *NEO) PostPersist(ic *interop.Context) error {
tmp.Add(tmp, &r) tmp.Add(tmp, &r)
if !isCacheRW { if !isCacheRW {
cache = ic.DAO.GetRWCache(n.ID).(*NeoCache) cache = ic.DAO.GetRWCache(n.ID).(*AnnosCache)
isCacheRW = true isCacheRW = true
} }
cache.gasPerVoteCache[cs[i].Key] = *tmp cache.gasPerVoteCache[cs[i].Key] = *tmp
@ -552,7 +552,7 @@ func (n *NEO) PostPersist(ic *interop.Context) error {
numOfCNs != len(cache.newEpochNextValidators) || numOfCNs != len(cache.newEpochNextValidators) ||
n.cfg.GetCommitteeSize(h+1) != len(cache.newEpochCommittee) { n.cfg.GetCommitteeSize(h+1) != len(cache.newEpochCommittee) {
if !isCacheRW { if !isCacheRW {
cache = ic.DAO.GetRWCache(n.ID).(*NeoCache) cache = ic.DAO.GetRWCache(n.ID).(*AnnosCache)
} }
err := n.updateCachedNewEpochValues(ic.DAO, cache, h, numOfCNs) err := n.updateCachedNewEpochValues(ic.DAO, cache, h, numOfCNs)
if err != nil { if err != nil {
@ -564,9 +564,9 @@ func (n *NEO) PostPersist(ic *interop.Context) error {
return nil return nil
} }
func (n *NEO) getLatestGASPerVote(d *dao.Simple, key []byte) big.Int { func (n *Annos) getLatestGASPerVote(d *dao.Simple, key []byte) big.Int {
var g big.Int var g big.Int
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
if g, ok := cache.gasPerVoteCache[string(key[1:])]; ok { if g, ok := cache.gasPerVoteCache[string(key[1:])]; ok {
return g return g
} }
@ -579,7 +579,7 @@ func (n *NEO) getLatestGASPerVote(d *dao.Simple, key []byte) big.Int {
return g return g
} }
func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.StorageItem, amount *big.Int, checkBal *big.Int) (func(), error) { func (n *Annos) increaseBalance(ic *interop.Context, h util.Uint160, si *state.StorageItem, amount *big.Int, checkBal *big.Int) (func(), error) {
var postF func() var postF func()
acc, err := state.NEOBalanceFromBytes(*si) acc, err := state.NEOBalanceFromBytes(*si)
@ -595,7 +595,7 @@ func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.Sto
return nil, err return nil, err
} }
if newGas != nil { // Can be if it was already distributed in the same block. if newGas != nil { // Can be if it was already distributed in the same block.
postF = func() { n.GAS.Mint(ic, h, newGas, true) } postF = func() { n.Lub.Mint(ic, h, newGas, true) }
} }
if amount.Sign() == 0 { if amount.Sign() == 0 {
*si = acc.Bytes(ic.DAO.GetItemCtx()) *si = acc.Bytes(ic.DAO.GetItemCtx())
@ -618,7 +618,7 @@ func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.Sto
return postF, nil return postF, nil
} }
func (n *NEO) balanceFromBytes(si *state.StorageItem) (*big.Int, error) { func (n *Annos) balanceFromBytes(si *state.StorageItem) (*big.Int, error) {
acc, err := state.NEOBalanceFromBytes(*si) acc, err := state.NEOBalanceFromBytes(*si)
if err != nil { if err != nil {
return nil, err return nil, err
@ -626,7 +626,7 @@ func (n *NEO) balanceFromBytes(si *state.StorageItem) (*big.Int, error) {
return &acc.Balance, err return &acc.Balance, err
} }
func (n *NEO) distributeGas(ic *interop.Context, acc *state.NEOBalance) (*big.Int, error) { func (n *Annos) distributeGas(ic *interop.Context, acc *state.NEOBalance) (*big.Int, error) {
if ic.Block == nil || ic.Block.Index == 0 || ic.Block.Index == acc.BalanceHeight { if ic.Block == nil || ic.Block.Index == 0 || ic.Block.Index == acc.BalanceHeight {
return nil, nil return nil, nil
} }
@ -643,7 +643,7 @@ func (n *NEO) distributeGas(ic *interop.Context, acc *state.NEOBalance) (*big.In
return gen, nil return gen, nil
} }
func (n *NEO) unclaimedGas(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) unclaimedGas(ic *interop.Context, args []stackitem.Item) stackitem.Item {
u := toUint160(args[0]) u := toUint160(args[0])
end := uint32(toBigInt(args[1]).Int64()) end := uint32(toBigInt(args[1]).Int64())
gen, err := n.CalculateBonus(ic, u, end) gen, err := n.CalculateBonus(ic, u, end)
@ -653,14 +653,14 @@ func (n *NEO) unclaimedGas(ic *interop.Context, args []stackitem.Item) stackitem
return stackitem.NewBigInteger(gen) return stackitem.NewBigInteger(gen)
} }
func (n *NEO) getGASPerBlock(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getGASPerBlock(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
gas := n.GetGASPerBlock(ic.DAO, ic.BlockHeight()+1) gas := n.GetGASPerBlock(ic.DAO, ic.BlockHeight()+1)
return stackitem.NewBigInteger(gas) return stackitem.NewBigInteger(gas)
} }
func (n *NEO) getSortedGASRecordFromDAO(d *dao.Simple) gasRecord { func (n *Annos) getSortedGASRecordFromDAO(d *dao.Simple) gasRecord {
var gr = make(gasRecord, 0) var gr = make(gasRecord, 0)
d.Seek(n.ID, storage.SeekRange{Prefix: []byte{prefixGASPerBlock}}, func(k, v []byte) bool { d.Seek(n.ID, storage.SeekRange{Prefix: []byte{prefixLubPerBlock}}, func(k, v []byte) bool {
gr = append(gr, gasIndexPair{ gr = append(gr, gasIndexPair{
Index: binary.BigEndian.Uint32(k), Index: binary.BigEndian.Uint32(k),
GASPerBlock: *bigint.FromBytes(v), GASPerBlock: *bigint.FromBytes(v),
@ -671,8 +671,8 @@ func (n *NEO) getSortedGASRecordFromDAO(d *dao.Simple) gasRecord {
} }
// GetGASPerBlock returns gas generated for block with provided index. // GetGASPerBlock returns gas generated for block with provided index.
func (n *NEO) GetGASPerBlock(d *dao.Simple, index uint32) *big.Int { func (n *Annos) GetGASPerBlock(d *dao.Simple, index uint32) *big.Int {
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
gr := cache.gasPerBlock gr := cache.gasPerBlock
for i := len(gr) - 1; i >= 0; i-- { for i := len(gr) - 1; i >= 0; i-- {
if gr[i].Index <= index { if gr[i].Index <= index {
@ -680,16 +680,16 @@ func (n *NEO) GetGASPerBlock(d *dao.Simple, index uint32) *big.Int {
return &g return &g
} }
} }
panic("NEO cache not initialized") panic("Annos cache not initialized")
} }
// GetCommitteeAddress returns address of the committee. // GetCommitteeAddress returns address of the committee.
func (n *NEO) GetCommitteeAddress(d *dao.Simple) util.Uint160 { func (n *Annos) GetCommitteeAddress(d *dao.Simple) util.Uint160 {
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
return cache.committeeHash return cache.committeeHash
} }
func (n *NEO) CheckCommittee(ic *interop.Context) bool { func (n *Annos) CheckCommittee(ic *interop.Context) bool {
ok, err := runtime.CheckHashedWitness(ic, n.GetCommitteeAddress(ic.DAO)) ok, err := runtime.CheckHashedWitness(ic, n.GetCommitteeAddress(ic.DAO))
if err != nil { if err != nil {
panic(err) panic(err)
@ -697,7 +697,7 @@ func (n *NEO) CheckCommittee(ic *interop.Context) bool {
return ok return ok
} }
func (n *NEO) setGASPerBlock(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) setGASPerBlock(ic *interop.Context, args []stackitem.Item) stackitem.Item {
gas := toBigInt(args[0]) gas := toBigInt(args[0])
err := n.SetGASPerBlock(ic, ic.Block.Index+1, gas) err := n.SetGASPerBlock(ic, ic.Block.Index+1, gas)
if err != nil { if err != nil {
@ -707,15 +707,15 @@ func (n *NEO) setGASPerBlock(ic *interop.Context, args []stackitem.Item) stackit
} }
// SetGASPerBlock sets gas generated for blocks after index. // SetGASPerBlock sets gas generated for blocks after index.
func (n *NEO) SetGASPerBlock(ic *interop.Context, index uint32, gas *big.Int) error { func (n *Annos) SetGASPerBlock(ic *interop.Context, index uint32, gas *big.Int) error {
if gas.Sign() == -1 || gas.Cmp(big.NewInt(10*GASFactor)) == 1 { if gas.Sign() == -1 || gas.Cmp(big.NewInt(10*LubFactor)) == 1 {
return errors.New("invalid value for GASPerBlock") return errors.New("invalid value for GASPerBlock")
} }
if !n.CheckCommittee(ic) { if !n.CheckCommittee(ic) {
return errors.New("invalid committee signature") return errors.New("invalid committee signature")
} }
n.putGASRecord(ic.DAO, index, gas) n.putGASRecord(ic.DAO, index, gas)
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) cache := ic.DAO.GetRWCache(n.ID).(*AnnosCache)
cache.gasPerBlock = append(cache.gasPerBlock, gasIndexPair{ cache.gasPerBlock = append(cache.gasPerBlock, gasIndexPair{
Index: index, Index: index,
GASPerBlock: *gas, GASPerBlock: *gas,
@ -723,16 +723,16 @@ func (n *NEO) SetGASPerBlock(ic *interop.Context, index uint32, gas *big.Int) er
return nil return nil
} }
func (n *NEO) getRegisterPrice(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getRegisterPrice(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
return stackitem.NewBigInteger(big.NewInt(n.getRegisterPriceInternal(ic.DAO))) return stackitem.NewBigInteger(big.NewInt(n.getRegisterPriceInternal(ic.DAO)))
} }
func (n *NEO) getRegisterPriceInternal(d *dao.Simple) int64 { func (n *Annos) getRegisterPriceInternal(d *dao.Simple) int64 {
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
return cache.registerPrice return cache.registerPrice
} }
func (n *NEO) setRegisterPrice(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) setRegisterPrice(ic *interop.Context, args []stackitem.Item) stackitem.Item {
price := toBigInt(args[0]) price := toBigInt(args[0])
if price.Sign() <= 0 || !price.IsInt64() { if price.Sign() <= 0 || !price.IsInt64() {
panic("invalid register price") panic("invalid register price")
@ -742,12 +742,12 @@ func (n *NEO) setRegisterPrice(ic *interop.Context, args []stackitem.Item) stack
} }
setIntWithKey(n.ID, ic.DAO, []byte{prefixRegisterPrice}, price.Int64()) setIntWithKey(n.ID, ic.DAO, []byte{prefixRegisterPrice}, price.Int64())
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) cache := ic.DAO.GetRWCache(n.ID).(*AnnosCache)
cache.registerPrice = price.Int64() cache.registerPrice = price.Int64()
return stackitem.Null{} return stackitem.Null{}
} }
func (n *NEO) dropCandidateIfZero(d *dao.Simple, cache *NeoCache, pub *keys.PublicKey, c *candidate) bool { func (n *Annos) dropCandidateIfZero(d *dao.Simple, cache *AnnosCache, pub *keys.PublicKey, c *candidate) bool {
if c.Registered || c.Votes.Sign() != 0 { if c.Registered || c.Votes.Sign() != 0 {
return false return false
} }
@ -772,9 +772,9 @@ func makeVoterKey(pub []byte, prealloc ...[]byte) []byte {
return key return key
} }
// CalculateBonus calculates amount of gas generated for holding value NEO from start to end block // CalculateBonus calculates amount of Lub generated for holding value Annos from start to end block
// and having voted for active committee member. // and having voted for active committee member.
func (n *NEO) CalculateBonus(ic *interop.Context, acc util.Uint160, end uint32) (*big.Int, error) { func (n *Annos) CalculateBonus(ic *interop.Context, acc util.Uint160, end uint32) (*big.Int, error) {
key := makeAccountKey(acc) key := makeAccountKey(acc)
si := ic.DAO.GetStorageItem(n.ID, key) si := ic.DAO.GetStorageItem(n.ID, key)
if si == nil { if si == nil {
@ -793,8 +793,8 @@ func (n *NEO) CalculateBonus(ic *interop.Context, acc util.Uint160, end uint32)
return n.calculateBonus(ic.DAO, st, end) return n.calculateBonus(ic.DAO, st, end)
} }
func (n *NEO) calculateBonus(d *dao.Simple, acc *state.NEOBalance, end uint32) (*big.Int, error) { func (n *Annos) calculateBonus(d *dao.Simple, acc *state.NEOBalance, end uint32) (*big.Int, error) {
r, err := n.CalculateNEOHolderReward(d, &acc.Balance, acc.BalanceHeight, end) r, err := n.CalculateAnnosHolderReward(d, &acc.Balance, acc.BalanceHeight, end)
if err != nil || acc.VoteTo == nil { if err != nil || acc.VoteTo == nil {
return r, err return r, err
} }
@ -808,14 +808,14 @@ func (n *NEO) calculateBonus(d *dao.Simple, acc *state.NEOBalance, end uint32) (
return tmp, nil return tmp, nil
} }
// CalculateNEOHolderReward return GAS reward for holding `value` of NEO from start to end block. // CalculateAnnosHolderReward return Lub reward for holding `value` of Annos from start to end block.
func (n *NEO) CalculateNEOHolderReward(d *dao.Simple, value *big.Int, start, end uint32) (*big.Int, error) { func (n *Annos) CalculateAnnosHolderReward(d *dao.Simple, value *big.Int, start, end uint32) (*big.Int, error) {
if value.Sign() == 0 || start >= end { if value.Sign() == 0 || start >= end {
return big.NewInt(0), nil return big.NewInt(0), nil
} else if value.Sign() < 0 { } else if value.Sign() < 0 {
return nil, errors.New("negative value") return nil, errors.New("negative value")
} }
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
gr := cache.gasPerBlock gr := cache.gasPerBlock
var sum, tmp big.Int var sum, tmp big.Int
for i := len(gr) - 1; i >= 0; i-- { for i := len(gr) - 1; i >= 0; i-- {
@ -833,12 +833,12 @@ func (n *NEO) CalculateNEOHolderReward(d *dao.Simple, value *big.Int, start, end
end = gr[i].Index end = gr[i].Index
} }
res := new(big.Int).Mul(value, &sum) res := new(big.Int).Mul(value, &sum)
res.Mul(res, tmp.SetInt64(neoHolderRewardRatio)) res.Mul(res, tmp.SetInt64(annosHolderRewardRatio))
res.Div(res, tmp.SetInt64(100*NEOTotalSupply)) res.Div(res, tmp.SetInt64(100*AnnosTotalSupply))
return res, nil return res, nil
} }
func (n *NEO) registerCandidate(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) registerCandidate(ic *interop.Context, args []stackitem.Item) stackitem.Item {
pub := toPublicKey(args[0]) pub := toPublicKey(args[0])
if !ic.VM.AddDatoshi(n.getRegisterPriceInternal(ic.DAO)) { if !ic.VM.AddDatoshi(n.getRegisterPriceInternal(ic.DAO)) {
panic("insufficient gas") panic("insufficient gas")
@ -847,7 +847,7 @@ func (n *NEO) registerCandidate(ic *interop.Context, args []stackitem.Item) stac
return stackitem.NewBool(err == nil) return stackitem.NewBool(err == nil)
} }
func (n *NEO) checkRegisterCandidate(ic *interop.Context, pub *keys.PublicKey) error { func (n *Annos) checkRegisterCandidate(ic *interop.Context, pub *keys.PublicKey) error {
ok, err := runtime.CheckKeyedWitness(ic, pub) ok, err := runtime.CheckKeyedWitness(ic, pub)
if err != nil { if err != nil {
panic(err) panic(err)
@ -857,7 +857,7 @@ func (n *NEO) checkRegisterCandidate(ic *interop.Context, pub *keys.PublicKey) e
return n.RegisterCandidateInternal(ic, pub) return n.RegisterCandidateInternal(ic, pub)
} }
func (n *NEO) onNEP17Payment(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) onNEP17Payment(ic *interop.Context, args []stackitem.Item) stackitem.Item {
var ( var (
caller = ic.VM.GetCallingScriptHash() caller = ic.VM.GetCallingScriptHash()
_ = toUint160(args[0]) _ = toUint160(args[0])
@ -866,7 +866,7 @@ func (n *NEO) onNEP17Payment(ic *interop.Context, args []stackitem.Item) stackit
regPrice = n.getRegisterPriceInternal(ic.DAO) regPrice = n.getRegisterPriceInternal(ic.DAO)
) )
if caller != n.GAS.Metadata().Hash { if caller != n.Lub.Metadata().Hash {
panic("only GAS is accepted") panic("only GAS is accepted")
} }
if !amount.IsInt64() || amount.Int64() != regPrice { if !amount.IsInt64() || amount.Int64() != regPrice {
@ -876,13 +876,13 @@ func (n *NEO) onNEP17Payment(ic *interop.Context, args []stackitem.Item) stackit
if err != nil { if err != nil {
panic(err) panic(err)
} }
n.GAS.Burn(ic, n.Hash, amount) n.Lub.Burn(ic, n.Hash, amount)
return stackitem.Null{} return stackitem.Null{}
} }
// RegisterCandidateInternal registers pub as a new candidate. This method must not be // RegisterCandidateInternal registers pub as a new candidate. This method must not be
// called outside of VM since it panics on critical errors. // called outside of VM since it panics on critical errors.
func (n *NEO) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey) error { func (n *Annos) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey) error {
var emitEvent = true var emitEvent = true
key := makeValidatorKey(pub) key := makeValidatorKey(pub)
@ -900,7 +900,7 @@ func (n *NEO) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey
return err return err
} }
if emitEvent { if emitEvent {
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) cache := ic.DAO.GetRWCache(n.ID).(*AnnosCache)
cache.votesChanged = true cache.votesChanged = true
err = ic.AddNotification(n.Hash, "CandidateStateChanged", stackitem.NewArray([]stackitem.Item{ err = ic.AddNotification(n.Hash, "CandidateStateChanged", stackitem.NewArray([]stackitem.Item{
stackitem.NewByteArray(pub.Bytes()), stackitem.NewByteArray(pub.Bytes()),
@ -915,7 +915,7 @@ func (n *NEO) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey
return nil return nil
} }
func (n *NEO) unregisterCandidate(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) unregisterCandidate(ic *interop.Context, args []stackitem.Item) stackitem.Item {
pub := toPublicKey(args[0]) pub := toPublicKey(args[0])
ok, err := runtime.CheckKeyedWitness(ic, pub) ok, err := runtime.CheckKeyedWitness(ic, pub)
if err != nil { if err != nil {
@ -929,7 +929,7 @@ func (n *NEO) unregisterCandidate(ic *interop.Context, args []stackitem.Item) st
// UnregisterCandidateInternal unregisters pub as a candidate. This method must not be // UnregisterCandidateInternal unregisters pub as a candidate. This method must not be
// called outside of VM since it panics on critical errors. // called outside of VM since it panics on critical errors.
func (n *NEO) UnregisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey) error { func (n *Annos) UnregisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey) error {
var err error var err error
key := makeValidatorKey(pub) key := makeValidatorKey(pub)
@ -937,7 +937,7 @@ func (n *NEO) UnregisterCandidateInternal(ic *interop.Context, pub *keys.PublicK
if si == nil { if si == nil {
return nil return nil
} }
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) cache := ic.DAO.GetRWCache(n.ID).(*AnnosCache)
// Not only current committee/validators cache is interested in votesChanged, but also // Not only current committee/validators cache is interested in votesChanged, but also
// newEpoch cache, thus, modify votesChanged to update the latter. // newEpoch cache, thus, modify votesChanged to update the latter.
cache.votesChanged = true cache.votesChanged = true
@ -965,7 +965,7 @@ func (n *NEO) UnregisterCandidateInternal(ic *interop.Context, pub *keys.PublicK
return nil return nil
} }
func (n *NEO) vote(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) vote(ic *interop.Context, args []stackitem.Item) stackitem.Item {
acc := toUint160(args[0]) acc := toUint160(args[0])
var pub *keys.PublicKey var pub *keys.PublicKey
if _, ok := args[1].(stackitem.Null); !ok { if _, ok := args[1].(stackitem.Null); !ok {
@ -977,7 +977,7 @@ func (n *NEO) vote(ic *interop.Context, args []stackitem.Item) stackitem.Item {
// VoteInternal votes from account h for validarors specified in pubs. This method // VoteInternal votes from account h for validarors specified in pubs. This method
// must not be called outside of VM since it panics on critical errors. // must not be called outside of VM since it panics on critical errors.
func (n *NEO) VoteInternal(ic *interop.Context, h util.Uint160, pub *keys.PublicKey) error { func (n *Annos) VoteInternal(ic *interop.Context, h util.Uint160, pub *keys.PublicKey) error {
ok, err := runtime.CheckHashedWitness(ic, h) ok, err := runtime.CheckHashedWitness(ic, h)
if err != nil { if err != nil {
return err return err
@ -987,15 +987,15 @@ func (n *NEO) VoteInternal(ic *interop.Context, h util.Uint160, pub *keys.Public
return n.voteInternalUnchecked(ic, h, pub) return n.voteInternalUnchecked(ic, h, pub)
} }
// RevokeVotes implements INEO interface. It revokes votes of account h and // RevokeVotes implements IAnnos interface. It revokes votes of account h and
// doesn't check the h's witness. // doesn't check the h's witness.
func (n *NEO) RevokeVotes(ic *interop.Context, h util.Uint160) error { func (n *Annos) RevokeVotes(ic *interop.Context, h util.Uint160) error {
return n.voteInternalUnchecked(ic, h, nil) return n.voteInternalUnchecked(ic, h, nil)
} }
// VoteInternalUnchecked it's an internal representation of VoteInternal that // VoteInternalUnchecked it's an internal representation of VoteInternal that
// votes of the specified account without checking the voter's signature. // votes of the specified account without checking the voter's signature.
func (n *NEO) voteInternalUnchecked(ic *interop.Context, h util.Uint160, pub *keys.PublicKey) error { func (n *Annos) voteInternalUnchecked(ic *interop.Context, h util.Uint160, pub *keys.PublicKey) error {
key := makeAccountKey(h) key := makeAccountKey(h)
si := ic.DAO.GetStorageItem(n.ID, key) si := ic.DAO.GetStorageItem(n.ID, key)
if si == nil { if si == nil {
@ -1062,7 +1062,7 @@ func (n *NEO) voteInternalUnchecked(ic *interop.Context, h util.Uint160, pub *ke
} }
if newGas != nil { // Can be if it was already distributed in the same block. if newGas != nil { // Can be if it was already distributed in the same block.
n.GAS.Mint(ic, h, newGas, true) n.Lub.Mint(ic, h, newGas, true)
} }
return nil return nil
} }
@ -1076,8 +1076,8 @@ func keyToStackItem(k *keys.PublicKey) stackitem.Item {
// ModifyAccountVotes modifies votes of the specified account by value (can be negative). // ModifyAccountVotes modifies votes of the specified account by value (can be negative).
// typ specifies if this modify is occurring during transfer or vote (with old or new validator). // typ specifies if this modify is occurring during transfer or vote (with old or new validator).
func (n *NEO) ModifyAccountVotes(acc *state.NEOBalance, d *dao.Simple, value *big.Int, isNewVote bool) error { func (n *Annos) ModifyAccountVotes(acc *state.NEOBalance, d *dao.Simple, value *big.Int, isNewVote bool) error {
cache := d.GetRWCache(n.ID).(*NeoCache) cache := d.GetRWCache(n.ID).(*AnnosCache)
cache.votesChanged = true cache.votesChanged = true
if acc.VoteTo != nil { if acc.VoteTo != nil {
key := makeValidatorKey(acc.VoteTo) key := makeValidatorKey(acc.VoteTo)
@ -1098,7 +1098,7 @@ func (n *NEO) ModifyAccountVotes(acc *state.NEOBalance, d *dao.Simple, value *bi
return nil return nil
} }
func (n *NEO) getCandidates(d *dao.Simple, sortByKey bool, maxNum int) ([]keyWithVotes, error) { func (n *Annos) getCandidates(d *dao.Simple, sortByKey bool, maxNum int) ([]keyWithVotes, error) {
arr := make([]keyWithVotes, 0) arr := make([]keyWithVotes, 0)
buf := io.NewBufBinWriter() buf := io.NewBufBinWriter()
d.Seek(n.ID, storage.SeekRange{Prefix: []byte{prefixCandidate}}, func(k, v []byte) bool { d.Seek(n.ID, storage.SeekRange{Prefix: []byte{prefixCandidate}}, func(k, v []byte) bool {
@ -1139,7 +1139,7 @@ func (n *NEO) getCandidates(d *dao.Simple, sortByKey bool, maxNum int) ([]keyWit
// GetCandidates returns current registered validators list with keys // GetCandidates returns current registered validators list with keys
// and votes. // and votes.
func (n *NEO) GetCandidates(d *dao.Simple) ([]state.Validator, error) { func (n *Annos) GetCandidates(d *dao.Simple) ([]state.Validator, error) {
kvs, err := n.getCandidates(d, true, maxGetCandidatesRespLen) kvs, err := n.getCandidates(d, true, maxGetCandidatesRespLen)
if err != nil { if err != nil {
return nil, err return nil, err
@ -1155,7 +1155,7 @@ func (n *NEO) GetCandidates(d *dao.Simple) ([]state.Validator, error) {
return arr, nil return arr, nil
} }
func (n *NEO) getCandidatesCall(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getCandidatesCall(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
validators, err := n.getCandidates(ic.DAO, true, maxGetCandidatesRespLen) validators, err := n.getCandidates(ic.DAO, true, maxGetCandidatesRespLen)
if err != nil { if err != nil {
panic(err) panic(err)
@ -1170,11 +1170,11 @@ func (n *NEO) getCandidatesCall(ic *interop.Context, _ []stackitem.Item) stackit
return stackitem.NewArray(arr) return stackitem.NewArray(arr)
} }
func (n *NEO) getCommitteeAddress(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getCommitteeAddress(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
return stackitem.NewByteArray(n.GetCommitteeAddress(ic.DAO).BytesBE()) return stackitem.NewByteArray(n.GetCommitteeAddress(ic.DAO).BytesBE())
} }
func (n *NEO) getAllCandidatesCall(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getAllCandidatesCall(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
prefix := []byte{prefixCandidate} prefix := []byte{prefixCandidate}
buf := io.NewBufBinWriter() buf := io.NewBufBinWriter()
@ -1214,7 +1214,7 @@ func (n *NEO) getAllCandidatesCall(ic *interop.Context, _ []stackitem.Item) stac
return stackitem.NewInterop(item) return stackitem.NewInterop(item)
} }
func (n *NEO) getCandidateVoteCall(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) getCandidateVoteCall(ic *interop.Context, args []stackitem.Item) stackitem.Item {
pub := toPublicKey(args[0]) pub := toPublicKey(args[0])
key := makeValidatorKey(pub) key := makeValidatorKey(pub)
si := ic.DAO.GetStorageItem(n.ID, key) si := ic.DAO.GetStorageItem(n.ID, key)
@ -1228,7 +1228,7 @@ func (n *NEO) getCandidateVoteCall(ic *interop.Context, args []stackitem.Item) s
return stackitem.NewBigInteger(&c.Votes) return stackitem.NewBigInteger(&c.Votes)
} }
func (n *NEO) getAccountState(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Annos) getAccountState(ic *interop.Context, args []stackitem.Item) stackitem.Item {
key := makeAccountKey(toUint160(args[0])) key := makeAccountKey(toUint160(args[0]))
si := ic.DAO.GetStorageItem(n.ID, key) si := ic.DAO.GetStorageItem(n.ID, key)
if len(si) == 0 { if len(si) == 0 {
@ -1248,10 +1248,10 @@ func (n *NEO) getAccountState(ic *interop.Context, args []stackitem.Item) stacki
// Note: this method isn't actually "computes" new committee list and calculates // Note: this method isn't actually "computes" new committee list and calculates
// new validators list from it. Instead, it uses cache, and the cache itself is // new validators list from it. Instead, it uses cache, and the cache itself is
// updated during the PostPersist of the last block of every epoch. // updated during the PostPersist of the last block of every epoch.
func (n *NEO) ComputeNextBlockValidators(d *dao.Simple) keys.PublicKeys { func (n *Annos) ComputeNextBlockValidators(d *dao.Simple) keys.PublicKeys {
// It should always be OK with RO cache if using lower-layered DAO with proper // It should always be OK with RO cache if using lower-layered DAO with proper
// cache set. // cache set.
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
if vals := cache.newEpochNextValidators; vals != nil { if vals := cache.newEpochNextValidators; vals != nil {
return vals.Copy() return vals.Copy()
} }
@ -1262,13 +1262,13 @@ func (n *NEO) ComputeNextBlockValidators(d *dao.Simple) keys.PublicKeys {
panic("bug: unexpected external call to newEpochNextValidators cache") panic("bug: unexpected external call to newEpochNextValidators cache")
} }
func (n *NEO) getCommittee(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getCommittee(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
pubs := n.GetCommitteeMembers(ic.DAO) pubs := n.GetCommitteeMembers(ic.DAO)
slices.SortFunc(pubs, (*keys.PublicKey).Cmp) slices.SortFunc(pubs, (*keys.PublicKey).Cmp)
return pubsToArray(pubs) return pubsToArray(pubs)
} }
func (n *NEO) modifyVoterTurnout(d *dao.Simple, amount *big.Int) error { func (n *Annos) modifyVoterTurnout(d *dao.Simple, amount *big.Int) error {
key := []byte{prefixVotersCount} key := []byte{prefixVotersCount}
si := d.GetStorageItem(n.ID, key) si := d.GetStorageItem(n.ID, key)
if si == nil { if si == nil {
@ -1281,8 +1281,8 @@ func (n *NEO) modifyVoterTurnout(d *dao.Simple, amount *big.Int) error {
} }
// GetCommitteeMembers returns public keys of nodes in committee using cached value. // GetCommitteeMembers returns public keys of nodes in committee using cached value.
func (n *NEO) GetCommitteeMembers(d *dao.Simple) keys.PublicKeys { func (n *Annos) GetCommitteeMembers(d *dao.Simple) keys.PublicKeys {
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
return getCommitteeMembers(cache.committee) return getCommitteeMembers(cache.committee)
} }
@ -1309,7 +1309,7 @@ func toKeysWithVotes(pubs keys.PublicKeys) keysWithVotes {
} }
// computeCommitteeMembers returns public keys of nodes in committee. // computeCommitteeMembers returns public keys of nodes in committee.
func (n *NEO) computeCommitteeMembers(blockHeight uint32, d *dao.Simple) (keys.PublicKeys, keysWithVotes, error) { func (n *Annos) computeCommitteeMembers(blockHeight uint32, d *dao.Simple) (keys.PublicKeys, keysWithVotes, error) {
key := []byte{prefixVotersCount} key := []byte{prefixVotersCount}
si := d.GetStorageItem(n.ID, key) si := d.GetStorageItem(n.ID, key)
if si == nil { if si == nil {
@ -1354,19 +1354,19 @@ func (n *NEO) computeCommitteeMembers(blockHeight uint32, d *dao.Simple) (keys.P
return pubs, cs[:count], nil return pubs, cs[:count], nil
} }
func (n *NEO) getNextBlockValidators(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (n *Annos) getNextBlockValidators(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
result := n.GetNextBlockValidatorsInternal(ic.DAO) result := n.GetNextBlockValidatorsInternal(ic.DAO)
return pubsToArray(result) return pubsToArray(result)
} }
// GetNextBlockValidatorsInternal returns next block validators. // GetNextBlockValidatorsInternal returns next block validators.
func (n *NEO) GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys { func (n *Annos) GetNextBlockValidatorsInternal(d *dao.Simple) keys.PublicKeys {
cache := d.GetROCache(n.ID).(*NeoCache) cache := d.GetROCache(n.ID).(*AnnosCache)
return cache.nextValidators.Copy() return cache.nextValidators.Copy()
} }
// BalanceOf returns native NEO token balance for the acc. // BalanceOf returns native Annos token balance for the acc.
func (n *NEO) BalanceOf(d *dao.Simple, acc util.Uint160) (*big.Int, uint32) { func (n *Annos) BalanceOf(d *dao.Simple, acc util.Uint160) (*big.Int, uint32) {
key := makeAccountKey(acc) key := makeAccountKey(acc)
si := d.GetStorageItem(n.ID, key) si := d.GetStorageItem(n.ID, key)
if si == nil { if si == nil {
@ -1374,7 +1374,7 @@ func (n *NEO) BalanceOf(d *dao.Simple, acc util.Uint160) (*big.Int, uint32) {
} }
st, err := state.NEOBalanceFromBytes(si) st, err := state.NEOBalanceFromBytes(si)
if err != nil { if err != nil {
panic(fmt.Errorf("failed to decode NEO balance state: %w", err)) panic(fmt.Errorf("failed to decode Annos balance state: %w", err))
} }
return &st.Balance, st.BalanceHeight return &st.Balance, st.BalanceHeight
} }
@ -1400,9 +1400,9 @@ func toPublicKey(s stackitem.Item) *keys.PublicKey {
} }
// putGASRecord is a helper which creates key and puts GASPerBlock value into the storage. // putGASRecord is a helper which creates key and puts GASPerBlock value into the storage.
func (n *NEO) putGASRecord(dao *dao.Simple, index uint32, value *big.Int) { func (n *Annos) putGASRecord(dao *dao.Simple, index uint32, value *big.Int) {
key := make([]byte, 5) key := make([]byte, 5)
key[0] = prefixGASPerBlock key[0] = prefixLubPerBlock
binary.BigEndian.PutUint32(key[1:], index) binary.BigEndian.PutUint32(key[1:], index)
dao.PutBigInt(n.ID, key, value) dao.PutBigInt(n.ID, key, value)
} }

View File

@ -17,10 +17,10 @@ import (
"github.com/tutus-one/tutus-chain/pkg/util" "github.com/tutus-one/tutus-chain/pkg/util"
) )
// GAS represents GAS native contract. // Lub represents Lub native contract (utility/fee token - lubrication).
type GAS struct { type Lub struct {
nep17TokenNative nep17TokenNative
NEO INEO Annos IAnnos
Policy IPolicy Policy IPolicy
Vita IVita // For checking local Vita status Vita IVita // For checking local Vita status
Federation IFederation // For visiting Vita and fee split Federation IFederation // For visiting Vita and fee split
@ -44,20 +44,20 @@ const (
VitaExemptAsylum VitaExemptAsylum
) )
// GASFactor is a divisor for finding GAS integral value. // LubFactor is a divisor for finding Lub integral value.
const GASFactor = NEOTotalSupply const LubFactor = AnnosTotalSupply
// newGAS returns GAS native contract. // newLub returns Lub native contract.
func newGAS(init int64) *GAS { func newLub(init int64) *Lub {
g := &GAS{ g := &Lub{
initialSupply: init, initialSupply: init,
} }
defer g.BuildHFSpecificMD(g.ActiveIn()) defer g.BuildHFSpecificMD(g.ActiveIn())
nep17 := newNEP17Native(nativenames.Gas, nativeids.GasToken, nil) nep17 := newNEP17Native(nativenames.Lub, nativeids.Lub, nil)
nep17.symbol = "GAS" nep17.symbol = "LUB"
nep17.decimals = 8 nep17.decimals = 8
nep17.factor = GASFactor nep17.factor = LubFactor
nep17.incBalance = g.increaseBalance nep17.incBalance = g.increaseBalance
nep17.balFromBytes = g.balanceFromBytes nep17.balFromBytes = g.balanceFromBytes
@ -66,7 +66,7 @@ func newGAS(init int64) *GAS {
return g return g
} }
func (g *GAS) increaseBalance(_ *interop.Context, _ util.Uint160, si *state.StorageItem, amount *big.Int, checkBal *big.Int) (func(), error) { func (g *Lub) increaseBalance(_ *interop.Context, _ util.Uint160, si *state.StorageItem, amount *big.Int, checkBal *big.Int) (func(), error) {
acc, err := state.NEP17BalanceFromBytes(*si) acc, err := state.NEP17BalanceFromBytes(*si)
if err != nil { if err != nil {
return nil, err return nil, err
@ -89,7 +89,7 @@ func (g *GAS) increaseBalance(_ *interop.Context, _ util.Uint160, si *state.Stor
return nil, nil return nil, nil
} }
func (g *GAS) balanceFromBytes(si *state.StorageItem) (*big.Int, error) { func (g *Lub) balanceFromBytes(si *state.StorageItem) (*big.Int, error) {
acc, err := state.NEP17BalanceFromBytes(*si) acc, err := state.NEP17BalanceFromBytes(*si)
if err != nil { if err != nil {
return nil, err return nil, err
@ -97,8 +97,8 @@ func (g *GAS) balanceFromBytes(si *state.StorageItem) (*big.Int, error) {
return &acc.Balance, err return &acc.Balance, err
} }
// Initialize initializes a GAS contract. // Initialize initializes a Lub contract.
func (g *GAS) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *interop.HFSpecificContractMD) error { func (g *Lub) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *interop.HFSpecificContractMD) error {
if hf != g.ActiveIn() { if hf != g.ActiveIn() {
return nil return nil
} }
@ -119,12 +119,12 @@ func (g *GAS) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *intero
} }
// InitializeCache implements the Contract interface. // InitializeCache implements the Contract interface.
func (g *GAS) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error { func (g *Lub) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error {
return nil return nil
} }
// OnPersist implements the Contract interface. // OnPersist implements the Contract interface.
func (g *GAS) OnPersist(ic *interop.Context) error { func (g *Lub) OnPersist(ic *interop.Context) error {
if len(ic.Block.Transactions) == 0 { if len(ic.Block.Transactions) == 0 {
return nil return nil
} }
@ -155,7 +155,7 @@ func (g *GAS) OnPersist(ic *interop.Context) error {
g.Burn(ic, sender, absAmount) g.Burn(ic, sender, absAmount)
} }
} }
validators := g.NEO.GetNextBlockValidatorsInternal(ic.DAO) validators := g.Annos.GetNextBlockValidatorsInternal(ic.DAO)
primary := validators[ic.Block.PrimaryIndex].GetScriptHash() primary := validators[ic.Block.PrimaryIndex].GetScriptHash()
var netFee int64 var netFee int64
for _, tx := range ic.Block.Transactions { for _, tx := range ic.Block.Transactions {
@ -173,12 +173,12 @@ func (g *GAS) OnPersist(ic *interop.Context) error {
} }
// PostPersist implements the Contract interface. // PostPersist implements the Contract interface.
func (g *GAS) PostPersist(ic *interop.Context) error { func (g *Lub) PostPersist(ic *interop.Context) error {
return nil return nil
} }
// getVitaExemptType determines if sender is exempt from fees and what type. // getVitaExemptType determines if sender is exempt from fees and what type.
func (g *GAS) getVitaExemptType(d *dao.Simple, sender util.Uint160) VitaExemptType { func (g *Lub) getVitaExemptType(d *dao.Simple, sender util.Uint160) VitaExemptType {
// Check local Vita first // Check local Vita first
if g.Vita != nil { if g.Vita != nil {
token, err := g.Vita.GetTokenByOwner(d, sender) token, err := g.Vita.GetTokenByOwner(d, sender)
@ -206,13 +206,13 @@ func (g *GAS) getVitaExemptType(d *dao.Simple, sender util.Uint160) VitaExemptTy
return VitaExemptNone return VitaExemptNone
} }
// burnFromTreasury burns GAS from Treasury for local Vita holders (100% local). // burnFromTreasury burns Lub from Treasury for local Vita holders (100% local).
func (g *GAS) burnFromTreasury(ic *interop.Context, amount *big.Int) { func (g *Lub) burnFromTreasury(ic *interop.Context, amount *big.Int) {
g.burnFromTreasuryInternal(ic, amount, 100, 0) g.burnFromTreasuryInternal(ic, amount, 100, 0)
} }
// burnFromTreasuryWithSplit burns GAS with visiting fee split between local Treasury and inter-chain debt. // burnFromTreasuryWithSplit burns Lub with visiting fee split between local Treasury and inter-chain debt.
func (g *GAS) burnFromTreasuryWithSplit(ic *interop.Context, amount *big.Int, homeChain uint32) { func (g *Lub) burnFromTreasuryWithSplit(ic *interop.Context, amount *big.Int, homeChain uint32) {
localPercent := uint8(100) localPercent := uint8(100)
if g.Federation != nil { if g.Federation != nil {
localPercent = g.Federation.GetVisitingFeePercent(ic.DAO) localPercent = g.Federation.GetVisitingFeePercent(ic.DAO)
@ -221,7 +221,7 @@ func (g *GAS) burnFromTreasuryWithSplit(ic *interop.Context, amount *big.Int, ho
} }
// burnFromTreasuryInternal handles the actual burn with optional split between local and inter-chain. // burnFromTreasuryInternal handles the actual burn with optional split between local and inter-chain.
func (g *GAS) burnFromTreasuryInternal(ic *interop.Context, amount *big.Int, localPercent uint8, homeChain uint32) { func (g *Lub) burnFromTreasuryInternal(ic *interop.Context, amount *big.Int, localPercent uint8, homeChain uint32) {
if g.Treasury == nil { if g.Treasury == nil {
return return
} }
@ -252,12 +252,12 @@ func (g *GAS) burnFromTreasuryInternal(ic *interop.Context, amount *big.Int, loc
} }
// ActiveIn implements the Contract interface. // ActiveIn implements the Contract interface.
func (g *GAS) ActiveIn() *config.Hardfork { func (g *Lub) ActiveIn() *config.Hardfork {
return nil return nil
} }
// BalanceOf returns native GAS token balance for the acc. // BalanceOf returns native Lub token balance for the acc.
func (g *GAS) BalanceOf(d *dao.Simple, acc util.Uint160) *big.Int { func (g *Lub) BalanceOf(d *dao.Simple, acc util.Uint160) *big.Int {
return g.balanceOfInternal(d, acc) return g.balanceOfInternal(d, acc)
} }

View File

@ -31,7 +31,7 @@ func TestCryptoLib_KoblitzVerificationScript(t *testing.T) {
buildVerificationScript func(t *testing.T, pub *keys.PublicKey) []byte, buildVerificationScript func(t *testing.T, pub *keys.PublicKey) []byte,
constructMsg func(t *testing.T, magic uint32, tx hash.Hashable) []byte, constructMsg func(t *testing.T, magic uint32, tx hash.Hashable) []byte,
) { ) {
c := newGasClient(t) c := newLubClient(t)
gasInvoker := c.WithSigners(c.Committee) gasInvoker := c.WithSigners(c.Committee)
e := c.Executor e := c.Executor
@ -586,7 +586,7 @@ func TestCryptoLib_KoblitzMultisigVerificationScript(t *testing.T) {
buildVerificationScript func(t *testing.T, m int, pub keys.PublicKeys) []byte, buildVerificationScript func(t *testing.T, m int, pub keys.PublicKeys) []byte,
constructMsg func(t *testing.T, magic uint32, tx hash.Hashable) []byte, constructMsg func(t *testing.T, magic uint32, tx hash.Hashable) []byte,
) { ) {
c := newGasClient(t) c := newLubClient(t)
gasInvoker := c.WithSigners(c.Committee) gasInvoker := c.WithSigners(c.Committee)
e := c.Executor e := c.Executor

View File

@ -17,12 +17,12 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func newGasClient(t *testing.T) *neotest.ContractInvoker { func newLubClient(t *testing.T) *neotest.ContractInvoker {
return newNativeClient(t, nativenames.Gas) return newNativeClient(t, nativenames.Lub)
} }
func TestGAS_Roundtrip(t *testing.T) { func TestLub_Roundtrip(t *testing.T) {
c := newGasClient(t) c := newLubClient(t)
e := c.Executor e := c.Executor
gasInvoker := c.WithSigners(c.NewAccount(t)) gasInvoker := c.WithSigners(c.NewAccount(t))
owner := gasInvoker.Signers[0].ScriptHash() owner := gasInvoker.Signers[0].ScriptHash()
@ -30,7 +30,7 @@ func TestGAS_Roundtrip(t *testing.T) {
getUtilityTokenBalance := func(acc util.Uint160) (*big.Int, uint32) { getUtilityTokenBalance := func(acc util.Uint160) (*big.Int, uint32) {
lub, err := e.Chain.GetTokenLastUpdated(acc) lub, err := e.Chain.GetTokenLastUpdated(acc)
require.NoError(t, err) require.NoError(t, err)
return e.Chain.GetUtilityTokenBalance(acc), lub[e.NativeID(t, nativenames.Gas)] return e.Chain.GetUtilityTokenBalance(acc), lub[e.NativeID(t, nativenames.Lub)]
} }
initialBalance, _ := getUtilityTokenBalance(owner) initialBalance, _ := getUtilityTokenBalance(owner)
@ -59,7 +59,7 @@ func TestGAS_Roundtrip(t *testing.T) {
}) })
} }
func TestGAS_RewardWithP2PSigExtensionsEnabled(t *testing.T) { func TestLub_RewardWithP2PSigExtensionsEnabled(t *testing.T) {
const ( const (
nNotaries = 2 nNotaries = 2
nKeys = 4 nKeys = 4
@ -75,12 +75,12 @@ func TestGAS_RewardWithP2PSigExtensionsEnabled(t *testing.T) {
} }
}) })
e := neotest.NewExecutor(t, bc, validator, committee) e := neotest.NewExecutor(t, bc, validator, committee)
gasCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) lubCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
notaryHash := e.NativeHash(t, nativenames.Notary) notaryHash := e.NativeHash(t, nativenames.Notary)
notaryServiceFeePerKey := e.Chain.GetNotaryServiceFeePerKey() notaryServiceFeePerKey := e.Chain.GetNotaryServiceFeePerKey()
// transfer funds to committee // transfer funds to committee
e.ValidatorInvoker(e.NativeHash(t, nativenames.Gas)).Invoke(t, true, "transfer", e.Validator.ScriptHash(), e.CommitteeHash, 1000_0000_0000, nil) e.ValidatorInvoker(e.NativeHash(t, nativenames.Lub)).Invoke(t, true, "transfer", e.Validator.ScriptHash(), e.CommitteeHash, 1000_0000_0000, nil)
// set Notary nodes and check their balance // set Notary nodes and check their balance
notaryNodes := make([]*keys.PrivateKey, nNotaries) notaryNodes := make([]*keys.PrivateKey, nNotaries)
@ -96,17 +96,17 @@ func TestGAS_RewardWithP2PSigExtensionsEnabled(t *testing.T) {
e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(0)) e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(0))
} }
// deposit GAS for `signer` with lock until the next block (inclusively) // deposit Lub for `signer` with lock until the next block (inclusively)
depositAmount := 100_0000 + (2+int64(nKeys))*notaryServiceFeePerKey // sysfee + netfee of the next transaction depositAmount := 100_0000 + (2+int64(nKeys))*notaryServiceFeePerKey // sysfee + netfee of the next transaction
gasCommitteeInvoker.Invoke(t, true, "transfer", e.CommitteeHash, notaryHash, depositAmount, []any{e.CommitteeHash, e.Chain.BlockHeight() + 2}) lubCommitteeInvoker.Invoke(t, true, "transfer", e.CommitteeHash, notaryHash, depositAmount, []any{e.CommitteeHash, e.Chain.BlockHeight() + 2})
// save initial GAS total supply // save initial Lub total supply
getGASTS := func(t *testing.T) int64 { getLubTS := func(t *testing.T) int64 {
stack, err := gasCommitteeInvoker.TestInvoke(t, "totalSupply") stack, err := lubCommitteeInvoker.TestInvoke(t, "totalSupply")
require.NoError(t, err) require.NoError(t, err)
return stack.Pop().Value().(*big.Int).Int64() return stack.Pop().Value().(*big.Int).Int64()
} }
tsInitial := getGASTS(t) tsInitial := getLubTS(t)
// send transaction with Notary contract as a sender // send transaction with Notary contract as a sender
tx := transaction.New([]byte{byte(opcode.PUSH1)}, 1_000_000) tx := transaction.New([]byte{byte(opcode.PUSH1)}, 1_000_000)
@ -140,15 +140,15 @@ func TestGAS_RewardWithP2PSigExtensionsEnabled(t *testing.T) {
for _, notaryNode := range notaryNodes { for _, notaryNode := range notaryNodes {
e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(notaryServiceFeePerKey*(nKeys+1)/nNotaries)) e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(notaryServiceFeePerKey*(nKeys+1)/nNotaries))
} }
tsUpdated := getGASTS(t) tsUpdated := getLubTS(t)
tsExpected := tsInitial + 5000_0000 - tx.SystemFee tsExpected := tsInitial + 5000_0000 - tx.SystemFee
require.Equal(t, tsExpected, tsUpdated) require.Equal(t, tsExpected, tsUpdated)
} }
// TestGAS_TransferNegative ensures that transfer of a negative GAS amount leads to // TestLub_TransferNegative ensures that transfer of a negative Lub amount leads to
// a VM FAULT, ref. #4072. // a VM FAULT, ref. #4072.
func TestGas_TransferNegative(t *testing.T) { func TestLub_TransferNegative(t *testing.T) {
c := newGasClient(t) c := newLubClient(t)
acc := c.NewAccount(t) acc := c.NewAccount(t)
gasInvoker := c.WithSigners(acc) gasInvoker := c.WithSigners(acc)
gasInvoker.InvokeFail(t, "negative amount", "transfer", acc.ScriptHash(), acc.ScriptHash(), -1, nil) gasInvoker.InvokeFail(t, "negative amount", "transfer", acc.ScriptHash(), acc.ScriptHash(), -1, nil)

View File

@ -46,8 +46,8 @@ var (
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.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.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.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.Neo: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":65467259},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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.Annos: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":65467259},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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.Gas: `{"id":-6,"hash":"0xd2a4cff31913016155e38e474a2c06d08be276cf","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":2663858513},"manifest":{"name":"GasToken","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.Lub: `{"id":-6,"hash":"0xd2a4cff31913016155e38e474a2c06d08be276cf","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":2663858513},"manifest":{"name":"GasToken","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.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.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.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}`,
@ -69,7 +69,7 @@ var (
// under assumption that hardforks from Aspidochelone to Cockatrice (included) are enabled. // under assumption that hardforks from Aspidochelone to Cockatrice (included) are enabled.
cockatriceCSS = map[string]string{ 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.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.Neo: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1325686241},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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}`, nativenames.Annos: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=","checksum":1325686241},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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) // echidnaCSS holds serialized native contract states built for genesis block (with UpdateCounter 0)
// under assumption that hardforks from Aspidochelone to Echidna (included) are enabled. // under assumption that hardforks from Aspidochelone to Echidna (included) are enabled.
@ -77,7 +77,7 @@ var (
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.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.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.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.Neo: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1991619121},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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.Annos: `{"id":-5,"hash":"0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dA","checksum":1991619121},"manifest":{"name":"NeoToken","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":"getGasPerBlock","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":"setGasPerBlock","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":"unclaimedGas","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.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.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}`, 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}`,
@ -265,9 +265,9 @@ func TestManagement_NativeDeployUpdateNotifications(t *testing.T) {
// Notary and Treasury are not deployed at genesis // Notary and Treasury are not deployed at genesis
// Federation activates at HFFaun, not genesis // Federation activates at HFFaun, not genesis
continue continue
case nativenames.Gas: case nativenames.Lub:
expected = append(expected, state.NotificationEvent{ expected = append(expected, state.NotificationEvent{
ScriptHash: nativehashes.GasToken, ScriptHash: nativehashes.LubToken,
Name: "Transfer", Name: "Transfer",
Item: stackitem.NewArray([]stackitem.Item{ Item: stackitem.NewArray([]stackitem.Item{
stackitem.Null{}, stackitem.Null{},
@ -275,14 +275,14 @@ func TestManagement_NativeDeployUpdateNotifications(t *testing.T) {
stackitem.Make(mgmt.Chain.GetConfig().InitialGASSupply), stackitem.Make(mgmt.Chain.GetConfig().InitialGASSupply),
}), }),
}) })
case nativenames.Neo: case nativenames.Annos:
expected = append(expected, state.NotificationEvent{ expected = append(expected, state.NotificationEvent{
ScriptHash: nativehashes.NeoToken, ScriptHash: nativehashes.AnnosToken,
Name: "Transfer", Name: "Transfer",
Item: stackitem.NewArray([]stackitem.Item{ Item: stackitem.NewArray([]stackitem.Item{
stackitem.Null{}, stackitem.Null{},
stackitem.Make(mgmt.Validator.ScriptHash()), stackitem.Make(mgmt.Validator.ScriptHash()),
stackitem.Make(native.NEOTotalSupply), stackitem.Make(native.AnnosTotalSupply),
}), }),
}) })
} }
@ -301,7 +301,7 @@ func TestManagement_NativeDeployUpdateNotifications(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 1, len(aer)) require.Equal(t, 1, len(aer))
expected = expected[:0] expected = expected[:0]
for _, name := range []string{nativenames.CryptoLib, nativenames.Neo} { for _, name := range []string{nativenames.CryptoLib, nativenames.Annos} {
expected = append(expected, state.NotificationEvent{ expected = append(expected, state.NotificationEvent{
ScriptHash: nativehashes.ContractManagement, ScriptHash: nativehashes.ContractManagement,
Name: "Update", Name: "Update",
@ -324,7 +324,7 @@ func TestManagement_NativeDeployUpdateNotifications(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 1, len(aer)) require.Equal(t, 1, len(aer))
expected = expected[:0] expected = expected[:0]
for _, h := range []util.Uint160{nativehashes.ContractManagement, nativehashes.StdLib, nativehashes.CryptoLib, nativehashes.NeoToken, nativehashes.PolicyContract, nativehashes.RoleManagement} { for _, h := range []util.Uint160{nativehashes.ContractManagement, nativehashes.StdLib, nativehashes.CryptoLib, nativehashes.AnnosToken, nativehashes.PolicyContract, nativehashes.RoleManagement} {
expected = append(expected, state.NotificationEvent{ expected = append(expected, state.NotificationEvent{
ScriptHash: nativehashes.ContractManagement, ScriptHash: nativehashes.ContractManagement,
Name: "Update", Name: "Update",
@ -416,7 +416,7 @@ func TestManagement_NativeUpdate(t *testing.T) {
require.NotNil(t, cs, name) require.NotNil(t, cs, name)
} }
var actual = cs var actual = cs
if name == nativenames.Neo || name == nativenames.CryptoLib { if name == nativenames.Annos || name == nativenames.CryptoLib {
// A tiny hack to reuse cockatriceCSS map in the check below. // A tiny hack to reuse cockatriceCSS map in the check below.
require.Equal(t, uint16(1), cs.UpdateCounter, name) require.Equal(t, uint16(1), cs.UpdateCounter, name)
cp := *cs cp := *cs
@ -473,7 +473,7 @@ func TestManagement_NativeUpdate_Call(t *testing.T) {
cockatriceHeight = 3 cockatriceHeight = 3
method = "getCommitteeAddress" method = "getCommitteeAddress"
) )
c := newCustomNativeClient(t, nativenames.Neo, func(cfg *config.Blockchain) { c := newCustomNativeClient(t, nativenames.Annos, func(cfg *config.Blockchain) {
cfg.Hardforks = map[string]uint32{ cfg.Hardforks = map[string]uint32{
config.HFAspidochelone.String(): 0, config.HFAspidochelone.String(): 0,
config.HFBasilisk.String(): 0, config.HFBasilisk.String(): 0,
@ -625,8 +625,8 @@ func TestManagement_ContractCache(t *testing.T) {
nativehashes.StdLib, nativehashes.StdLib,
nativehashes.CryptoLib, nativehashes.CryptoLib,
nativehashes.LedgerContract, nativehashes.LedgerContract,
nativehashes.NeoToken, nativehashes.AnnosToken,
nativehashes.GasToken, nativehashes.LubToken,
nativehashes.PolicyContract, nativehashes.PolicyContract,
nativehashes.RoleManagement, nativehashes.RoleManagement,
nativehashes.OracleContract, nativehashes.OracleContract,

View File

@ -48,23 +48,23 @@ func newNeoCommitteeClient(t *testing.T, expectedGASBalance int) *neotest.Contra
e := neotest.NewExecutor(t, bc, validators, committee) e := neotest.NewExecutor(t, bc, validators, committee)
if expectedGASBalance > 0 { if expectedGASBalance > 0 {
e.ValidatorInvoker(e.NativeHash(t, nativenames.Gas)).Invoke(t, true, "transfer", e.Validator.ScriptHash(), e.CommitteeHash, expectedGASBalance, nil) e.ValidatorInvoker(e.NativeHash(t, nativenames.Lub)).Invoke(t, true, "transfer", e.Validator.ScriptHash(), e.CommitteeHash, expectedGASBalance, nil)
} }
return e.CommitteeInvoker(e.NativeHash(t, nativenames.Neo)) return e.CommitteeInvoker(e.NativeHash(t, nativenames.Annos))
} }
func newNeoValidatorsClient(t *testing.T) *neotest.ContractInvoker { func newNeoValidatorsClient(t *testing.T) *neotest.ContractInvoker {
c := newNeoCommitteeClient(t, 100_0000_0000) c := newNeoCommitteeClient(t, 100_0000_0000)
return c.ValidatorInvoker(c.NativeHash(t, nativenames.Neo)) return c.ValidatorInvoker(c.NativeHash(t, nativenames.Annos))
} }
func TestNEO_GasPerBlock(t *testing.T) { func TestNEO_GasPerBlock(t *testing.T) {
testGetSet(t, newNeoCommitteeClient(t, 100_0000_0000), "GasPerBlock", 5*native.GASFactor, 0, 10*native.GASFactor) testGetSet(t, newNeoCommitteeClient(t, 100_0000_0000), "GasPerBlock", 5*native.LubFactor, 0, 10*native.LubFactor)
} }
func TestNEO_GasPerBlockCache(t *testing.T) { func TestNEO_GasPerBlockCache(t *testing.T) {
testGetSetCache(t, newNeoCommitteeClient(t, 100_0000_0000), "GasPerBlock", 5*native.GASFactor) testGetSetCache(t, newNeoCommitteeClient(t, 100_0000_0000), "GasPerBlock", 5*native.LubFactor)
} }
func TestNEO_RegisterPrice(t *testing.T) { func TestNEO_RegisterPrice(t *testing.T) {
@ -76,7 +76,7 @@ func TestNEO_RegisterPriceCache(t *testing.T) {
} }
func TestNEO_CandidateEvents(t *testing.T) { func TestNEO_CandidateEvents(t *testing.T) {
c := newNativeClient(t, nativenames.Neo) c := newNativeClient(t, nativenames.Annos)
singleSigner := c.Signers[0].(neotest.MultiSigner).Single(0) singleSigner := c.Signers[0].(neotest.MultiSigner).Single(0)
cc := c.WithSigners(c.Signers[0], singleSigner) cc := c.WithSigners(c.Signers[0], singleSigner)
e := c.Executor e := c.Executor
@ -383,7 +383,7 @@ func TestNEO_RecursiveGASMint(t *testing.T) {
neoCommitteeInvoker := newNeoCommitteeClient(t, 100_0000_0000) neoCommitteeInvoker := newNeoCommitteeClient(t, 100_0000_0000)
neoValidatorInvoker := neoCommitteeInvoker.WithSigners(neoCommitteeInvoker.Validator) neoValidatorInvoker := neoCommitteeInvoker.WithSigners(neoCommitteeInvoker.Validator)
e := neoCommitteeInvoker.Executor e := neoCommitteeInvoker.Executor
gasValidatorInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Gas)) gasValidatorInvoker := e.ValidatorInvoker(e.NativeHash(t, nativenames.Lub))
c := neotest.CompileFile(t, e.Validator.ScriptHash(), "../../../../internal/basicchain/testdata/test_contract.go", "../../../../internal/basicchain/testdata/test_contract.yml") c := neotest.CompileFile(t, e.Validator.ScriptHash(), "../../../../internal/basicchain/testdata/test_contract.go", "../../../../internal/basicchain/testdata/test_contract.yml")
e.DeployContract(t, c, nil) e.DeployContract(t, c, nil)
@ -490,8 +490,8 @@ func TestNEO_GetAccountState(t *testing.T) {
advanceChain(t) advanceChain(t)
neoValidatorInvoker.WithSigners(acc).Invoke(t, true, "transfer", acc.ScriptHash(), acc.ScriptHash(), amount, nil) neoValidatorInvoker.WithSigners(acc).Invoke(t, true, "transfer", acc.ScriptHash(), acc.ScriptHash(), amount, nil)
as = getAccountState(t, acc.ScriptHash()) as = getAccountState(t, acc.ScriptHash())
expect := GasPerBlock * native.GASFactor * VoterRewardRatio / 100 * (uint64(e.Chain.BlockHeight()) / uint64(committeeSize)) expect := GasPerBlock * native.LubFactor * VoterRewardRatio / 100 * (uint64(e.Chain.BlockHeight()) / uint64(committeeSize))
expect = expect * uint64(committeeSize) / uint64(validatorSize+committeeSize) * native.NEOTotalSupply / as.Balance.Uint64() expect = expect * uint64(committeeSize) / uint64(validatorSize+committeeSize) * native.AnnosTotalSupply / as.Balance.Uint64()
require.Equal(t, e.Chain.BlockHeight(), as.BalanceHeight) require.Equal(t, e.Chain.BlockHeight(), as.BalanceHeight)
require.Equal(t, expect, as.LastGasPerVote.Uint64()) require.Equal(t, expect, as.LastGasPerVote.Uint64())
}) })
@ -547,8 +547,8 @@ func TestNEO_GetAccountStateInteropAPI(t *testing.T) {
GasPerBlock = 5 GasPerBlock = 5
VoterRewardRatio = 80 VoterRewardRatio = 80
) )
expect := GasPerBlock * native.GASFactor * VoterRewardRatio / 100 * (uint64(e.Chain.BlockHeight()) / uint64(committeeSize)) expect := GasPerBlock * native.LubFactor * VoterRewardRatio / 100 * (uint64(e.Chain.BlockHeight()) / uint64(committeeSize))
expect = expect * uint64(committeeSize) / uint64(validatorSize+committeeSize) * native.NEOTotalSupply / uint64(amount) expect = expect * uint64(committeeSize) / uint64(validatorSize+committeeSize) * native.AnnosTotalSupply / uint64(amount)
ctrInvoker := e.NewInvoker(ctr.Hash, e.Committee) ctrInvoker := e.NewInvoker(ctr.Hash, e.Committee)
ctrInvoker.Invoke(t, stackitem.Make(expect), "getLastGasPerVote") ctrInvoker.Invoke(t, stackitem.Make(expect), "getLastGasPerVote")
} }
@ -613,7 +613,7 @@ func TestNEO_TransferOnPayment(t *testing.T) {
ScriptHash: cs.Hash, ScriptHash: cs.Hash,
Name: "LastPaymentNEP17", Name: "LastPaymentNEP17",
Item: stackitem.NewArray([]stackitem.Item{ Item: stackitem.NewArray([]stackitem.Item{
stackitem.NewByteArray(e.NativeHash(t, nativenames.Neo).BytesBE()), stackitem.NewByteArray(e.NativeHash(t, nativenames.Annos).BytesBE()),
stackitem.NewByteArray(e.Validator.ScriptHash().BytesBE()), stackitem.NewByteArray(e.Validator.ScriptHash().BytesBE()),
stackitem.NewBigInteger(big.NewInt(amount)), stackitem.NewBigInteger(big.NewInt(amount)),
stackitem.Null{}, stackitem.Null{},
@ -623,7 +623,7 @@ func TestNEO_TransferOnPayment(t *testing.T) {
ScriptHash: cs.Hash, ScriptHash: cs.Hash,
Name: "LastPaymentNEP17", Name: "LastPaymentNEP17",
Item: stackitem.NewArray([]stackitem.Item{ Item: stackitem.NewArray([]stackitem.Item{
stackitem.NewByteArray(e.NativeHash(t, nativenames.Gas).BytesBE()), stackitem.NewByteArray(e.NativeHash(t, nativenames.Lub).BytesBE()),
stackitem.Null{}, stackitem.Null{},
stackitem.NewBigInteger(big.NewInt(1)), stackitem.NewBigInteger(big.NewInt(1)),
stackitem.Null{}, stackitem.Null{},
@ -781,7 +781,7 @@ func TestNEO_CalculateBonus(t *testing.T) {
for range rewardDistance/2 - 2 { for range rewardDistance/2 - 2 {
e.AddNewBlock(t) e.AddNewBlock(t)
} }
neoCommitteeInvoker.Invoke(t, stackitem.Null{}, "setGasPerBlock", newGASPerBlock*native.GASFactor) neoCommitteeInvoker.Invoke(t, stackitem.Null{}, "setGasPerBlock", newGASPerBlock*native.LubFactor)
// Five blocks more with modified GasPerBlock value. // Five blocks more with modified GasPerBlock value.
for range rewardDistance / 2 { for range rewardDistance / 2 {
@ -921,7 +921,7 @@ func TestNEO_RegisterViaNEP27(t *testing.T) {
neoCommitteeInvoker := newNeoCommitteeClient(t, 100_0000_0000) neoCommitteeInvoker := newNeoCommitteeClient(t, 100_0000_0000)
neoValidatorsInvoker := neoCommitteeInvoker.WithSigners(neoCommitteeInvoker.Validator) neoValidatorsInvoker := neoCommitteeInvoker.WithSigners(neoCommitteeInvoker.Validator)
e := neoCommitteeInvoker.Executor e := neoCommitteeInvoker.Executor
neoHash := e.NativeHash(t, nativenames.Neo) neoHash := e.NativeHash(t, nativenames.Annos)
cfg := e.Chain.GetConfig() cfg := e.Chain.GetConfig()
candidatesCount := cfg.GetCommitteeSize(0) - 1 candidatesCount := cfg.GetCommitteeSize(0) - 1
@ -944,7 +944,7 @@ func TestNEO_RegisterViaNEP27(t *testing.T) {
e.AddNewBlock(t) e.AddNewBlock(t)
} }
gasValidatorsInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) gasValidatorsInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
txes := make([]*transaction.Transaction, 0, candidatesCount*3) txes := make([]*transaction.Transaction, 0, candidatesCount*3)
for i := range candidatesCount { for i := range candidatesCount {
transferTx := neoValidatorsInvoker.PrepareInvoke(t, "transfer", e.Validator.ScriptHash(), voters[i].(neotest.SingleSigner).Account().PrivateKey().GetScriptHash(), int64(candidatesCount+1-i)*1000000, nil) transferTx := neoValidatorsInvoker.PrepareInvoke(t, "transfer", e.Validator.ScriptHash(), voters[i].(neotest.SingleSigner).Account().PrivateKey().GetScriptHash(), int64(candidatesCount+1-i)*1000000, nil)

View File

@ -51,8 +51,8 @@ func TestNotary_MaxNotValidBeforeDeltaCache(t *testing.T) {
func TestNotary_Pipeline(t *testing.T) { func TestNotary_Pipeline(t *testing.T) {
notaryCommitteeInvoker := newNotaryClient(t) notaryCommitteeInvoker := newNotaryClient(t)
e := notaryCommitteeInvoker.Executor e := notaryCommitteeInvoker.Executor
neoCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Neo)) annosCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Annos))
gasCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) lubCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary) notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary)
feePerKey := e.Chain.GetNotaryServiceFeePerKey() feePerKey := e.Chain.GetNotaryServiceFeePerKey()
@ -76,19 +76,19 @@ func TestNotary_Pipeline(t *testing.T) {
notaryCommitteeInvoker.Invoke(t, false, "lockDepositUntil", multisigHash, int64(depositLock+1)) notaryCommitteeInvoker.Invoke(t, false, "lockDepositUntil", multisigHash, int64(depositLock+1))
// `onPayment`: bad token // `onPayment`: bad token
neoCommitteeInvoker.InvokeFail(t, "only GAS can be accepted for deposit", "transfer", multisigHash, notaryHash, int64(1), &notary.OnNEP17PaymentData{Till: uint32(depositLock)}) annosCommitteeInvoker.InvokeFail(t, "only GAS can be accepted for deposit", "transfer", multisigHash, notaryHash, int64(1), &notary.OnNEP17PaymentData{Till: uint32(depositLock)})
// `onPayment`: insufficient first deposit // `onPayment`: insufficient first deposit
gasCommitteeInvoker.InvokeFail(t, "first deposit can not be less than", "transfer", multisigHash, notaryHash, int64(2*feePerKey-1), &notary.OnNEP17PaymentData{Till: uint32(depositLock)}) lubCommitteeInvoker.InvokeFail(t, "first deposit can not be less than", "transfer", multisigHash, notaryHash, int64(2*feePerKey-1), &notary.OnNEP17PaymentData{Till: uint32(depositLock)})
// `onPayment`: invalid `data` (missing `till` parameter) // `onPayment`: invalid `data` (missing `till` parameter)
gasCommitteeInvoker.InvokeFail(t, "`data` parameter should be an array of 2 elements", "transfer", multisigHash, notaryHash, 2*feePerKey, []any{nil}) lubCommitteeInvoker.InvokeFail(t, "`data` parameter should be an array of 2 elements", "transfer", multisigHash, notaryHash, 2*feePerKey, []any{nil})
// `onPayment`: invalid `data` (outdated `till` parameter) // `onPayment`: invalid `data` (outdated `till` parameter)
gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{}) lubCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{})
// `onPayment`: good // `onPayment`: good
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Till: uint32(depositLock)}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Till: uint32(depositLock)})
checkBalanceOf(t, notaryHash, 2*feePerKey) checkBalanceOf(t, notaryHash, 2*feePerKey)
// `expirationOf`: check `till` was set // `expirationOf`: check `till` was set
@ -98,7 +98,7 @@ func TestNotary_Pipeline(t *testing.T) {
notaryCommitteeInvoker.Invoke(t, 2*feePerKey, "balanceOf", multisigHash) notaryCommitteeInvoker.Invoke(t, 2*feePerKey, "balanceOf", multisigHash)
// `onPayment`: good second deposit and explicit `to` paramenter // `onPayment`: good second deposit and explicit `to` paramenter
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, feePerKey, &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock + 1)}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, feePerKey, &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock + 1)})
checkBalanceOf(t, notaryHash, 3*feePerKey) checkBalanceOf(t, notaryHash, 3*feePerKey)
// `balanceOf`: check deposited amount for the multisig account // `balanceOf`: check deposited amount for the multisig account
@ -108,17 +108,17 @@ func TestNotary_Pipeline(t *testing.T) {
notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash)
// `onPayment`: empty payment, should fail because `till` less than the previous one // `onPayment`: empty payment, should fail because `till` less than the previous one
gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the previous value", "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock)}) lubCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the previous value", "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock)})
checkBalanceOf(t, notaryHash, 3*feePerKey) checkBalanceOf(t, notaryHash, 3*feePerKey)
notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash)
// `onPayment`: empty payment, should fail because `till` less than the chain height // `onPayment`: empty payment, should fail because `till` less than the chain height
gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(1)}) lubCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(1)})
checkBalanceOf(t, notaryHash, 3*feePerKey) checkBalanceOf(t, notaryHash, 3*feePerKey)
notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash)
// `onPayment`: empty payment, should successfully update `till` // `onPayment`: empty payment, should successfully update `till`
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock + 2)}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, int64(0), &notary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock + 2)})
checkBalanceOf(t, notaryHash, 3*feePerKey) checkBalanceOf(t, notaryHash, 3*feePerKey)
notaryCommitteeInvoker.Invoke(t, depositLock+2, "expirationOf", multisigHash) notaryCommitteeInvoker.Invoke(t, depositLock+2, "expirationOf", multisigHash)
@ -160,12 +160,12 @@ func TestNotary_Pipeline(t *testing.T) {
notaryCommitteeInvoker.Invoke(t, false, "withdraw", multisigHash, accHash) notaryCommitteeInvoker.Invoke(t, false, "withdraw", multisigHash, accHash)
// `onPayment`: good first deposit to other account, should set default `till` even if other `till` value is provided // `onPayment`: good first deposit to other account, should set default `till` even if other `till` value is provided
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &accHash, Till: uint32(math.MaxUint32 - 1)}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &accHash, Till: uint32(math.MaxUint32 - 1)})
checkBalanceOf(t, notaryHash, 2*feePerKey) checkBalanceOf(t, notaryHash, 2*feePerKey)
notaryCommitteeInvoker.Invoke(t, 5760+e.Chain.BlockHeight()-1, "expirationOf", accHash) notaryCommitteeInvoker.Invoke(t, 5760+e.Chain.BlockHeight()-1, "expirationOf", accHash)
// `onPayment`: good second deposit to other account, shouldn't update `till` even if other `till` value is provided // `onPayment`: good second deposit to other account, shouldn't update `till` even if other `till` value is provided
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, feePerKey, &notary.OnNEP17PaymentData{Account: &accHash, Till: uint32(math.MaxUint32 - 1)}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, feePerKey, &notary.OnNEP17PaymentData{Account: &accHash, Till: uint32(math.MaxUint32 - 1)})
checkBalanceOf(t, notaryHash, 3*feePerKey) checkBalanceOf(t, notaryHash, 3*feePerKey)
notaryCommitteeInvoker.Invoke(t, 5760+e.Chain.BlockHeight()-3, "expirationOf", accHash) notaryCommitteeInvoker.Invoke(t, 5760+e.Chain.BlockHeight()-3, "expirationOf", accHash)
} }
@ -174,7 +174,7 @@ func TestNotary_MaliciousWithdrawal(t *testing.T) {
const defaultDepositDeltaTill = 5760 const defaultDepositDeltaTill = 5760
notaryCommitteeInvoker := newNotaryClient(t) notaryCommitteeInvoker := newNotaryClient(t)
e := notaryCommitteeInvoker.Executor e := notaryCommitteeInvoker.Executor
gasCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) lubCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary) notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary)
feePerKey := e.Chain.GetNotaryServiceFeePerKey() feePerKey := e.Chain.GetNotaryServiceFeePerKey()
@ -191,7 +191,7 @@ func TestNotary_MaliciousWithdrawal(t *testing.T) {
count := 3 count := 3
for range count { for range count {
h := random.Uint160() h := random.Uint160()
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &h, Till: e.Chain.BlockHeight() + 2}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &h, Till: e.Chain.BlockHeight() + 2})
} }
checkBalanceOf(t, notaryHash, int64(count)*2*feePerKey) checkBalanceOf(t, notaryHash, int64(count)*2*feePerKey)
@ -226,7 +226,7 @@ func TestNotary_MaliciousWithdrawal(t *testing.T) {
Methods: manifest.WildStrings{}, Methods: manifest.WildStrings{},
}}}) }}})
e.DeployContract(t, ctr, nil) e.DeployContract(t, ctr, nil)
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &ctr.Hash, Till: e.Chain.BlockHeight() + 2}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, &notary.OnNEP17PaymentData{Account: &ctr.Hash, Till: e.Chain.BlockHeight() + 2})
checkBalanceOf(t, notaryHash, int64(count+1)*2*feePerKey) checkBalanceOf(t, notaryHash, int64(count+1)*2*feePerKey)
depositLock := e.Chain.BlockHeight() + defaultDepositDeltaTill depositLock := e.Chain.BlockHeight() + defaultDepositDeltaTill
@ -241,14 +241,14 @@ func TestNotary_MaliciousWithdrawal(t *testing.T) {
})) }))
maliciousInvoker.Invoke(t, true, "withdraw", ctr.Hash, ctr.Hash) maliciousInvoker.Invoke(t, true, "withdraw", ctr.Hash, ctr.Hash)
checkBalanceOf(t, notaryHash, int64(count)*2*feePerKey) checkBalanceOf(t, notaryHash, int64(count)*2*feePerKey)
gasCommitteeInvoker.CheckGASBalance(t, ctr.Hash, big.NewInt(2*feePerKey)) lubCommitteeInvoker.CheckGASBalance(t, ctr.Hash, big.NewInt(2*feePerKey))
} }
func TestNotary_NotaryNodesReward(t *testing.T) { func TestNotary_NotaryNodesReward(t *testing.T) {
checkReward := func(nKeys int, nNotaryNodes int, spendFullDeposit bool) { checkReward := func(nKeys int, nNotaryNodes int, spendFullDeposit bool) {
notaryCommitteeInvoker := newNotaryClient(t) notaryCommitteeInvoker := newNotaryClient(t)
e := notaryCommitteeInvoker.Executor e := notaryCommitteeInvoker.Executor
gasCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) lubCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
designationCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation)) designationCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation))
notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary) notaryHash := notaryCommitteeInvoker.NativeHash(t, nativenames.Notary)
@ -276,7 +276,7 @@ func TestNotary_NotaryNodesReward(t *testing.T) {
if !spendFullDeposit { if !spendFullDeposit {
depositAmount += 1_0000 depositAmount += 1_0000
} }
gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, depositAmount, &notary.OnNEP17PaymentData{Account: &multisigHash, Till: e.Chain.BlockHeight() + 2}) lubCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, depositAmount, &notary.OnNEP17PaymentData{Account: &multisigHash, Till: e.Chain.BlockHeight() + 2})
// send transaction with Notary contract as a sender // send transaction with Notary contract as a sender
tx := transaction.New([]byte{byte(opcode.PUSH1)}, 1_000_000) tx := transaction.New([]byte{byte(opcode.PUSH1)}, 1_000_000)

View File

@ -52,7 +52,7 @@ func TestOracle_Request(t *testing.T) {
e := oracleCommitteeInvoker.Executor e := oracleCommitteeInvoker.Executor
managementCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Management)) managementCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Management))
designationCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation)) designationCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation))
gasCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Gas)) lubCommitteeInvoker := e.CommitteeInvoker(e.NativeHash(t, nativenames.Lub))
cs := contracts.GetOracleContractState(t, pathToInternalContracts, e.Validator.ScriptHash(), 1) cs := contracts.GetOracleContractState(t, pathToInternalContracts, e.Validator.ScriptHash(), 1)
nBytes, err := cs.NEF.Bytes() nBytes, err := cs.NEF.Bytes()
@ -75,7 +75,7 @@ func TestOracle_Request(t *testing.T) {
err = oracleNode.(neotest.SingleSigner).Account().ConvertMultisig(1, []*keys.PublicKey{oracleNode.(neotest.SingleSigner).Account().PublicKey()}) err = oracleNode.(neotest.SingleSigner).Account().ConvertMultisig(1, []*keys.PublicKey{oracleNode.(neotest.SingleSigner).Account().PublicKey()})
require.NoError(t, err) require.NoError(t, err)
oracleNodeMulti := neotest.NewMultiSigner(oracleNode.(neotest.SingleSigner).Account()) oracleNodeMulti := neotest.NewMultiSigner(oracleNode.(neotest.SingleSigner).Account())
gasCommitteeInvoker.Invoke(t, true, "transfer", gasCommitteeInvoker.CommitteeHash, oracleNodeMulti.ScriptHash(), 100_0000_0000, nil) lubCommitteeInvoker.Invoke(t, true, "transfer", lubCommitteeInvoker.CommitteeHash, oracleNodeMulti.ScriptHash(), 100_0000_0000, nil)
// Finish. // Finish.
prepareResponseTx := func(t *testing.T, requestID uint64) *transaction.Transaction { prepareResponseTx := func(t *testing.T, requestID uint64) *transaction.Transaction {

View File

@ -359,7 +359,7 @@ func TestPolicy_BlockedAccounts(t *testing.T) {
}) })
t.Run("block-unblock contract", func(t *testing.T) { t.Run("block-unblock contract", func(t *testing.T) {
committeeInvoker.InvokeFail(t, "cannot block native contract", "blockAccount", c.NativeHash(t, nativenames.Neo)) committeeInvoker.InvokeFail(t, "cannot block native contract", "blockAccount", c.NativeHash(t, nativenames.Annos))
helper := neotest.CompileFile(t, c.CommitteeHash, "./helpers/policyhelper", "./helpers/policyhelper/policyhelper.yml") helper := neotest.CompileFile(t, c.CommitteeHash, "./helpers/policyhelper", "./helpers/policyhelper/policyhelper.yml")
e.DeployContract(t, helper, nil) e.DeployContract(t, helper, nil)
@ -379,22 +379,22 @@ func TestPolicy_BlockedAccounts(t *testing.T) {
pub := candidate.(neotest.SingleSigner).Account().PublicKey() pub := candidate.(neotest.SingleSigner).Account().PublicKey()
// Transfer some NEO to the account. // Transfer some NEO to the account.
tx := e.NewTx(t, []neotest.Signer{e.Validator}, e.NativeHash(t, nativenames.Neo), "transfer", e.Validator.ScriptHash(), acc.ScriptHash(), 1_000, nil) tx := e.NewTx(t, []neotest.Signer{e.Validator}, e.NativeHash(t, nativenames.Annos), "transfer", e.Validator.ScriptHash(), acc.ScriptHash(), 1_000, nil)
e.AddNewBlock(t, tx) e.AddNewBlock(t, tx)
e.CheckHalt(t, tx.Hash()) e.CheckHalt(t, tx.Hash())
// Register a candidate and vote. // Register a candidate and vote.
g := c.NewInvoker(nativehashes.GasToken, acc, candidate) g := c.NewInvoker(nativehashes.LubToken, acc, candidate)
n := c.NewInvoker(nativehashes.NeoToken, acc) n := c.NewInvoker(nativehashes.AnnosToken, acc)
nCommittee := c.NewInvoker(nativehashes.NeoToken, e.Committee) nCommittee := c.NewInvoker(nativehashes.AnnosToken, e.Committee)
g.Invoke(t, true, "transfer", acc.ScriptHash(), nativehashes.NeoToken, 1000*native.GASFactor, pub.Bytes()) g.Invoke(t, true, "transfer", acc.ScriptHash(), nativehashes.AnnosToken, 1000*native.LubFactor, pub.Bytes())
n.Invoke(t, true, "vote", acc.ScriptHash(), pub.Bytes()) n.Invoke(t, true, "vote", acc.ScriptHash(), pub.Bytes())
n.Invoke(t, 1_000, "getCandidateVote", pub.Bytes()) n.Invoke(t, 1_000, "getCandidateVote", pub.Bytes())
// Block the account and check notification and revoked votes. // Block the account and check notification and revoked votes.
h := committeeInvoker.Invoke(t, true, "blockAccount", acc.ScriptHash()) h := committeeInvoker.Invoke(t, true, "blockAccount", acc.ScriptHash())
e.CheckTxNotificationEvent(t, h, 0, state.NotificationEvent{ e.CheckTxNotificationEvent(t, h, 0, state.NotificationEvent{
ScriptHash: nativehashes.NeoToken, ScriptHash: nativehashes.AnnosToken,
Name: "Vote", Name: "Vote",
Item: stackitem.NewArray([]stackitem.Item{ Item: stackitem.NewArray([]stackitem.Item{
stackitem.Make(acc.ScriptHash()), stackitem.Make(acc.ScriptHash()),

View File

@ -56,7 +56,7 @@ func TestTreasury_Verify(t *testing.T) {
} }
func TestTreasury_OnNEP17Payment(t *testing.T) { func TestTreasury_OnNEP17Payment(t *testing.T) {
g := newCustomNativeClient(t, nativenames.Gas, func(cfg *config.Blockchain) { g := newCustomNativeClient(t, nativenames.Lub, func(cfg *config.Blockchain) {
cfg.Hardforks = map[string]uint32{ cfg.Hardforks = map[string]uint32{
config.HFFaun.String(): 0, config.HFFaun.String(): 0,
} }

View File

@ -17,10 +17,10 @@ var (
CryptoLib = util.Uint160{0x1b, 0xf5, 0x75, 0xab, 0x11, 0x89, 0x68, 0x84, 0x13, 0x61, 0xa, 0x35, 0xa1, 0x28, 0x86, 0xcd, 0xe0, 0xb6, 0x6c, 0x72} CryptoLib = util.Uint160{0x1b, 0xf5, 0x75, 0xab, 0x11, 0x89, 0x68, 0x84, 0x13, 0x61, 0xa, 0x35, 0xa1, 0x28, 0x86, 0xcd, 0xe0, 0xb6, 0x6c, 0x72}
// LedgerContract is a hash of native LedgerContract contract. // LedgerContract is a hash of native LedgerContract contract.
LedgerContract = util.Uint160{0xbe, 0xf2, 0x4, 0x31, 0x40, 0x36, 0x2a, 0x77, 0xc1, 0x50, 0x99, 0xc7, 0xe6, 0x4c, 0x12, 0xf7, 0x0, 0xb6, 0x65, 0xda} LedgerContract = util.Uint160{0xbe, 0xf2, 0x4, 0x31, 0x40, 0x36, 0x2a, 0x77, 0xc1, 0x50, 0x99, 0xc7, 0xe6, 0x4c, 0x12, 0xf7, 0x0, 0xb6, 0x65, 0xda}
// NeoToken is a hash of native NeoToken contract. // AnnosToken is a hash of native AnnosToken contract.
NeoToken = util.Uint160{0xf5, 0x63, 0xea, 0x40, 0xbc, 0x28, 0x3d, 0x4d, 0xe, 0x5, 0xc4, 0x8e, 0xa3, 0x5, 0xb3, 0xf2, 0xa0, 0x73, 0x40, 0xef} AnnosToken = util.Uint160{0xf0, 0xf8, 0x1, 0x65, 0x48, 0x2c, 0x87, 0x9e, 0x15, 0xb0, 0x49, 0x5, 0xf1, 0x3f, 0xe8, 0x75, 0x46, 0x3e, 0x9b, 0x24}
// GasToken is a hash of native GasToken contract. // LubToken is a hash of native LubToken contract.
GasToken = util.Uint160{0xcf, 0x76, 0xe2, 0x8b, 0xd0, 0x6, 0x2c, 0x4a, 0x47, 0x8e, 0xe3, 0x55, 0x61, 0x1, 0x13, 0x19, 0xf3, 0xcf, 0xa4, 0xd2} LubToken = util.Uint160{0x69, 0xe8, 0x15, 0x86, 0x5e, 0xaa, 0x14, 0x6f, 0xdd, 0x64, 0x79, 0xd4, 0xa3, 0x57, 0xf0, 0x70, 0x93, 0xbb, 0x95, 0xe8}
// PolicyContract is a hash of native PolicyContract contract. // PolicyContract is a hash of native PolicyContract contract.
PolicyContract = util.Uint160{0x7b, 0xc6, 0x81, 0xc0, 0xa1, 0xf7, 0x1d, 0x54, 0x34, 0x57, 0xb6, 0x8b, 0xba, 0x8d, 0x5f, 0x9f, 0xdd, 0x4e, 0x5e, 0xcc} PolicyContract = util.Uint160{0x7b, 0xc6, 0x81, 0xc0, 0xa1, 0xf7, 0x1d, 0x54, 0x34, 0x57, 0xb6, 0x8b, 0xba, 0x8d, 0x5f, 0x9f, 0xdd, 0x4e, 0x5e, 0xcc}
// RoleManagement is a hash of native RoleManagement contract. // RoleManagement is a hash of native RoleManagement contract.

View File

@ -15,10 +15,10 @@ const (
CryptoLib int32 = -3 CryptoLib int32 = -3
// LedgerContract is an ID of native LedgerContract contract. // LedgerContract is an ID of native LedgerContract contract.
LedgerContract int32 = -4 LedgerContract int32 = -4
// NeoToken is an ID of native NeoToken contract. // Annos is an ID of native AnnosToken contract.
NeoToken int32 = -5 Annos int32 = -5
// GasToken is an ID of native GasToken contract. // Lub is an ID of native LubToken contract.
GasToken int32 = -6 Lub int32 = -6
// PolicyContract is an ID of native PolicyContract contract. // PolicyContract is an ID of native PolicyContract contract.
PolicyContract int32 = -7 PolicyContract int32 = -7
// RoleManagement is an ID of native RoleManagement contract. // RoleManagement is an ID of native RoleManagement contract.

View File

@ -4,8 +4,8 @@ package nativenames
const ( const (
Management = "ContractManagement" Management = "ContractManagement"
Ledger = "LedgerContract" Ledger = "LedgerContract"
Neo = "NeoToken" Annos = "AnnosToken"
Gas = "GasToken" Lub = "LubToken"
Policy = "PolicyContract" Policy = "PolicyContract"
Oracle = "OracleContract" Oracle = "OracleContract"
Designation = "RoleManagement" Designation = "RoleManagement"
@ -35,8 +35,8 @@ var All = []string{
StdLib, StdLib,
CryptoLib, CryptoLib,
Ledger, Ledger,
Neo, Annos,
Gas, Lub,
Policy, Policy,
Designation, Designation,
Oracle, Oracle,
@ -62,8 +62,8 @@ var All = []string{
func IsValid(name string) bool { func IsValid(name string) bool {
return name == Management || return name == Management ||
name == Ledger || name == Ledger ||
name == Neo || name == Annos ||
name == Gas || name == Lub ||
name == Policy || name == Policy ||
name == Oracle || name == Oracle ||
name == Designation || name == Designation ||

View File

@ -30,8 +30,8 @@ import (
// Notary represents Notary native contract. // Notary represents Notary native contract.
type Notary struct { type Notary struct {
interop.ContractMD interop.ContractMD
GAS IGAS Lub ILub
NEO INEO Annos IAnnos
Desig IDesignate Desig IDesignate
Policy IPolicy Policy IPolicy
} }
@ -199,7 +199,7 @@ func (n *Notary) OnPersist(ic *interop.Context) error {
feePerKey := n.Policy.GetAttributeFeeInternal(ic.DAO, transaction.NotaryAssistedT) feePerKey := n.Policy.GetAttributeFeeInternal(ic.DAO, transaction.NotaryAssistedT)
singleReward := calculateNotaryReward(nFees, feePerKey, len(notaries)) singleReward := calculateNotaryReward(nFees, feePerKey, len(notaries))
for _, notary := range notaries { for _, notary := range notaries {
n.GAS.Mint(ic, notary.GetScriptHash(), singleReward, false) n.Lub.Mint(ic, notary.GetScriptHash(), singleReward, false)
} }
return nil return nil
} }
@ -217,8 +217,8 @@ func (n *Notary) ActiveIn() *config.Hardfork {
// onPayment records the deposited amount as belonging to "from" address with a lock // onPayment records the deposited amount as belonging to "from" address with a lock
// till the specified chain's height. // till the specified chain's height.
func (n *Notary) onPayment(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (n *Notary) onPayment(ic *interop.Context, args []stackitem.Item) stackitem.Item {
if h := ic.VM.GetCallingScriptHash(); h != n.GAS.Metadata().Hash { if h := ic.VM.GetCallingScriptHash(); h != n.Lub.Metadata().Hash {
panic(fmt.Errorf("only GAS can be accepted for deposit, got %s", h.StringBE())) panic(fmt.Errorf("only Lub can be accepted for deposit, got %s", h.StringBE()))
} }
from := toUint160(args[0]) from := toUint160(args[0])
to := from to := from
@ -316,9 +316,9 @@ func (n *Notary) withdraw(ic *interop.Context, args []stackitem.Item) stackitem.
if ic.BlockHeight() < deposit.Till { if ic.BlockHeight() < deposit.Till {
return stackitem.NewBool(false) return stackitem.NewBool(false)
} }
cs, err := ic.GetContract(n.GAS.Metadata().Hash) cs, err := ic.GetContract(n.Lub.Metadata().Hash)
if err != nil { if err != nil {
panic(fmt.Errorf("failed to get GAS contract state: %w", err)) panic(fmt.Errorf("failed to get Lub contract state: %w", err))
} }
// Remove deposit before GAS transfer processing to avoid double-withdrawal. // Remove deposit before GAS transfer processing to avoid double-withdrawal.
@ -434,7 +434,7 @@ func (n *Notary) setMaxNotValidBeforeDelta(ic *interop.Context, args []stackitem
if value > maxInc/2 || value < uint32(cfg.GetNumOfCNs(ic.BlockHeight())) { if value > maxInc/2 || value < uint32(cfg.GetNumOfCNs(ic.BlockHeight())) {
panic(fmt.Errorf("MaxNotValidBeforeDelta cannot be more than %d or less than %d", maxInc/2, cfg.GetNumOfCNs(ic.BlockHeight()))) panic(fmt.Errorf("MaxNotValidBeforeDelta cannot be more than %d or less than %d", maxInc/2, cfg.GetNumOfCNs(ic.BlockHeight())))
} }
if !n.NEO.CheckCommittee(ic) { if !n.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(n.ID, ic.DAO, maxNotValidBeforeDeltaKey, int64(value)) setIntWithKey(n.ID, ic.DAO, maxNotValidBeforeDeltaKey, int64(value))

View File

@ -22,7 +22,7 @@ import (
// Opus represents the AI workforce integration native contract. // Opus represents the AI workforce integration native contract.
type Opus struct { type Opus struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
VTS IVTS VTS IVTS
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
@ -129,7 +129,7 @@ func (o *Opus) checkCommittee(ic *interop.Context) bool {
if o.RoleRegistry != nil { if o.RoleRegistry != nil {
return o.RoleRegistry.CheckCommittee(ic) return o.RoleRegistry.CheckCommittee(ic)
} }
return o.NEO.CheckCommittee(ic) return o.Annos.CheckCommittee(ic)
} }
// checkOpusSupervisor checks if the caller has opus supervisor authority. // checkOpusSupervisor checks if the caller has opus supervisor authority.

View File

@ -33,8 +33,8 @@ import (
// Oracle represents Oracle native contract. // Oracle represents Oracle native contract.
type Oracle struct { type Oracle struct {
interop.ContractMD interop.ContractMD
GAS IGAS Lub ILub
NEO INEO Annos IAnnos
Desig IDesignate Desig IDesignate
oracleScript []byte oracleScript []byte
@ -231,7 +231,7 @@ func (o *Oracle) PostPersist(ic *interop.Context) error {
} }
} }
for i := range reward { for i := range reward {
o.GAS.Mint(ic, nodes[i].GetScriptHash(), &reward[i], false) o.Lub.Mint(ic, nodes[i].GetScriptHash(), &reward[i], false)
} }
if len(removedIDs) != 0 { if len(removedIDs) != 0 {
@ -402,7 +402,7 @@ func (o *Oracle) RequestInternal(ic *interop.Context, url string, filter *string
return ErrNotEnoughGas return ErrNotEnoughGas
} }
callingHash := ic.VM.GetCallingScriptHash() callingHash := ic.VM.GetCallingScriptHash()
o.GAS.Mint(ic, o.Hash, gas, false) o.Lub.Mint(ic, o.Hash, gas, false)
si := ic.DAO.GetStorageItem(o.ID, prefixRequestID) si := ic.DAO.GetStorageItem(o.ID, prefixRequestID)
itemID := bigint.FromBytes(si) itemID := bigint.FromBytes(si)
id := itemID.Uint64() id := itemID.Uint64()
@ -518,7 +518,7 @@ func (o *Oracle) setPrice(ic *interop.Context, args []stackitem.Item) stackitem.
if price.Sign() <= 0 || !price.IsInt64() { if price.Sign() <= 0 || !price.IsInt64() {
panic("invalid register price") panic("invalid register price")
} }
if !o.NEO.CheckCommittee(ic) { if !o.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(o.ID, ic.DAO, prefixRequestPrice, price.Int64()) setIntWithKey(o.ID, ic.DAO, prefixRequestPrice, price.Int64())

View File

@ -25,7 +25,7 @@ import (
// transaction flows with judicial declassification. // transaction flows with judicial declassification.
type Palam struct { type Palam struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex

View File

@ -80,7 +80,7 @@ var (
// Policy represents Policy native contract. // Policy represents Policy native contract.
type Policy struct { type Policy struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
} }
type PolicyCache struct { type PolicyCache struct {
@ -503,7 +503,7 @@ func (p *Policy) setExecFeeFactor(ic *interop.Context, args []stackitem.Item) st
if value <= 0 || maxValue < value { if value <= 0 || maxValue < value {
panic(fmt.Errorf("ExecFeeFactor must be between 1 and %d", maxExecFeeFactor)) panic(fmt.Errorf("ExecFeeFactor must be between 1 and %d", maxExecFeeFactor))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, execFeeFactorKey, int64(value)) setIntWithKey(p.ID, ic.DAO, execFeeFactorKey, int64(value))
@ -555,7 +555,7 @@ func (p *Policy) setStoragePrice(ic *interop.Context, args []stackitem.Item) sta
if value <= 0 || maxStoragePrice < value { if value <= 0 || maxStoragePrice < value {
panic(fmt.Errorf("StoragePrice must be between 1 and %d", maxStoragePrice)) panic(fmt.Errorf("StoragePrice must be between 1 and %d", maxStoragePrice))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, storagePriceKey, int64(value)) setIntWithKey(p.ID, ic.DAO, storagePriceKey, int64(value))
@ -616,7 +616,7 @@ func (p *Policy) setAttributeFeeGeneric(ic *interop.Context, args []stackitem.It
if value > maxAttributeFee { if value > maxAttributeFee {
panic(fmt.Errorf("attribute value is out of range: %d", value)) panic(fmt.Errorf("attribute value is out of range: %d", value))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, []byte{attributeFeePrefix, byte(t)}, int64(value)) setIntWithKey(p.ID, ic.DAO, []byte{attributeFeePrefix, byte(t)}, int64(value))
@ -631,7 +631,7 @@ func (p *Policy) setFeePerByte(ic *interop.Context, args []stackitem.Item) stack
if value < 0 || value > maxFeePerByte { if value < 0 || value > maxFeePerByte {
panic(fmt.Errorf("FeePerByte shouldn't be negative or greater than %d", maxFeePerByte)) panic(fmt.Errorf("FeePerByte shouldn't be negative or greater than %d", maxFeePerByte))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, feePerByteKey, value) setIntWithKey(p.ID, ic.DAO, feePerByteKey, value)
@ -643,7 +643,7 @@ func (p *Policy) setFeePerByte(ic *interop.Context, args []stackitem.Item) stack
// blockAccount is a Policy contract method that adds the given account hash to the list // blockAccount is a Policy contract method that adds the given account hash to the list
// of blocked accounts. // of blocked accounts.
func (p *Policy) blockAccount(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Policy) blockAccount(ic *interop.Context, args []stackitem.Item) stackitem.Item {
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
hash := toUint160(args[0]) hash := toUint160(args[0])
@ -660,7 +660,7 @@ func (p *Policy) BlockAccountInternal(ic *interop.Context, hash util.Uint160) bo
if blocked { if blocked {
return false return false
} }
var _ = p.NEO.RevokeVotes(ic, hash) // ignore error, as in the reference. var _ = p.Annos.RevokeVotes(ic, hash) // ignore error, as in the reference.
key := append([]byte{blockedAccountPrefix}, hash.BytesBE()...) key := append([]byte{blockedAccountPrefix}, hash.BytesBE()...)
ic.DAO.PutStorageItem(p.ID, key, state.StorageItem{}) ic.DAO.PutStorageItem(p.ID, key, state.StorageItem{})
cache := ic.DAO.GetRWCache(p.ID).(*PolicyCache) cache := ic.DAO.GetRWCache(p.ID).(*PolicyCache)
@ -676,7 +676,7 @@ func (p *Policy) BlockAccountInternal(ic *interop.Context, hash util.Uint160) bo
// unblockAccount is a Policy contract method that removes the given account hash from // unblockAccount is a Policy contract method that removes the given account hash from
// the list of blocked accounts. // the list of blocked accounts.
func (p *Policy) unblockAccount(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Policy) unblockAccount(ic *interop.Context, args []stackitem.Item) stackitem.Item {
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
hash := toUint160(args[0]) hash := toUint160(args[0])
@ -721,7 +721,7 @@ func (p *Policy) setMaxValidUntilBlockIncrement(ic *interop.Context, args []stac
if value >= mtb { if value >= mtb {
panic(fmt.Errorf("MaxValidUntilBlockIncrement should be less than MaxTraceableBlocks %d, got %d", mtb, value)) panic(fmt.Errorf("MaxValidUntilBlockIncrement should be less than MaxTraceableBlocks %d, got %d", mtb, value))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, maxVUBIncrementKey, int64(value)) setIntWithKey(p.ID, ic.DAO, maxVUBIncrementKey, int64(value))
@ -746,7 +746,7 @@ func (p *Policy) setMillisecondsPerBlock(ic *interop.Context, args []stackitem.I
if value <= 0 || maxMillisecondsPerBlock < value { if value <= 0 || maxMillisecondsPerBlock < value {
panic(fmt.Errorf("MillisecondsPerBlock should be positive and not greater than %d, got %d", maxMillisecondsPerBlock, value)) panic(fmt.Errorf("MillisecondsPerBlock should be positive and not greater than %d, got %d", maxMillisecondsPerBlock, value))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
setIntWithKey(p.ID, ic.DAO, msPerBlockKey, int64(value)) setIntWithKey(p.ID, ic.DAO, msPerBlockKey, int64(value))
@ -788,7 +788,7 @@ func (p *Policy) setMaxTraceableBlocks(ic *interop.Context, args []stackitem.Ite
if value <= maxVUBInc { if value <= maxVUBInc {
panic(fmt.Errorf("MaxTraceableBlocks should be larger than MaxValidUntilBlockIncrement %d, got %d", maxVUBInc, value)) panic(fmt.Errorf("MaxTraceableBlocks should be larger than MaxValidUntilBlockIncrement %d, got %d", maxVUBInc, value))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
@ -862,7 +862,7 @@ func (p *Policy) CleanWhitelist(ic *interop.Context, cs *state.Contract) error {
} }
func (p *Policy) removeWhitelistFeeContract(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Policy) removeWhitelistFeeContract(ic *interop.Context, args []stackitem.Item) stackitem.Item {
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }
h := toUint160(args[0]) h := toUint160(args[0])
@ -911,7 +911,7 @@ func (p *Policy) setWhitelistFeeContract(ic *interop.Context, args []stackitem.I
if fee < 0 { if fee < 0 {
panic(fmt.Errorf("fee should be positive, got %d", fee)) panic(fmt.Errorf("fee should be positive, got %d", fee))
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
} }

View File

@ -26,7 +26,7 @@ import (
// - Education and healthcare credential portability // - Education and healthcare credential portability
type Pons struct { type Pons struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
Federation *Federation Federation *Federation
RoleRegistry *RoleRegistry RoleRegistry *RoleRegistry
@ -739,7 +739,7 @@ func (p *Pons) getConfig(ic *interop.Context, _ []stackitem.Item) stackitem.Item
func (p *Pons) setLocalChainID(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Pons) setLocalChainID(ic *interop.Context, args []stackitem.Item) stackitem.Item {
chainID := uint32(toBigInt(args[0]).Int64()) chainID := uint32(toBigInt(args[0]).Int64())
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("only committee can set chain ID") panic("only committee can set chain ID")
} }
@ -763,7 +763,7 @@ func (p *Pons) createAgreement(ic *interop.Context, args []stackitem.Item) stack
} }
expirationHeight := uint32(toBigInt(args[3]).Int64()) expirationHeight := uint32(toBigInt(args[3]).Int64())
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("only committee can create agreements") panic("only committee can create agreements")
} }
@ -802,7 +802,7 @@ func (p *Pons) updateAgreementStatus(ic *interop.Context, args []stackitem.Item)
agreementID := toBigInt(args[0]).Uint64() agreementID := toBigInt(args[0]).Uint64()
newStatus := state.AgreementStatus(toBigInt(args[1]).Int64()) newStatus := state.AgreementStatus(toBigInt(args[1]).Int64())
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("only committee can update agreement status") panic("only committee can update agreement status")
} }
@ -930,7 +930,7 @@ func (p *Pons) respondVerification(ic *interop.Context, args []stackitem.Item) s
panic(err) panic(err)
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("only committee can respond to verification requests") panic("only committee can respond to verification requests")
} }
@ -1041,7 +1041,7 @@ func (p *Pons) completeSettlement(ic *interop.Context, args []stackitem.Item) st
panic(err) panic(err)
} }
if !p.NEO.CheckCommittee(ic) { if !p.Annos.CheckCommittee(ic) {
panic("only committee can complete settlements") panic("only committee can complete settlements")
} }
@ -1081,7 +1081,7 @@ func (p *Pons) cancelSettlement(ic *interop.Context, args []stackitem.Item) stac
// Allow sender or committee to cancel // Allow sender or committee to cancel
caller := ic.VM.GetCallingScriptHash() caller := ic.VM.GetCallingScriptHash()
if !caller.Equals(sr.Sender) && !p.NEO.CheckCommittee(ic) { if !caller.Equals(sr.Sender) && !p.Annos.CheckCommittee(ic) {
panic("only sender or committee can cancel settlement") panic("only sender or committee can cancel settlement")
} }
@ -1183,7 +1183,7 @@ func (p *Pons) revokeCredentialShare(ic *interop.Context, args []stackitem.Item)
// Allow owner or committee to revoke // Allow owner or committee to revoke
caller := ic.VM.GetCallingScriptHash() caller := ic.VM.GetCallingScriptHash()
if !caller.Equals(cs.Owner) && !p.NEO.CheckCommittee(ic) { if !caller.Equals(cs.Owner) && !p.Annos.CheckCommittee(ic) {
panic(ErrNotCredentialOwner) panic(ErrNotCredentialOwner)
} }

View File

@ -26,8 +26,8 @@ import (
type RoleRegistry struct { type RoleRegistry struct {
interop.ContractMD interop.ContractMD
// NEO is used for fallback committee checks when TutusCommittee is not set. // Annos is used for fallback committee checks when TutusCommittee is not set.
NEO INEO Annos IAnnos
// tutusCommittee contains initial committee member addresses from config. // tutusCommittee contains initial committee member addresses from config.
tutusCommittee []util.Uint160 tutusCommittee []util.Uint160
@ -357,9 +357,9 @@ func (r *RoleRegistry) CheckCommittee(ic *interop.Context) bool {
} }
} }
// Fallback to NEO.CheckCommittee for backwards compatibility // Fallback to Annos.CheckCommittee for backwards compatibility
// This allows StandbyCommittee to work when TutusCommittee is not configured // This allows StandbyCommittee to work when TutusCommittee is not configured
if r.NEO != nil && r.NEO.CheckCommittee(ic) { if r.Annos != nil && r.Annos.CheckCommittee(ic) {
return true return true
} }
@ -382,9 +382,9 @@ func (r *RoleRegistry) checkCommitteeWitness(ic *interop.Context) error {
return nil return nil
} }
} }
// Fallback to NEO.CheckCommittee for backwards compatibility // Fallback to Annos.CheckCommittee for backwards compatibility
// This allows StandbyCommittee to work when TutusCommittee is not configured // This allows StandbyCommittee to work when TutusCommittee is not configured
if r.NEO != nil && r.NEO.CheckCommittee(ic) { if r.Annos != nil && r.Annos.CheckCommittee(ic) {
return nil return nil
} }
return ErrRoleRegistryNotCommittee return ErrRoleRegistryNotCommittee

View File

@ -21,7 +21,7 @@ import (
// Salus represents the universal healthcare native contract. // Salus represents the universal healthcare native contract.
type Salus struct { type Salus struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex
@ -129,7 +129,7 @@ func (s *Salus) checkCommittee(ic *interop.Context) bool {
if s.RoleRegistry != nil { if s.RoleRegistry != nil {
return s.RoleRegistry.CheckCommittee(ic) return s.RoleRegistry.CheckCommittee(ic)
} }
return s.NEO.CheckCommittee(ic) return s.Annos.CheckCommittee(ic)
} }
// checkHealthcareProvider checks if the caller has healthcare provider authority. // checkHealthcareProvider checks if the caller has healthcare provider authority.

View File

@ -22,7 +22,7 @@ import (
// Scire represents the universal education native contract. // Scire represents the universal education native contract.
type Scire struct { type Scire struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex
@ -118,7 +118,7 @@ func (s *Scire) checkCommittee(ic *interop.Context) bool {
if s.RoleRegistry != nil { if s.RoleRegistry != nil {
return s.RoleRegistry.CheckCommittee(ic) return s.RoleRegistry.CheckCommittee(ic)
} }
return s.NEO.CheckCommittee(ic) return s.Annos.CheckCommittee(ic)
} }
// checkEducator checks if the caller has educator authority. // checkEducator checks if the caller has educator authority.

View File

@ -21,7 +21,7 @@ import (
// Sese represents the life planning native contract. // Sese represents the life planning native contract.
type Sese struct { type Sese struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex
@ -134,7 +134,7 @@ func (s *Sese) checkCommittee(ic *interop.Context) bool {
if s.RoleRegistry != nil { if s.RoleRegistry != nil {
return s.RoleRegistry.CheckCommittee(ic) return s.RoleRegistry.CheckCommittee(ic)
} }
return s.NEO.CheckCommittee(ic) return s.Annos.CheckCommittee(ic)
} }
// checkLifePlanner checks if the caller has life planner authority. // checkLifePlanner checks if the caller has life planner authority.

View File

@ -18,7 +18,7 @@ import (
// Treasury represents Treasury native contract. // Treasury represents Treasury native contract.
type Treasury struct { type Treasury struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
} }
// Storage key prefixes for Treasury. // Storage key prefixes for Treasury.
@ -90,7 +90,7 @@ func (t *Treasury) ActiveIn() *config.Hardfork {
} }
func (t *Treasury) verify(ic *interop.Context, _ []stackitem.Item) stackitem.Item { func (t *Treasury) verify(ic *interop.Context, _ []stackitem.Item) stackitem.Item {
return stackitem.NewBool(t.NEO.CheckCommittee(ic)) return stackitem.NewBool(t.Annos.CheckCommittee(ic))
} }
func (t *Treasury) onNEP11Payment(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (t *Treasury) onNEP11Payment(ic *interop.Context, args []stackitem.Item) stackitem.Item {

View File

@ -22,7 +22,7 @@ import (
// Tribute represents the anti-hoarding economics native contract. // Tribute represents the anti-hoarding economics native contract.
type Tribute struct { type Tribute struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
Vita IVita Vita IVita
VTS IVTS VTS IVTS
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
@ -120,7 +120,7 @@ func (t *Tribute) checkCommittee(ic *interop.Context) bool {
if t.RoleRegistry != nil { if t.RoleRegistry != nil {
return t.RoleRegistry.CheckCommittee(ic) return t.RoleRegistry.CheckCommittee(ic)
} }
return t.NEO.CheckCommittee(ic) return t.Annos.CheckCommittee(ic)
} }
// checkTributeAdmin checks if the caller has tribute admin authority. // checkTributeAdmin checks if the caller has tribute admin authority.

View File

@ -25,7 +25,7 @@ import (
// Vita represents a soul-bound identity native contract. // Vita represents a soul-bound identity native contract.
type Vita struct { type Vita struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Lex ILex Lex ILex
} }
@ -137,8 +137,8 @@ func (v *Vita) checkCommittee(ic *interop.Context) bool {
if v.RoleRegistry != nil { if v.RoleRegistry != nil {
return v.RoleRegistry.CheckCommittee(ic) return v.RoleRegistry.CheckCommittee(ic)
} }
// Fallback to NEO for backwards compatibility // Fallback to Annos for backwards compatibility
return v.NEO.CheckCommittee(ic) return v.Annos.CheckCommittee(ic)
} }
// newVita creates a new Vita native contract. // newVita creates a new Vita native contract.

View File

@ -39,7 +39,7 @@ const VTSFactor = 100000000
type VTS struct { type VTS struct {
interop.ContractMD interop.ContractMD
NEO INEO Annos IAnnos
RoleRegistry IRoleRegistry RoleRegistry IRoleRegistry
Vita IVita Vita IVita
Lex ILex Lex ILex
@ -397,8 +397,8 @@ func (v *VTS) checkCommittee(ic *interop.Context) bool {
if v.RoleRegistry != nil { if v.RoleRegistry != nil {
return v.RoleRegistry.CheckCommittee(ic) return v.RoleRegistry.CheckCommittee(ic)
} }
if v.NEO != nil { if v.Annos != nil {
return v.NEO.CheckCommittee(ic) return v.Annos.CheckCommittee(ic)
} }
return false return false
} }

View File

@ -129,7 +129,7 @@ func (e *Executor) NewAccount(t testing.TB, expectedGASBalance ...int64) Signer
amount = expectedGASBalance[0] amount = expectedGASBalance[0]
} }
tx := e.NewTx(t, []Signer{e.Validator}, tx := e.NewTx(t, []Signer{e.Validator},
e.NativeHash(t, nativenames.Gas), "transfer", e.NativeHash(t, nativenames.Lub), "transfer",
e.Validator.ScriptHash(), acc.Contract.ScriptHash(), amount, nil) e.Validator.ScriptHash(), acc.Contract.ScriptHash(), amount, nil)
e.AddNewBlock(t, tx) e.AddNewBlock(t, tx)
e.CheckHalt(t, tx.Hash()) e.CheckHalt(t, tx.Hash())

View File

@ -13,7 +13,7 @@ import (
) )
// Hash stores the hash of the native GAS contract. // Hash stores the hash of the native GAS contract.
var Hash = nativehashes.GasToken var Hash = nativehashes.LubToken
// NewReader creates a NEP-17 reader for the GAS contract. // NewReader creates a NEP-17 reader for the GAS contract.
func NewReader(invoker nep17.Invoker) *nep17.TokenReader { func NewReader(invoker nep17.Invoker) *nep17.TokenReader {

View File

@ -97,7 +97,7 @@ type ValidatorIterator struct {
} }
// Hash stores the hash of the native NEOToken contract. // Hash stores the hash of the native NEOToken contract.
var Hash = nativehashes.NeoToken var Hash = nativehashes.AnnosToken
// NewReader creates an instance of ContractReader to get data from the NEO // NewReader creates an instance of ContractReader to get data from the NEO
// contract. // contract.