How to call Contract from other contract using Interface

I made this interface form my first contract let say Contract1 and now I am trying to call this contract using other contract let say Contract2 by

IContract1 Contract1 = IContract1(TUVXi6oCYEy3mya2UxBBMBMc1A4G5Hqdpk);
TRC721 Contract1 = TRC721(TUVXi6oCYEy3mya2UxBBMBMc1A4G5Hqdpk);


Here is the error

Yes I also tried with “” for these address

22 Likes

I also converted them to hex using

` ``
tronWeb.address.toHex(“TVm22VuHmhxAuxN9f1LfpmrJTWS8aAYG9R”)
‘41d9145cce52d386f254917e481eb44e9943f39138’

1 Like

maybe it need to be storage or memory :thinking:

But I mean in ETH solidity this works fine

seems like address are weird, normally we have address start with 0x

Damn I found the answer hope it help full to others, so address should be start from 0x and I don’t how to create such address from TVm22VuHmhxAuxN9f1LfpmrJTWS8aAYG9R to 0x address

but if you are using IDE and call ownerOf function it returns 0x so first I transfer the nft to the contract and check the ownerOf for that tokenId and volia got the address

1 Like

You can transfer between Base58 and Hex here Tron Tool Base58check To Hex

3 Likes

Thanks Yeah I use that above method lol spent 2 hrs on this developer life haha

2 Likes

I see…about the wallet address! Can it really go through without starting with the Ox?

1 Like

If you are asking that do we need 0x address within contract then Yes

1 Like

I try to follow you :grimacing::+1:

1 Like

still havent found whats missing?

1 Like

I really like this step but it’s not easy to achieve it

Check stack overflow

Thank you so much guys for loving this question and remember there are answer to this in below replies and feel free to tag me in case you need any help in Tron I am pretty comfortable with Tron