current position:Home>Can an eth contract method be implemented?

Can an eth contract method be implemented?

2022-02-03 23:13:46 Q & A of Denglian community

Users will receive dividends every day after recharging , Dividend calculation is 0 spot , According to the ratio of the user's quota to the total quota ,0 The calculation of points is under the chain , The calculated value is not linked , Users can draw dividends at any time , It is hoped that the user will pay the handling fee when withdrawing , In this way, it is possible for users to write the amount of withdrawal at will , There is no way to confirm the actual value on the chain , How can such a problem be realized




Take the answer 1:

I've had similar problems , You can use a signature , Set up a platform account ( When the contract is deployed, specify , similar owner), When the user extracts , Sign a transaction with the private key of the platform account , similar : The order number + Address of the user + amount of money , The order number chain must be unique , Let the user initiate an operation with this signature string , The address to restore the signature on the chain , Check whether the recovered address is the platform address , At the same time, save the order number to the chain ( Ensure that this signature is not reused ), Then transfer the corresponding amount to the user's address .




copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032313444260.html

Random recommended