0

I know in solidity you can use identifiers like ether and wei. For example, I can do something like

if (msg.value == 1 ether) {
   //do something
}

Is it possible for me to use stable coins as a type definition? I'm asking this because I want all of the escrow to be in terms of a stable currency.

I'm specifically trying to work with ethereum smart contracts, but I'm new to smart contracts, though I coded some in only ethereum.

0

No, you can't refer to stablecoins (stabletokens, more likely) like that. You need to make external contract calls to get the value of the desired token from somewhere and then compare that to something.

2
  • Let's assume there are two methods in the contract that two users can access. The users send money to the smart contract using these two methods. Can I access the value that is being sent in those methods and compare it to an an amount? How do I know how much the user has passed in, in terms of stable coins. Do you have any documentation I can look at?
    – Asker123
    Sep 29 '20 at 13:50
  • Such functionality is not native to the EVM, you have to read documentation of other projects to find out the price; start with for example Uniswap. Sep 29 '20 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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