0

In some scenarios, It's convenient to configure the conditions for monitoring some certain transactions by using this method

extern "C" {
    void apply(uint64_t receiver, uint64_t code, uint64_t action) {
        if(code==receiver)
        {
            switch(action)
            {
                EOSIO_DISPATCH_HELPER( token, (transfer))
            }
        }else if (code=="eosio.token"_n.value){
            execute_action( name(receiver), name(code), &token::invite);
        }
    }
};

Is there any methods to change the condition like "eosio.token" in this code dynamically ? Maybe It's a basic cpp programming problem. but i have failed to find the solution from the internet.

1 Answer 1

0

You can't access contract-level variables from within extern "C" { void apply(..) }" which is a dispatcher-function and external - executed in a different scope/context than functions on contract-level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.