CREDITSCOM / node

Credits Node is the main module that provide an opportunity to run a node and participate in CREDITS blockchain network.
https://developers.credits.com/
GNU Affero General Public License v3.0
151 stars 16 forks source link

Problem with smart contracts #55

Open PresidentNavalny opened 4 years ago

PresidentNavalny commented 4 years ago

where is the section bug bounty?)

My English is not perfect, so for a better understanding of the problem, after the English description I posted the Russian version of this text because most of the developers are Russian

I noticed this bug for the first time 4 months ago, but decided to write about it only now. The point is, sometimes smart contracts respond to your commands, not the way they're programmed. An example is a smart contract that sends coins to other accounts. You send him for example 3 coins and he must send these 3 coins in equal parts to other accounts. In most cases, this is what happens. But there are situations when this smart contract just takes the coins that you sent him and does not forward them to other accounts. Example: smart contract "7sbMzAyyB5hJLfwcZtoLt5KhC4DSuuXLze26mx2nm4wb 11 It sends equal parts of the received coins, the other three accounts. I sent him 1 CS (hash transaction "5151631.1") 22 and he had to send the other 3 accounts equal 0.3333333333333333 CS, but he didn't, instead it's just confirmation of where the smart contract itself sends a zero transaction (transaction hash "5151634.1") 33 If you look at the balance of this smart contract, we see that in his account, 0.378048044649113501 CS. 44 It turns out that 1 CS that I sent him he is not listed on the balance sheet, as they did not return to the wallet of the sender. The coins dissolved into thin air. Similar things happen intermittently with other smart contracts. At some point, they behave inappropriately and can just take your coins, even if they are not programmed

Я заметил этот баг впервые еще 4 месяца назад, но написать об этом решил только сейчас. Суть в том что, иногда смарт контракты реагируют на твои команды, не так, как они запрограммированы. Пример смарт контракт, который пересылает монеты другим аккаунтам. Ты отправляешь ему к примеру 3 монеты и он должен эти 3 монеты отправить равными частями другим аккаунтам. В большинстве случаев, все так и происходит. Но бывают ситуации, когда этот смарт контракт просто забирает монеты которые ты ему отправил и не пересылает их другим аккаунтам. Пример: смарт контракт "7sbMzAyyB5hJLfwcZtoLt5KhC4DSuuXLzE26mX2nm4wb"-он пересылает равными частями полученные монеты трем другим адресам. Я отправил ему 1 CS (хеш транзакции "5151631.1") и он должен был отправить другим 3 аккаунтам поровну по 0.3333333333333333 CS, но он этого не сделал, вместо этого пришло просто подтверждение где смарт контракт отправляет сам себе нулевую транзакцию (хеш транзакции "5151634.1") Если посмотреть на баланс этого смарт контракта, то мы видим, что у него на счету 0.378048044649113501 CS. Получается, что 1 CS которые я ему отправил у него не числятся на балансе, так же они не вернулись на кошелек отправителя. Монеты растворились в воздухе. Похожее происходит периодически и с другими смарт контрактами. В какой то момент они ведут себя неадекватно и могут просто забрать твои монеты, даже если они на это не запрограммированы.

PresidentNavalny commented 4 years ago

At the bottom there is a Russian version of the text.

A continuation of what I was talking about. Two different gaming smart contracts did not pay out the winnings. Example number 1. Egypt Slots app-http:/ / egypt slots.net/. I played it for 10-15 minutes and everything was fine. When I won, I was paid the winnings, when I lost no. Then this happened: I bet 0.1 cs https://monitor.credits.com/CreditsNetwork/transaction/24513601.1 1 smart contract replied that my bet is winning and I should get 0.2 cs https://monitor.credits.com/CreditsNetwork/transaction/24513604.1 2 at this point, this smart contract had 1.4 cs on its balance sheet https://monitor.credits.com/CreditsNetwork/account/EYvmJjycxhgxXjueZPzUAGvcZaTctWE8dMKhgY7A1gUH. 3 However, he did not pay me my winnings

Example number 2. Maya Slots application-http: / / mayaslots. com/. Here everything happened the same as in example number 1. I bet 0.1 cs https://monitor.credits.com/CreditsNetwork/transaction/24516224.1 1,1 smart contract replied that my bet is winning and I should get 0.2 cs https://monitor.credits.com/CreditsNetwork/transaction/24516227.1 2,2 at this point this smart contract had 1.1 cs on its balance sheet https://monitor.credits.com/CreditsNetwork/account/TmrvEvosUF4TC78NMcEz7n27WGqvJapPabY5TGQ9zPg. 3,3 However, he did not pay me my winnings

***РУССКАЯ ВЕРСИЯ ТЕКСТА

Продолжение того о чем я говорил. Два разных игровых смарт контракта не выплатили выигрыш. Пример номер 1. Приложение Egypt Slots-http://egyptslots.net/. Я играл в него в течении 10-15 минут и все было нормально. Когда я выигрывал, мне выплачивали выигрыш, когда проигрывал нет. Затем произошло это: Я сделал ставку 0.1 cs https://monitor.credits.com/CreditsNetwork/transaction/24513601.1 1 смарт контракт ответил что моя ставка выигрышная и я должен получить 0.2 cs https://monitor.credits.com/CreditsNetwork/transaction/24513604.1. 2 В этот момент на балансе у этого смарт контракта было 1.4 cs https://monitor.credits.com/CreditsNetwork/account/EYvmJjycxhgxXjueZPzUAGvcZaTctWE8dMKhgY7A1gUH. 3 Однако мой выигрыш он мне не выплатил.

Пример номер 2. Приложение Maya Slots-http://mayaslots.com/. Здесь произошло все тоже самое что и в примере номер 1. Я сделал ставку 0.1 cs https://monitor.credits.com/CreditsNetwork/transaction/24516224. 1,1 смарт контракт ответил что моя ставка выигрышная и я должен получить 0.2 cs https://monitor.credits.com/CreditsNetwork/transaction/24516227.1 2,2 В этот момент на балансе у этого смарт контракта было 1.1 cs https://monitor.credits.com/CreditsNetwork/account/TmrvEvosUF4TC78NMcEz7n27WGqvJapPabY5TGQ9zPg. 3,3 Однако мой выигрыш он мне не выплатил