1/5
我更新了WTF Solidity安全篇S03:中心化风险。

这一讲,我们介绍了中心化和伪去中心化的风险。

区块链审计公司Certik在2021年DeFi安全报告将中心化风险列为排名第一的风险,有 44 次 DeFi 黑客攻击与它相关,造成用户资金损失超过 13 亿美元。
github.com/AmazingAng/WTF…

#solidity #web3 #hack
2/5
中心化风险指智能合约的所有权是中心化的,例如合约的owner由一个地址控制,存在单点风险,容易被黑客和内鬼利用。

伪去中心化风险是指合约所有权由多签钱包管理,但几个多签人是一致行动人,背后由一个人控制。这类项目由于包装的很去中心化,容易得到投资者信任,所以被盗金额也往往更大。
3/5
近两年爆火的链游项目 Axie 的 Ronin 链跨链桥项目在2022年3月被盗 6.24 亿美元,是历史上被盗金额最大的事件。Ronin 跨链桥由 9 个验证者维护,必须有 5 个人达成共识才能批准存款和提款交易。但实际上,其中5个多签都由 Axie 的开发公司 Sky Mavis 直接或间接控制。
4/5
Harmony 公链的跨链桥在2022年6月被盗 1 亿美元。Harmony 桥由5 个多签人控制,很离谱的是只需其中 2 个人签名就可以批准一笔交易。在黑客设法盗取两个多签人的私钥后,将用户质押的资产盗空。
5/5
三种做法防范中心化风险:
1. 使用多签钱包管理国库和控制合约参数。
2. 多签持有人要多样化。
3. 使用时间锁控制合约。

MIrror: mirror.xyz/ninjak.eth/0Ml…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with 0xAA (📜,🤝,🔰)

0xAA (📜,🤝,🔰) Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @0xAA_Science

Oct 15
1/

A Bug that has cost FTX hundreds of $ETH, and is not fixed yet.

Let's learn how devs turn free withdrawals in FTX to free money.

A thread 👇
@FTX_Official @SBF_FTX @FTX_Benson
2/

Typically, users need to pay a fee for $ETH or ERC20 tokens withdrawal from CEX to Ethereum, since the gas is expensive.

But in FTX, if you stake $FTT, the native token of FTX, you will get free $ETH and ERC20 withdrawals, 3~1000 times a day depending on the staked amounts.
3/

In EVM, a special function -- the fallback function -- is executed whenever contracts receive $ETH. And the user who sends $ETH to the contract pays the gas fee for the execution.

docs.soliditylang.org/en/v0.8.17/con…
Read 6 tweets
Oct 12
1/2
看了下 @joshua_j_lim 对Mango Market被黑的分析。

1. 这不是简单的合约漏洞,而是经济模型漏洞,有点像去年BSC上的借贷平台Venus被黑。 @VenusProtocol

2. 黑客动用了1000w USDC来发动攻击,获利约1亿u,也是下了血本的。 ImageImage
2/2
3. 黑客短时间买入了大量Mango,将币价从 $0.038 拉到 $0.91,然后通过借贷,将协议内的其他代币借走。

4. 黑客哪来的这么多钱?

原分析帖:
3/2
黑客具体操作:
黑客有两个账号A和B,每个账号有500w u USDC

账号A 500w u作为抵押,铸造了很多Mango永续合约卖单。
账号B 用500w u去买Mango永续合约,买到了很多Mango,并拉高币价,最高时价值5亿u。
账号B用Mango作为抵押品,将协议中有价值的资产搬空,获利1亿 u。
Read 4 tweets
Oct 8
1/11
GitHub Solidity仓库 Top 10🔥

Solidity是编写以太坊智能合约的语言,由于Web3的开源文化,在GitHub搜Solidity能搜到4.5万个仓库。

这个帖子带大家了解下排名前10的Solidity开源项目。
#solidity #web3 #opensource #github #Ethereum
a thread 👇
2/11
第1名:Solidity官方代码库

@solidity_lang 官方维护。

Solidity是一种由C++编写的静态类型、面向合约的高级语言,用于在以太坊平台上实现智能合约。

这个repo中包含了solidity源码、文档、例子等资源。

repo在活跃维护中。

github.com/ethereum/solid…
3/11
第2名:Full Blockchain Solidity Course with python

面向python开发者的Solidity和区块链课程,由 @PatrickAlphaC @freeCodeCamp @chainlink 维护,是目前最火的区块链课程,包含视频,笔记,和相关资源,适合新人学习。

repo在活跃维护中。

github.com/smartcontractk…
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(