Skip to content

Commit 019b8b2

Browse files
committed
wip: smart contract security near
1 parent db80677 commit 019b8b2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

content/blog/near-smart-contract-security.md renamed to content/blog/smart-contract-security-near.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "NEAR Smart Contract Security"
2+
title: "Smart contract security: NEAR"
33
date: 2024-07-18T00:00:00+09:00
44
draft: true
55
# lastmod: 2024-07-17
@@ -36,10 +36,14 @@ When writing smart contracts on NEAR, many of the same general principles apply
3636

3737
[^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).
3838

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.
4040

4141
## Security
4242

43+
### Asynchronous cross-contract calls
44+
45+
### Account model
46+
4347
### Numbers
4448

4549
- Arithmetic overflow
@@ -50,7 +54,7 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
5054
- Gas
5155
- Argument serialization in callbacks
5256
- Callback protection
53-
- Writing ext_\* traits to be maximally flexible
57+
- Writing `#[ext_contract(...)]` traits to be maximally flexible
5458

5559
### Serialization
5660

@@ -64,6 +68,7 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
6468

6569
- SDK collections
6670
- Prefixing & storage keys
71+
- Default struct storage key "STATE"
6772
- Deleting collections
6873
- Avoiding soft-locking
6974

@@ -86,6 +91,8 @@ Therefore, rather than regurgitate tired principles well-visited elsewhere, I sh
8691

8792
### Source code verification
8893

94+
### Upgrading & state migration
95+
8996
## Optimization
9097

9198
### Avoiding `.unwrap()`

0 commit comments

Comments
 (0)