Say I have created my own custom token (TOK) that I value at 100 TOK = 1 USD. Is there a way I can create a smart contract that accepts EOS from an account and then transfers TOK to an account, whilst taking into account the current USD value of EOS? Or is there a way to do this that I'm missing?
E.g. Account1 wants 100 TOK so they send the contract 0.11933 EOS (1 USD worth). How can the contract know the current value of EOS (in USD) in order to calculate how much TOK to send back?