I want to send an erc20 token to the constructor of a contract. I can't manually use the approve(spender, amount)
function before deploying the contract as the spender address needs to be the address of the contract. If I use token.approve
or token.transfer
methods in the contract it returns transfer amount exceeds balance, though I have sufficient balance in my account. I assume that it's trying to approve or transfer tokens from the contract.
Note: This question is different from this. Using token.approve
inside the contract approves from the contract and not from msg.sender.