Contract invocation contract problem

I have a problem, I now have a deployed AEX9 protocol token running
Now I want to create a new smart contract, how to write if I want to call the method in the previously deployed contract (AEX9)?

I think @hanssv.chain can help you.THX

Hi @Baixin
Have you looked at remote contract calls? I believe this is what you’re looking for :slight_smile:

1 Like

Maybe this will help you

1 Like

TokenContract Where did it come from?

How does he know which AEX9 contract I’m calling?

as you can see from the code it is passed as an argument

// A contract type
contract TokenContract =
  entrypoint meta_info : () => unit
contract TokenTest =

 record state = {
        index : int, 
        map_hamsters : map(string, string), 
        testvalue: int}
 stateful entrypoint init() = 
        { index = 1,
            map_hamsters = {},
            testvalue = 42}

 entrypoint test(v : TokenContract)  = 

 entrypoint test2(v : TokenContract)  = 

I get the general idea, but I’m returning an error, am I calling it the wrong way

Type of remote function does not match expected type\

that doesn’t return unit according to the interface

1 Like

Thank you for solving my problem

1 Like