I am learning ERC20 contract and stuck with allowance and transferFrom part.
Approve function approves an allowance for an address (spender) to transfer tokens from owner's contract to another address. After approval, the address (spender) could call transferFrom to send to other address from owner's contract, any amnt within allowances approed.
The point I am stuck is, how do I test this. I tried both Remix and deploying in Ethereum Wallet with test node but in vain.
Q1: In remix, I could create owner's contract and then call its functions. But how do I call contract function's from another address? For eg, owner's contract address: 0xca35b7d915458ef540ade6068dfe2f44e8fa733c spender address: 0x1111111111111111111111111111111111111111
how do I call (0x1111111111111111111111111111111111111111).approve or transferFrom to carry out this operation?
Q2: I tried deploying in Ethereum wallet in test node, but in vain. Contract created successfully with tokens, function calls shown as success for transfer, approve, transferFrom but no value shows up either reduced from owner's contract or as received in recipient account.
Can anyone you please check my code below and help? (I could not paste entire code here with proper formatting, so giving a link) https://gist.github.com/parthi2929/f2d535253fcb0b9ebccbfb980ff52c1d