Hello All,
I am trying to use the AEX-141 NFT standard for one of the projects that I am building.(here is the SC link from aeternity - aex141-examples/base_nft.aes at dev · aeternity/aex141-examples · GitHub).
My requirement is to interact with the deployed nft contract(whose address is passed in as a param) to my base contract and my base contract(a marketplace sortof) be controlling the nft’s ownership and other attributes.
But when I am making a intercontract contract call(my base contract to already deployed nft contract), I am getting an exception shown below.
Here is my base contract:
@compiler >= 6
include "String.aes"
include "Option.aes"
include "List.aes"
include "core/interfaces.aes"
payable contract SampleNFTInterContract =
function tokensTransferable(_token : NFT, _tokenId : int) : bool =
require(_token.is_approved_for_all(Call.caller, Contract.address) == true, "The HTLC contract must have been designated as an approved spender for the token")
true
public payable stateful entrypoint newContract(_tokenContract: NFT, _tokenId : int) : int =
tokensTransferable(_tokenContract, _tokenId)
What can be reason for this exception? How do I make the inter-contract call?
The error means that you have contract A that calls contract B and then contract B calls back into contract A - this is not allowed in Sophia/FATE.
1 Like
Hi @hanssv.chain ,
in my contract B(NFT Contract), I am not making any other inter-contract calls.
My contract A from where I am trying to invoke B is the only inter-contract call and I am sure of it.
Given the situation, what do you think would be causing this?
You asked what the error meant, and I explained that. I have not looked at your particular example and I have no insight there, sorry.
1 Like
Maybe @zkvonsnarkenstein.chain could help here as this is an AEX-141 contract?
I don’t think that this is a bug with the AEX-141 contract. @hanssv.chain already explained the cause of this error. The contracts seem to be calling each other and that’s not allowed. Since I only see a tiny snippet of the code, it’s not possible to determine where this happens exactly.
4 Likes
@Jkrish1011 that might indeed have been an issue with the initial state of the standard where this scenario has not been covered.
this is why transfer_to_contract entrypoint has been introduced, see AEXs/aex-141.md at master · aeternity/AEXs · GitHub
here a simple marketplace implementation that makes use of it:
just discovered this old thread and maybe the info is helpful to somebody out there 
2 Likes
@marco.chain Thanks for your input.
I will have a look at the latest AEX-141 standard do the necessary changes as needed.
thanks again!
2 Likes
This error usually comes up in Sophia when the inter-contract call isn’t set up with the right interface or when you’re hitting reentrancy restrictions. In AEX-141, the NFT contract functions you’re calling need to be explicitly defined in your interface file, and you need to make sure you’re passing the contract address correctly. One common fix is double-checking the NFT type alias you’re importing and making sure the call is structured through that interface instead of directly.
Another gotcha: Sophia requires that inter-contract calls don’t trigger state changes that loop back into the caller contract (that’s where the “Reentrant call” part comes from). Sometimes wrapping the call in a pure/read-only check first or restructuring ownership logic in the marketplace contract helps.
Looking back now, it’s interesting how these early struggles with inter-contract calls mirror what’s happening in bigger ecosystems: we’re moving toward higher-level, ready-made solutions rather than debugging low-level mechanics forever. For example, in the communications world, ActiveCalls cloud-based call center software solves the same kind of headache — instead of writing complex routing and ownership logic yourself, you just plug into their APIs and let the managed infrastructure handle it.
Did you end up solving this by sticking to AEX-141, or did you pivot to a simpler custom NFT contract for your marketplace?