Ok, I see @rob-hitchens-b9lab has answered the question beautifully while I was busy ;), so I'll give a short, cookbook answer of the steps
I don't know what you're using but most people are familiar with Remix, so here are the steps in Remix:
- In the "Solidity Compiler" tab, create and compile an
Erc20token.sol
file :
interface Erc20Token {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
- In the "Deploy and Run Transactions" tab, use the token address
0x8eb24319393716668d768dcec29356ae9cffe285
from the snet contract (your contract), with the "At Address" option instead of "Deploy":

From the same tab, use the "approve" method of the contract. I used amount
equal to 1. The approved address should be the snet contract, 0x813870feba76f27ec1AfcF79432e065A4839F7AB
. (Here's the approve transaction on Etherscan.)
Now go through similar steps as above to get your sns contract to appear in the "deployed contracts" section. Use your snet contract's "buy" method, as you did before, making sure amount is at most the amount approved in step 3.
As you can see from Etherscan, I used some of my precious test Ether to do the steps above, so your contract will show a transaction from one of my dev accounts :) .
After doing all the above, I realized although I approved a token transfer, I don't actually have any of your tokens, so the final "buy" transaction would fail when trying to do the transfer. I'm pretty confident it would work otherwise though.