0

I have deployed a contract which implements Ownable and IERC721Receiver.

The issue I am facing is that this particular contract does not implement any function to grant approval to other contracts in regards to the tokens held in it (ERC20, ERC721). Is there a way to execute these approval functions as one would via etherscan or remix on behalf of the contract?

I am guessing chances are slim to none!

1 Answer 1

0

No. There is no way to execute anything "on behalf of" another user or contract. One can only call a contract function that knows what to do. So, the contract author has either built in the capability or it is not possible.

Consider something like (pseudo):

function approveERC20Spender(address token, address spender, uint amount) external onlyOwner {
  // this contract can "approve" spenders of tokens owned by this contract
  ERC20(token).safeApprove(spender, amount);
}

Hope it helps.

Your Answer

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

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