1

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?

1 Answer 1

0

You can't know the USD value of EOS as dictated by off-chain exchanges unless you make an off-chain API call, and there are no on-chain (decentralised) exchanges on EOS right now.

1
  • Thanks. Are there any strategies that could be implemented to mitigate this, e.g set up a contract that is constantly updatee with the current price of EOS that can be called from other contracts?
    – ljenkins
    Jul 28, 2018 at 22:38

Your Answer

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

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