WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.
This repository was archived by the owner on May 18, 2019. It is now read-only.

ExecutionEngine.callingScriptHash() problem return value #12

@sjoerd-dijkstra

Description

@sjoerd-dijkstra

Dear devs,

When calling ExecutionEngine.callingScriptHash() from org.neo.smartcontract.framework.services.system we are experiencing a problem when verifying another smart contract.

When the function is called in Main(), it gives the correct smart contract caller hash. Like so:

public class Token extends SmartContract{

    // main
    public static Object Main(String operation, Object[] args) {

        // correct hash 
        byte[] caller = (byte[]) ExecutionEngine.callingScriptHash();

    }

}

However, when calling the script from a nested function in Main(), for example someFunction() that returns a boolean is gives a different and incorrect hash when the script is called. Like so:

public class Token extends SmartContract{

    // some function
    public static boolean someFuntion() {

        // wrong and different hash!
        byte[] caller = (byte[]) ExecutionEngine.callingScriptHash(); //  < ----

        return true;
    }

    // main
    public static Object Main(String operation, Object[] args) {

        // function call
        someFuntion();

    }

}

Could you help me? How can we avoid this situation? I can provide more info. We can not verify a script now. Are we doing something wrong maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions