Skip to content

Commit 76685e1

Browse files
committed
Fix formating issues
1 parent 2a14737 commit 76685e1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

not-so-smart-contracts/ton/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Each _Not So Smart Contract_ consists of a standard set of information:
1414

1515
## Vulnerabilities
1616

17-
| Not So Smart Contract | Description |
18-
| ---------------------------------------------------------------------------- | ------------------------------------------------------------ |
19-
| [Int as Boolean](int_as_boolean) | Unexpected result of logical operations on the int type |
20-
| [Fake Jetton contract](fake_jetton_contract) | Any contract can send a `transfer_notification` message |
17+
| Not So Smart Contract | Description |
18+
| -------------------------------------------- | ------------------------------------------------------- |
19+
| [Int as Boolean](int_as_boolean) | Unexpected result of logical operations on the int type |
20+
| [Fake Jetton contract](fake_jetton_contract) | Any contract can send a `transfer_notification` message |
2121

2222
## Credits
2323

not-so-smart-contracts/ton/fake_jetton_contract/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
TON smart contracts use the `transfer_notification` message sent by the receiver's Jetton wallet contract to specify and process a user request along with the transfer of a Jetton. Users add a `forward_payload` to the Jetton `transfer` message when transferring their Jettons, this `forward_payload` is forwarded by the receiver's Jetton wallet contract to the receiver in the `transfer_notification` message. The `transfer_notification` message has the following TL-B schema:
44

55
```
6-
transfer_notification#7362d09c query_id:uint64 amount:(VarUInteger 16)
6+
transfer_notification#7362d09c query_id:uint64 amount:(VarUInteger 16)
77
sender:MsgAddress forward_payload:(Either Cell ^Cell)
88
= InternalMsgBody;
99
```
@@ -27,14 +27,14 @@ The following simplified code highlights the lack of token_id validation in the
2727
slice sender_address = cs~load_msg_addr(); ;; incorrectly assumed to be Jetton wallet contract owned by this contract
2828
2929
(cell token0_balances, cell token1_balances) = load_data(); ;; balances dictionaries
30-
30+
3131
(int op, int query_id) = in_msg_body~load_op_and_query_id();
3232
3333
if (op == op::transfer_notification) {
3434
(int amount, slice from_address) = (in_msg_body~load_coins(), in_msg_body~load_msg_addr());
3535
cell forward_payload_ref = in_msg_body~load_ref();
3636
slice forward_payload = forward_payload_ref.begin_parse();
37-
37+
3838
int is_token0? = forward_payload.load_int(1);
3939
4040
if (is_token0?) {

not-so-smart-contracts/ton/int_as_boolean/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using int as boolean values
22

3-
In FunC, booleans are represented as integers; false is represented as 0 and true is represented as -1 (257 ones in binary notation).
3+
In FunC, booleans are represented as integers; false is represented as 0 and true is represented as -1 (257 ones in binary notation).
44

55
Logical operations are done as bitwise operations over the binary representation of the integer values. Notably, The not operation `~` flips all the bits of an integer value; therefore, a non-zero value other than -1 becomes another non-zero value.
66

@@ -69,6 +69,7 @@ The following simplified code highlights the unexpected behavior of the `~` oper
6969
```
7070

7171
The `recv_internal` function above prints the following debug logs:
72+
7273
```
7374
#DEBUG#: correct_true is true
7475
#DEBUG#: ~correct_true is false
@@ -80,7 +81,7 @@ The `recv_internal` function above prints the following debug logs:
8081
#DEBUG#: ~negative is true
8182
```
8283

83-
It demonstrats that the `~ 10` and `~ -10` both evaluate to `true` instead of becoming `false` with the `~` operator.
84+
It demonstrats that the `~ 10` and `~ -10` both evaluate to `true` instead of becoming `false` with the `~` operator.
8485

8586
## Mitigations
8687

0 commit comments

Comments
 (0)