Improvements

Gas Cost

Like Sign Up, in Smart Contract, a problem in which conditional statements are added or functions are separated due to specific data easily occurs.

Even in this situation, if there was no userCount in UserData, the number of functions would decrease, and the conditions checked in the function that users call each time they register a text would decrease, reducing Gas Used by Transaction.

It was necessary to calculate the need for gas and userCount that can be reduced due to the userCount variable.

Preventing Abusing

All Transactions, such as memberchip registration and consent to receive marketing informating, are signed by User's Private Key.

This means that the user can call the functions of Contract directly other than the method of accessing through the service.

However, since all transactions generated in the service operate as Fee Delegated, there is no burden on the user, while accessing the contract directly is not a significant benefit for the user becauser the user has to pay the Transaction Fee directly.

However, if the value of the token obtained bu writing is greater than the Transaction Fee entered when registering a text, users will be able to view it regardless of the Transaction Fee.

The easiest way to solve this is to sign Transaction with the administrator's private key, not the user's private key.

However, this could easily prevent viewing, but it would not be able to urilize Klaytn's Fee Delegated, and could mean losing 'decentralization'.

Last updated