You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/smart-contract-security-near.md
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "NEAR Smart Contract Security"
2
+
title: "Smart contract security: NEAR"
3
3
date: 2024-07-18T00:00:00+09:00
4
4
draft: true
5
5
# lastmod: 2024-07-17
@@ -36,10 +36,14 @@ When writing smart contracts on NEAR, many of the same general principles apply
36
36
37
37
[^cei]: This is a generalization of the concept Solidity developers know as a "reentrancy" vulnerability, usually addressed by the [_Checks-Effects-Interactions_ order of operations](https://docs.soliditylang.org/en/latest/security-considerations.html#reentrancy).
38
38
39
-
Therefore, rather than regurgitate tired principles well-visited elsewhere, I shall provide practical advice from my own experience in the effective development of NEAR smart contracts.
39
+
Therefore, rather than regurgitate tired principles well-visited elsewhere, I shall provide specific, practical advice from my own experience in the effective development of NEAR smart contracts.
40
40
41
41
## Security
42
42
43
+
### Asynchronous cross-contract calls
44
+
45
+
### Account model
46
+
43
47
### Numbers
44
48
45
49
- Arithmetic overflow
@@ -50,7 +54,7 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
50
54
- Gas
51
55
- Argument serialization in callbacks
52
56
- Callback protection
53
-
- Writing ext_\* traits to be maximally flexible
57
+
- Writing `#[ext_contract(...)]` traits to be maximally flexible
54
58
55
59
### Serialization
56
60
@@ -64,6 +68,7 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
64
68
65
69
- SDK collections
66
70
- Prefixing & storage keys
71
+
- Default struct storage key "STATE"
67
72
- Deleting collections
68
73
- Avoiding soft-locking
69
74
@@ -86,6 +91,8 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
0 commit comments