effectai / effect-network

Smart contracts and documentation for Effect Network
MIT License
46 stars 9 forks source link

Conversion from NEO to EOS precision #5

Closed jeisses closed 4 years ago

jeisses commented 5 years ago

I think it makes most sense to perform this conversion inside the smart contract. Currently the posttx step is assumed to receive a 1e4 int formatted amount. When it receives a raw NEO amount (1e8) it will have to round it to lower precision.

JrSchild commented 5 years ago

In the backend I made validation for this. It will be rejected if the given NEO amount has a higher precision than four. But up to you if you want to move this to the smart contract.

jeisses commented 5 years ago

Yes I noticed, the backend validation is good :+1: For now that works and the smart contract assumes to receive an amount in precision of 4

When we want to make the token swap more generic (e.g. nep5 to eos token) or experiment with parsing the raw NEO transaction we'd have to validate it in the contract